Question: What does an empty name mean?
Sep 4, 2013I was recently asked whether this fragment is legal CDA: ````
The answer is that it's legal, but I have no idea what it should be understood to mean.
**It's legal**
Firstly, it's legal. There's a rule in the abstract data types specification:
invariant(ST x) where x.nonNull { x.headCharacter.notEmpty; }
In other words: if a string is not null, it must have at least one character content in it. In a CDA context, then, this would be illegal:
Aside: the schema doesn't disallow this, and few schematrons check this. But it's still illegal. It's a common error to enounter where a CDA document is generated using some object model or an xslt - it's not so common where the CDA document is generated by some xml scripting language a la PHP.
However the definition of PN (the type of <name/>) is not a simple string: it's a list of part names, each of which is a string. PN = LIST<ENXP>. So while this is illegal:
- because the given name can't be empty. This isn't:
That's because a list is allowed to be empty.
**Aside: I don't know whether this is legal:**
**
** That's because we run into XML whitespace processing issues. Nasty, murky XML. Next time, we'll use JSON. **
**What does it mean?**
So what does this mean?
Well, it's a name with no parts that is not null. Literally: this patient has a name, and the name has no parts.
Note the proper use of nullFlavors:
* The patient's name is unknown: <name nullFlavor="UNK"/>
* We didn't bother collecting the patient name: <name nullFlavor="NI"/>
* We're telling you that we're not telling you the patient name: <name nullFlavor="MSK"/>(unusual - usually you'd just go for NI when suppressing the name)
* The patient's name can't be meaningful in this context: <name nullFlavor="NA"/> - though I find operational uses of NA very difficult to understand
* The patient doesn't have a name: <name nullFlavor="ASKU"/> - because if you know that there's no name, you've asked, and it's unknown. Note that it would be a very unusual circumstance where a patient doesn't have a working name (newborns or unidentified unconscious patients get assigned names), but it might make much more sense for other things like drugs
So this is none of these. It's a positive statement that the patient has a name, and the name is... well, empty? I can't think of how you could have an empty name (as opposed to having no name). I think that we should probably have a rule that names can't have no parts either.
It's not clear that this is a statement that the name is empty though. Consider this fragment:
If you saw this in a CDA document, would you think that you should understand that I have no middle name (I do, though I have friends that don't). We could be explicit about that:
````
Though I think that ASKU is getting to be wrong here - you could say that the middle name is unknown, but it would be better to say that the middle name count is 0 - it’s just that we didn’t design the name structure that way because of how names work in other cultures than the English derived one. (which, btw, means that some of this post may be inapplicable outside the english context).
The first case would be normal, so this means, we don’t say anything about middle names. So why would not including any given name or family name mean anything more than “we don’t say anything about the name”? And, in fact, that’s the most likely cause of the form - nothing is known, but the developer put the
So it’s quite unclear what it should mean, it most likely arises as a logic error, and I recommend that implementations ensure that an empty name never appears on the wire.