Stream: implementers
Topic: div content for an 'empty' narrative
Andrew Patterson (Nov 30 2017 at 02:44):
In our very closed trading partner environment I am suggesting the clients do not generate any narrative. To this end - I am suggesting they use an 'empty' narrative type. I however, can't get any emtpy narratives to validate (HAPI 3) without actually putting in content - which seems to defeat the purpose. This could be a specific hapi validation issue, but I thought I'd ask first here - is there a established div content for the 'empty' narrative?
Andrew Patterson (Nov 30 2017 at 02:45):
<div></div> doesn't work
empty string doesn't work
Andrew Patterson (Nov 30 2017 at 02:46):
<div> </div> doesn't work (div content with one space)
<div xmlns="http://www.w3.org/1999/xhtml"></div> doesn't
<div/> doesn't
Andrew Patterson (Nov 30 2017 at 02:47):
A single space crashes the validator
Andrew Patterson (Nov 30 2017 at 03:01):
actually to follow up my own question - looks like the full HAPI profile validator works with what I would expect to be correct
<div xmlns="http://www.w3.org/1999/xhtml"></div>
It is just the basic schema (?) validator in HAPI that is failing with those
Issue 1: ERROR -
cvc-complex-type.2.4.b: The content of element 'text' is not complete.
One of '{"http://www.w3.org/1999/xhtml":div}' is expected.
Eric Haas (Nov 30 2017 at 04:52):
why not just skip the text element? In FHIR empty elements raise an error and <div> is a fhir element.
"Note that when present, elements cannot be empty - they SHALL have a value attribute, child elements, or extensions. This means that setting an element to a minimum cardinality of 1 does not ensure that valid data will be present; specific FHIRPath constraints are required to ensure that the required data will be present."
Andrew Patterson (Nov 30 2017 at 04:55):
I thought indicating it was empty was being very explicit that we deliberately weren't filling it in - as opposed to missing text (which is what I would do with a contained resource)
Andrew Patterson (Nov 30 2017 at 04:56):
If there is an enumeration of narrative type that includes 'empty' then we should be clear what the empty div content would then be.. or remove 'empty' as a narrative type (which I would also be happy with)
Richard Townley-O'Neill (Nov 30 2017 at 04:57):
I think that to make it explicitly empty you will have to add an extension to text
with a value that means "deliberately empty".
Andrew Patterson (Nov 30 2017 at 04:58):
But there is literally a core narrative type of 'empty'.. surely we then don't need an extension to text in order to use it
Richard Townley-O'Neill (Nov 30 2017 at 04:59):
oops. I forgot that.
Richard Townley-O'Neill (Nov 30 2017 at 05:01):
However
empty | Empty | The contents of the narrative are some equivalent of "No human-readable text provided in this case"
Richard Townley-O'Neill (Nov 30 2017 at 05:01):
from http://build.fhir.org/valueset-narrative-status.html
Andrew Patterson (Nov 30 2017 at 05:02):
So <div xmlns="http://www.w3.org/1999/xhtml">No human readable text provided</div>?
Richard Townley-O'Neill (Nov 30 2017 at 05:03):
Guess so.
Grahame Grieve (Nov 30 2017 at 12:43):
just omit the div element. Or put 'no text provided'... or provide some text (still your best option long term. I don't believe in very closed trading environments when year + 1 rolls around)
Andrew Patterson (Nov 30 2017 at 21:34):
but div is 1..1 cardinality
(I take your point about trading environments, and we will probably auto generate narratives on submission, but it would be good if 'empty' is an option - that it is clear what is meant to accompany it)
Grahame Grieve (Nov 30 2017 at 21:35):
ah yes. I meant, omit the text element
Andrew Patterson (Nov 30 2017 at 21:35):
ok thanks
Grahame Grieve (Nov 30 2017 at 21:35):
does make it an interesting question what it means to say that the narrative is empty when it can't be
Andrew Patterson (Nov 30 2017 at 21:37):
The HAPI full validator does allow <div xmlns="http://www.w3.org/1999/xhtml"></div>. Which I think it the correct value for an empty narrative - meeting all the other narrative rules and yet not forcing the use of a sentence which text saying something like "No text here" (which in my opinion is not really actually empty)
Andrew Patterson (Nov 30 2017 at 21:38):
It turns out it is only the schematron validator that disallows that empty div. So maybe it is just a particular validator issue.
Grahame Grieve (Nov 30 2017 at 21:41):
no it's what the spec says: no empty elements
Last updated: Apr 12 2022 at 19:14 UTC