Skip to main content
v2026.11,986 entries · CC-BY 4.0

HL7 Data Segmentation for Privacy (DS4P): Healthcare Classification System (HCS), Security Labels, and 42 CFR Part 2

Technical guide to HL7 Data Segmentation for Privacy (DS4P) across C-CDA and HL7 FHIR, detailing the Healthcare Classification System (HCS), meta.security tags, ONC § 170.315(b)(7)–(8) certification, and 42 CFR Part 2 substance use disorder segmentation.

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:

  1. Confidentiality Classification (http://terminology.hl7.org/CodeSystem/v3-Confidentiality): A hierarchical clearance level indicating the overall access restriction tier (such as Normal N, Restricted R, or Very Restricted V).
  2. 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, ETH for substance abuse, PSY for psychiatry, or HIV).
  3. Integrity Classification: Indicates the trustworthiness or provenance assurance level of the clinical data.
  4. Compartment Tags: Logical organizational or care-team enclaves (such as a specific research protocol compartment or behavioral health clinic compartment).
  5. 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 (TREAT for treatment, ETREAT for emergency treatment, HPAYMT for payment, or HRESCH for 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"
}

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:

  1. 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.20 Opioid Dependence), the SLS stamps the resource with Confidentiality = R and Sensitivity = ETH.
  2. Policy Decision Point (PDP) Evaluation Against Patient Consent: The access control engine evaluates the requester’s identity, organizational affiliation, and declared PurposeOfUse (such as TREAT or HRESCH) 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.
  3. Policy Enforcement Point (PEP) Segmentation (Redaction vs. Masking):
    • If the patient has not consented to share ETH or PSY data with the requester, the PEP strips (redacts) only the ETH/PSY-labeled entries from the outgoing C-CDA or FHIR Bundle, appends the REDACT obligation code, and delivers the rest of the patient’s normal (N) medications, allergies, and medical problems intact.
    • If the patient has consented to share ETH data, the PEP transmits the tagged entries along with the mandatory 42CFRPart2 / NORDSCLCD refrain policy and PERSISTLABEL obligation so the receiving EHR (45 CFR § 170.315(b)(8)) preserves the segmentation boundary in its database.

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.

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.

Follow CASRAI

Research-administration guidance, standards updates and independent tool reviews.

Ask CASRAI · full access

Ask about HL7 Data Segmentation for Privacy (DS4P): Healthcare Classification System (HCS), Security Labels, and 42 CFR Part 2

Full access: large monthly usage, up to 10 source passages behind each answer, and MCP and API access for Claude Code, Codex and other CLIs. Cancel any time.

An AI assistant for research: funder rules, compliance, methods and publishing. It links the sources behind its answers and labels answers that come from a web search.

Answers draw on CASRAI's guides and dictionary plus the federal and funder documents we index: Federal Register, Grants.gov, Regulations.gov and UKRI.

Works on this site and inside Claude, Cursor and the AI tools you already use.

Everything CASRAI publishes — this page, the dictionary, the guides and the news — stays open to read, with no account and no card.

Referenced across the research world

University of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logoUniversity of Cambridge logoColumbia University logoCrossref logoUniversity of Edinburgh logoHarvard University logoUniversity of Oxford logoPrinceton University logoStanford School of Medicine logoUniversity College London logoORCID logo
  • University of Cambridge logo
  • Columbia University logo
  • Crossref logo
  • University of Edinburgh logo
  • Harvard University logo
  • University of Oxford logo
  • Princeton University logo
  • Stanford School of Medicine logo
  • University College London logo
  • ORCID logo

View CASRAI adoption →