Written and maintained by CASRAI Editorial Board
Published · Last updated
On this page
HL7 Data Segmentation for Privacy (DS4P) is an interoperability standard and suite of HL7 Implementation Guides (covering both Consolidated CDA [C-CDA] R2 and HL7 FHIR) that enables electronic health record (EHR) systems and health information exchanges (HIEs) to apply standardized, machine-computable security labels to clinical documents, sections, and individual clinical entries or resources. Built on the HL7 Healthcare Classification System (HCS), DS4P allows health IT systems to isolate and enforce granular patient consent directives for specially protected clinical data—such as federal 42 CFR Part 2 substance use disorder (SUD) records, psychiatric notes, HIV status, reproductive health, and genetic test results—without blocking exchange of the rest of the patient’s medical record.
What Is HL7 Data Segmentation for Privacy (DS4P) and the Healthcare Classification System (HCS)?
Historically, when a patient received care at a facility treating both general medical conditions and sensitive behavioral health or substance use disorders, EHRs faced a binary choice during opt-out health information exchange (HIE) queries: either withhold the patient’s entire clinical summary (degrading patient safety in emergency departments) or transmit the entire summary unredacted (risking unauthorized disclosure under 42 CFR Part 2 or state mental health privacy statutes).
Developed through the Office of the National Coordinator for Health Information Technology (ONC) Standards & Interoperability (S&I) Framework and HL7 Security Work Group, HL7 DS4P solves this problem by pairing Attribute-Based Access Control (ABAC) with the HL7 Healthcare Classification System (HCS). The HCS defines five standardized categories of security metadata (HL7 v3 SecurityLabel / FHIR Coding value sets) that travel with the clinical data:
- Confidentiality Classification (
http://terminology.hl7.org/CodeSystem/v3-Confidentiality): A hierarchical clearance level indicating the overall access restriction tier (such as NormalN, RestrictedR, or Very RestrictedV). - Sensitivity / Information Type Category (
http://terminology.hl7.org/CodeSystem/v3-ActCode): Identifies the specific clinical or statutory sensitivity domain that triggered the restriction (for example,ETHfor substance abuse,PSYfor psychiatry, orHIV). - Integrity Classification: Indicates the trustworthiness or provenance assurance level of the clinical data.
- Compartment Tags: Logical organizational or care-team enclaves (such as a specific research protocol compartment or behavioral health clinic compartment).
- Handling Caveats (ObligationPolicy, RefrainPolicy, and PurposeOfUse): Machine-readable instructions dictating what the receiving system must do (e.g.,
ENCRYPT,PERSISTLABEL), what it must refrain from doing (e.g.,NORDSCLCD— Prohibition on Redisclosure without patient consent), and the authorized Purpose of Use (TREATfor treatment,ETREATfor emergency treatment,HPAYMTfor payment, orHRESCHfor healthcare research).
How Do meta.security Labels (Confidentiality Codes N, R, V and Sensitivity Tags Like ETH, PSY, HIV) Work in C-CDA and HL7 FHIR?
In HL7 FHIR R4/R5 (governed by the HL7 FHIR Data Segmentation for Privacy [DS4P] Implementation Guide), every resource inherits a common Resource.meta.security array of Coding elements. In C-CDA R2.1 (governed by ONC certification criteria at 45 CFR § 170.315(b)(7) Security Tags – Summary of Care – Send and § 170.315(b)(8) Security Tags – Summary of Care – Receive), the same HCS vocabulary is encoded inside XML confidentialityCode and EntryRelationship observation templates at the document, section, or individual entry level.
| HCS Security Tag Category | HL7 Code | Display Name | Operational Meaning in DS4P Exchange |
|---|---|---|---|
| Confidentiality | N |
Normal | Standard clinical data governed by baseline HIPAA TPO (Treatment, Payment, Health Care Operations) rules |
| Confidentiality | R |
Restricted | Sensitive clinical data requiring affirmative patient authorization (such as an HL7 FHIR Consent resource) or specific ABAC role/purpose-of-use clearance |
| Confidentiality | V |
Very Restricted | Highest restriction tier (e.g., psychotherapy notes under 45 CFR § 164.508(a)(2) or sealed adoption/VIP records) requiring explicit clinician/patient release |
| Sensitivity | ETH (or SUD) |
Substance Abuse Information Sensitivity | Flags medications (e.g., buprenorphine, methadone), diagnoses, or labs subject to federal 42 CFR Part 2 substance use disorder protections |
| Sensitivity | PSY |
Psychiatry Disorder Information Sensitivity | Flags mental health diagnoses, assessments, and psychiatric treatment records governed by state behavioral health privacy laws |
| Sensitivity | HIV / GDS / SEX |
HIV / Genetic / Reproductive Sensitivity | Flags HIV/AIDS status, genetic disease testing (GINA / state genetic laws), or sexual/reproductive health entries |
| Refrain Policy | NORDSCLCD / 42CFRPart2 |
No Redisclosure Without Consent | Attaches the mandatory federal 42 CFR § 2.32 prohibition on redisclosure notice to the tagged resource or document |
| Obligation Policy | PERSISTLABEL |
Persist Security Label | Requires the receiving EHR (§ 170.315(b)(8)) to retain the security tags on the imported data so downstream exports do not strip privacy protections |
Example HL7 FHIR Observation Tagged with DS4P meta.security
{
"resourceType": "Observation",
"id": "urine-toxicology-buprenorphine",
"meta": {
"security": [
{
"system": "http://terminology.hl7.org/CodeSystem/v3-Confidentiality",
"code": "R",
"display": "restricted"
},
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "ETH",
"display": "substance abuse information sensitivity"
},
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "42CFRPart2",
"display": "42 CFR Part 2"
},
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "NORDSCLCD",
"display": "no disclosure without subject directive"
},
{
"system": "http://terminology.hl7.org/CodeSystem/v3-ActCode",
"code": "PERSISTLABEL",
"display": "persist security label"
}
]
},
"status": "final"
}
How Does DS4P Enforce Granular 42 CFR Part 2 Substance Use Disorder and State Sensitive-Condition Consent Directives During HIE Exchange?
In production HIE architectures—modeled on the open-source SAMHSA Consent2Share (C2S) reference implementation and modern FHIR Security Labeling Services (SLS)—DS4P segmentation executes through a four-step automated pipeline whenever an external provider or research registry requests a patient’s record:
- Clinical Concept Classification (Security Labeling Service / SLS): An automated classifier scans every structured clinical resource or C-CDA entry (ICD-10-CM problems, SNOMED CT procedures, RxNorm medications, and LOINC lab results) against curated sensitivity value sets maintained in the NLM Value Set Authority Center (VSAC). Whenever a code matches a sensitive value set (for example, RxNorm buprenorphine/naloxone or ICD-10-CM
F11.20Opioid Dependence), the SLS stamps the resource withConfidentiality = RandSensitivity = ETH. - Policy Decision Point (PDP) Evaluation Against Patient Consent: The access control engine evaluates the requester’s identity, organizational affiliation, and declared
PurposeOfUse(such asTREATorHRESCH) against the patient’s active HL7 FHIR Consent directive (consent.provision). Even after the 2024 HHS/SAMHSA Final Rule aligning 42 CFR Part 2 with HIPAA (which permits a single broad consent for all future TPO uses), patients retain the right to revoke TPO consent or restrict specific categories, and SUD counseling notes remain strictly separated on par with psychotherapy notes. - Policy Enforcement Point (PEP) Segmentation (Redaction vs. Masking):
- If the patient has not consented to share
ETHorPSYdata with the requester, the PEP strips (redacts) only theETH/PSY-labeled entries from the outgoing C-CDA or FHIR Bundle, appends theREDACTobligation code, and delivers the rest of the patient’s normal (N) medications, allergies, and medical problems intact. - If the patient has consented to share
ETHdata, the PEP transmits the tagged entries along with the mandatory42CFRPart2/NORDSCLCDrefrain policy andPERSISTLABELobligation so the receiving EHR (45 CFR § 170.315(b)(8)) preserves the segmentation boundary in its database.
- If the patient has not consented to share
Frequently Asked Questions
What is HL7 Data Segmentation for Privacy (DS4P) and the Healthcare Classification System (HCS)?
HL7 Data Segmentation for Privacy (DS4P) is an interoperability specification for C-CDA and HL7 FHIR that attaches standardized security metadata—defined by the HL7 Healthcare Classification System (HCS)—to clinical documents, sections, and individual entries so EHRs can selectively redact or share sensitive health records according to patient consent directives and statutory privacy rules.
How do meta.security labels (Confidentiality codes N, R, V and sensitivity tags like ETH, PSY, HIV) work in C-CDA and HL7 FHIR?
In HL7 FHIR (Resource.meta.security) and C-CDA (confidentialityCode), a Confidentiality tag sets the access clearance tier (N = Normal, R = Restricted, V = Very Restricted), while Sensitivity tags specify the protected clinical domain (ETH = substance abuse, PSY = psychiatry, HIV = HIV status) and Handling Caveats (NORDSCLCD, 42CFRPart2, PERSISTLABEL) enforce downstream redisclosure prohibitions and tag persistence.
How does DS4P enforce granular 42 CFR Part 2 substance use disorder and state sensitive-condition consent directives during HIE exchange?
A Security Labeling Service (SLS) matches clinical codes (ICD-10-CM, SNOMED CT, RxNorm, LOINC) against VSAC sensitivity value sets to tag sensitive entries (ETH, PSY), and a Policy Enforcement Point (PEP) checks the patient’s active FHIR Consent directive—redacting unauthorized sensitive entries while allowing normal (N) medical data to flow uninterrupted, or attaching mandatory 42 CFR Part 2 redisclosure warnings when disclosure is authorized.







