The Path
Module 5 · The integrator’s job·12 min
Conformance profiles
R, RE, C, X and cardinality: stating exactly what an interface accepts.
“We are HL7 v2.5.1 compliant.” That sentence guarantees almost nothing. The standard itself admits it: compliance with HL7 v2 has long been impossible to measure. Its answer is the message profile, and that is what turns a permissive standard into a testable contract.
Here is a result from the Leleux Clinic sleep lab. Look at the validation panel: the standard finds nothing wrong. Yet it breaks four rules of the clinic’s profile.
No issues found.
The sleep lab sends Marie Dubois’s AHI and lowest SpO2. MSH-21 announces the LELEUX_ORU_PSG profile.
Keep this message handy. We come back to it once the profile is written.
What a profile is, according to the standard
Chapter 2 of v2.5.1 (section 2.12) defines a profile as a precise and unambiguous specification of one or more messages, analysed for a use case. It has three parts:
- a use case: who exchanges what, and why;
- a dynamic definition: the sequence of messages and the expected acknowledgments (always, never, only on success, only on error);
- a static definition per message structure: segments, fields, components, each with its usage, cardinality, length and allowed values.
The golden rule: a profile constrains the standard, it never contradicts it. Every message that conforms to the profile also conforms to the standard. The reverse is not true, and that is the point.
Three levels of profile
| Level | Who writes it | What it leaves open |
|---|---|---|
| Standard | HL7 | A lot: it is the starting point |
| Constrainable profile | A country, IHE, a vendor | Some options (O) still to settle |
| Implementation profile | The project, for a real interface | Nothing: every element is decided |
A constrainable profile can give rise to another, stricter one. A vendor publishes a product profile, the clinic tightens it for its site. The HL7 v2 conformance methodology (2019) puts it bluntly: every interface in production is an implementation profile. Either it is written down, or it is implicit and discovered at the first incident.
Usage: what the sender must do
You have already met R, RE, C, CE, X and O in the lesson on interface specifications. We will not define them again. What matters here are the transition rules between the standard and a profile, set out in chapter 2:
| Optionality in the standard | Usages allowed in a profile |
|---|---|
| R | R only |
| O | R, RE, O, C, CE, X (O only in a constrainable profile) |
| C | C, CE, R |
| X | X |
| B, W | R, RE, O, C, CE, X |
Two consequences. You never relax: an R field in the standard does not become RE. And an implementation profile holds no O at all: in a profile, O means “not decided yet”, not “your choice”.
A C or CE must always come with a testable predicate, based on other values in the message. For example: “OBX-6 is required if OBX-2 is NM”. A vague sentence (“when needed”) cannot be tested, so it is not a predicate.
Mind the “false” branch. In 2.5.1, when the predicate of a C or a CE is false, the sender must not send the element. “OBX-6 is required if OBX-2 is NM” therefore also means “OBX-6 is absent otherwise”. An OBX of type ST that carries a unit is not conformant.
Cardinality, length, values
Usage says whether an element is present. Three more constraints say how:
- cardinality
[min..max]sets the number of repetitions. It follows usage: an R element has a minimum of at least 1, a non-R element a minimum of 0. One special case: an RE[3..5]means “nothing, or three to five repetitions”. - the maximum length can be reduced.
OBX-5allows 99999 characters in the standard, your profile can say 20 for a numeric value. - the value set narrows a table. Table 0085 lists a dozen result statuses, your profile can keep just two.
A subtle trap: for a profile, an element is only present if it has content. A bare NTE| line is valid for the standard, but it does not satisfy an NTE segment marked R.
The Leleux profile for the sleep result
Here is an excerpt of the static definition, sender role, for ORU^R01^ORU_R01 sent by SLEEPLAB:
| Element | Standard 2.5.1 | Leleux profile | Cardinality | Constraint |
|---|---|---|---|---|
PID |
inside an optional group | R | [1..1] |
|
PID-3 |
R | R | [1..1] |
Only the LELEUX identifier of type MR |
PID-7 |
O | R | [1..1] |
Date of birth, at least YYYYMMDD |
PID-8 |
O | RE | [0..1] |
Table 0001 |
OBSERVATION (group) |
optional, repeating | R | [1..5] |
A profile constrains the group, not the lone segment |
OBX |
required in the group | R | [1..1] |
|
OBX-2 |
C | R | [1..1] |
NM or ST |
OBX-3 |
R | R | [1..1] |
Local codes AHI, SPO2MIN, ODI |
OBX-6 |
O | C | [0..1] |
Required if OBX-2 = NM, absent otherwise |
OBX-11 |
R | R | [1..1] |
F or C only |
Go back to the message at the top, table in hand, and find the four gaps. The message is editable: fix them right there. The validation panel will not help you here. It only knows the standard, not the Leleux profile, so it stays silent before and after your fix. That is exactly the limit of a generic validator.
Show the answer
PID-7is empty while the profile requires it. Add19850312.- The first
OBXis numeric with no unit inOBX-6. Add/h. - The second
OBXhas statusP, legal in table 0085 but outside the value set. Replace it withF. - The third
OBXcarries thePLMcode, which the profile does not know. Delete the line.
To check your version against the profile, you need a tool that loads the profile itself, like the NIST tools below.
Writing and testing a profile
The standard describes an XML format for the static definition (section 2.19 of chapter 2) and leaves tools out of scope. In practice, NIST (the US standards institute) publishes free online tools, some behind a simple sign-up, built around these profiles:
| NIST tool | Role |
|---|---|
| IGAMT (Implementation Guide Authoring and Management Tool) | Write the profile in a graphical interface and export it as Word, HTML or XML |
| TCAMT (Test Case Authoring and Management Tool) | Build test plans and example messages from the profile |
| GVT (General Validation Tool) | Validate a message against a profile, in a public or private space |
The cycle is simple: write the profile, derive test cases from it, then validate every vendor message against it. The gaps become precise lines in the acceptance report, not impressions.
And in FHIR?
Same idea, different name. A FHIR profile is a StructureDefinition that constrains a resource: cardinalities (1..1), mustSupport elements and bindings to value sets (ValueSet). The exact meaning of mustSupport is set by each implementation guide, often close to RE. A server announces the profiles it follows in its CapabilityStatement.
Check your understanding
1 of 5The generic validator says the sleep lab message is fine. The Leleux Clinic profile rejects it. How can that be?
+50 XPPass the quiz (4 correct answers) to complete the lesson.
Reviewed and checked on 28 September 2026