Can a <name> tag have a @nullValue and still have text inside?

60 Views Asked by At

The current implementation of a CCDA generator I'm working on, prints a message on a <name> tag (in header sections, where no <text> is available) when something's name is not found:

<name>No information</name>

I know the right way to express not found information is through the @nullFlavor attribute:

<name nullFlavor="NI" />

But right now there is a component on the application that reads the value on the tag and shows it in a human-readable view of the CCDA document. If I use @nullflavor only, the field that shows such name will be empty, instead of "No information".

In order to avoid changing such component, I was thinking on adding the @nullFlavor attribute but still letting the message there:

<name nullFlavor="NI">No information</name>

I know this is syntactically correct, because I've tested it with the reference validator and it passes. My question is: from a semantic point of view, is it valid?

2

There are 2 best solutions below

2
Grahame Grieve On BEST ANSWER

Yes it's valid. The particular specification in question - the v3 abstract data types, simple says:

invariant(ST x) where x.nonNull {
   x.headCharacter.notEmpty;
};

So if there's no nullFlavor, there must be some content. But the reverse rule is not applied; there can be content if there's a nullFlavor

0
Marti Pàmies Solà On

Although it is not restricted, my point of view is that it is not a good strategy. I understand that you have a restriction regarding this component but, when you are building a CDA, it is important to keep in mind that it is something to be shared with everyone, and I would never expect to find content inside a nullFlavor attributed element.