Question: Should value sets include nullFlavor Values?
Mar 20, 2014Note - mostly, the questions I post on my blog are implementer focused questions. This is different - it’s from a discussion between myself and a HL7 vocab work group co-chair. It’s about a particularly unclear and relatively distant corner case in the CDA specification space, but I thought I’d post it here to get the answer into google. If you don’t even understand the question, don’t worry… Question:
For a CDA value set, my understanding is that one should only include the domain specific values, and that the null flavors would not appear in the value set. Is this true?
Answer:
This is a little understood corner of our specifications. As a data types guy, I’d say (and have said previously):
We expect people to use the value set machinery to constrain the nullFlavors that can be used for any particular element
This is because nullFlavors are part the value set of the element - so if you were specifying a value set for an element, you’d therefore specify a value set that included the nullFlavors that were allowed. But I see that except for CD etc, that would have to be an adjunct to the value domain, expressed as a value set.You might say, for example, this element can have the values of 0.0-5.0 mg/dL, or NI or UNK, but nothing else. Clearly, you’ll have to the two parts of that differently, and the intention was that you’d use a value set for the nullFlavor part.
Only, to my knowledge, no one has ever done this - and my own v3 / cda tools have not done this; you can specify nullFlavors in a value set, but my tools - along with everyone else’s, as far as I know, would then expect that they’d appear like this:
<code code="NI" codeSystem="2.16.840.1.113883.5.1008"/>
instead of
<code nullFlavor="NI"/>
(2.16.840.1.113883.5.1008 is the OID for the NullFlavor code system). Concerning these 2 representations, release 2 of the v3 data types says:
The general implication of this is that in a CD or descendant (usually CS), when the code for a nullFlavor is carried in the code/codeSystem (code = “NI” and codeSystem = “2.16.840.1.113883.5.1008”), the CD itself is not null. The CD is only null when its nullFlavor carries this code
That text was written to underline the special meaning of the nullFlavor attribute, but it does serve to say that the first variant above is different to the second, and therefore, it has no defined meaning, and shouldn’t be used.
So my tools would handle the appearance of nullFlavors in the value set wrongly, and I think everyone’s would too, and I’m sure that we never say anything about this in our methodology documentation (e.g. core principles). In fact, looking through the v3 standards, I found:
In many cases, a CD is created from a value set - either a code/code system pair is chosen from a valueSet, or one is not chosen and the CD has the exceptional value of NullFlavor.OTH
Well, I have no idea what that would mean if you put OTH in the value set!
Well, where does this leave us?
- In practice, including nullFlavors in a value set won’t achieve anything useful
- We haven’t really said quite what should happen if you do
- So there’s no real solution for controlling nullFlavors properly
Note that in v2, and FHIR, nullFlavors are not included in the base data type - instead they are included in the value set explicitly, and represented like any other code
Update: There’s another factor to consider: the existing value sets are designed on the basis that nullFlavors are still allowed, and so that they don’t go in the value set. So deciding now that valuesets define which nullFlavors are allowed invalidates all the existing value sets. So really, to use value sets, we need to define a new binding path. Else you use constraints, as Sarah demonstrates in her comments below.