Question: CD data type and value sets
Feb 8, 2013Question:
How are value sets bindings get validated in HL7 message? I notice that ISO21090 CD data type does not have attributes to support value sets binding
The differentiation between code systems and value sets is confusing to many people. The official HL7 definition is
code system | a managed collection of concept identifiers, usually codes, but sometimes more complex sets of rules and references, optionally including additional representations (which may or may not be identifiers of the concepts) |
value set | a uniquely identifiable set of valid concept identifiers, where any concept identifier in a coded element can be tested to determine whether it is a member of the Value Set. |
It’s no wonder people are confused - this demonstrates a problem with getting standards communities to do definitions: the definition will be successively honed for correctness again and again, at the price of increasing lack of clarity.
The easiest way to understand the difference is that both code systems and value sets define lists of codes. The difference is that code systems define the codes themselves, while value sets refer to codes defined elsewhere.
CD data type
The CD data type includes two attributes for these two concepts:
codeSystem | what defines the syntax and meaning of the code value. This value matters - you look at it if you want to know what the code means |
valueSet | a reference to a set of rules over what codes are allowed to be chosen here. This value doesn’t really matter - it doesn’t change what the code means |
Actually it turns out that the claim that the value set doesn’t change what the code means is rather less true in practice than in theory. Take this (crude) example, based on Snomed-CT, where you have two different value sets:
Value Set A
- 163497009: Obstetric examination
- 271992004: Obstetric investigation
- 108108009: Obstetrics manipulation
Value Set B
- 163497009: Obstetric examination
- 271992004: Obstetric investigation
- 108106008: Obstetrics destructive procedure
Although the meaning of the 271992004 is theoretically the same in both lists, in practice what the user means when they pick 271992004 differs between the two lists. The valueSet attribute is defined on CD to allow really really sophisticated users to indulge in a fantasy that they can reverse the damage that bad value sets cause (because those value sets above are certainly bad ones). I always strongly recommend people not to use valueSet.
Case in Question
OrganizationA has gender value sets with values (M - male,F - female,U - unknown). ApplicationA within organizationA will have constrained gender value sets with only values (M,F). Therefore, in this scenario, how will terminology server be able to validate if applicationA is sending value like U, which is supposed to be invalid for applicationA?
So the first - (M - male,F - female,U - unknown) - is actually a code system. Since it’s a local code system, the site allocates it’s own oid, which we will call 1.2.[x].1. When application A represents a code for female, it looks like this:
This doesn’t capture that fact that application A can only use M or F. If you really want to do that - in spite of my comments above - then you’d have to assign an OID to the value set. We’ll use 1.2.[y].2, which would mean the code value would look like this:
A terminology server could leverage the value set to determine whether application A is conforming to it’s own rules. More useful is for a terminology server to know that something inbound for application A is valid, but for that it can’t rely on the instance - it has to be configured elsewhere.
p.s. note that valueSet was only added in data types R2 / ISO 21090, though I’ve seen a few sites pre-adopt it in CDA R2.