Lesson 27 of 51 · Using Terminologies in Messages

Value Sets, Bindings, and the CWE Data Type

Value Sets and Binding

From “a code” to “a code from the right list”

The previous module established the major code systems. But a field in a message rarely accepts any code from any system. A “result status” field expects a small set of status codes; an “administrative sex” field expects a handful of values; a “lab test” field expects a LOINC code, not a SNOMED disorder. The mechanism that says which codes are allowed in this field, for this use, is the value set and the binding that ties it to the field.

The CWE data type carries a coded value

In HL7 v2, the data type built to carry coded values is CWE — Coded With Exceptions. Its components hold exactly the triplet the previous module identified, plus room for an alternate coding 1:

CWE:  identifier ^ text ^ name of coding system ^ alt id ^ alt text ^ alt coding system
       2345-7    ^ Glucose [Mass/volume] in Serum or Plasma ^ LN
  • CWE.1 identifier — the code itself (2345-7).
  • CWE.2 text — the human-readable display.
  • CWE.3 name of coding systemwhich system the code is from. LN denotes LOINC; SCT denotes SNOMED CT. This component is what makes the code unambiguous, and omitting it is a common, damaging error.
  • CWE.4–6 optionally repeat the same idea in an alternate system, so a value can be sent in two terminologies at once.

The example above is the LOINC code Glucose [Mass/volume] in Serum or Plasma 2 in Serum or Plasma], correctly tagged with its system in CWE.3. “Coded with exceptions” means the type also tolerates a value that has no code yet — text can be sent without an identifier — which is realistic but is exactly the looseness a value set is meant to remove.

A value set is the list of allowed codes

A value set is a named, managed list of codes — potentially drawn from one or more code systems — that are valid for a particular purpose. Rather than “any SNOMED concept,” a value set might be “the specific SNOMED concepts that count as a reportable condition,” or “the LOINC codes for a hemoglobin A1c result.” Value sets are themselves versioned artifacts with stable identifiers; in U.S. programs they are published and governed centrally by the Value Set Authority Center (VSAC), which hosts the official value sets for quality measures and C-CDA and draws their member codes from SNOMED CT, LOINC, RxNorm, and others 3.

Binding ties a value set to a field

Binding is the act of declaring that a particular field must (or should) draw its code from a particular value set. A binding turns an open CWE field into a constrained one: “this result-status field is bound to this status value set.” This is the terminology counterpart to the message-profiling idea from the v2 course — profiling constrains structure; binding constrains vocabulary. Together they convert a permissive standard into a testable contract: a validator can now check not only that a field is present, but that its code is a legal member of the bound value set.

Bindings also have strength. A binding may be effectively required (the code must come from the value set), or looser (the value set is preferred or merely an example, with other codes permitted). Knowing the binding strength tells an implementer whether an out-of-set code is a hard error or an allowed exception — a distinction that becomes central in the FHIR courses, where binding strength is formalized.

Why this matters

A coded field is only as interoperable as its weakest link. Send a code with no system (CWE.3 empty) and the receiver cannot know which terminology you meant. Send a code outside the value set the receiver expects and it may reject or silently drop the value. The discipline this module teaches — always send code, system, and display; bind fields to managed value sets; respect binding strength — is what makes the difference between a message that merely parses and one that actually conveys shared meaning.

References

  1. HL7 Standards — Section 1d: Version 2 (V2). HL7 International. verified
  2. LOINC (Logical Observation Identifiers Names and Codes). Regenstrief Institute. verified Cited at: 2345-7 — Glucose [Mass/volume.
  3. Value Set Authority Center (VSAC). U.S. National Library of Medicine. verified Cited at: Value Set Authority Center, vsac.nlm.nih.gov.