Stream: implementers
Topic: Composition sections and resources
Matthew Koch (Dec 31 2019 at 14:05):
Is there a way to properly model a document (using the Composition resource) with a section that has text, a questionnaire resource, and then more text? This would be analogous to a document with a section that has some narrative text, a questionnaire, and then some more text. Is this possible? This is as close as I've been able to get, but this only allows text at the "top":
{ "resourceType": "Bundle", "type": "document", "entry": [ { "resource": { "resourceType": "Composition", "text": { "status": "generated", "div": "<div xmlns='http://www.w3.org/1999/xhtml'><a name='mm'/></div>" }, "id": "cf-1577800395586", "section": [ { "title": "Section 1", "text": { "status": "additional", "div": "<div xmlns='http://www.w3.org/1999/xhtml'><h2 class=\"md\" id=\"teststuffhere\">Test Stuff here</h2>\n<p>Paragraph HTML.</p></div>" }, "entry": [ { "reference": "Questionnaire/cf-1577800630025" } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "18776-5", "display": "Plan of care note" } ] } } ] } }, { "resource": { "resourceType": "Questionnaire", "text": { "status": "generated", "div": "<div xmlns='http://www.w3.org/1999/xhtml'>Family Related Questions<a name='mm'/></div>" }, "id": "cf-1577800630025" } } ], "id": "cf-1577800382507" }
Jose Costa Teixeira (Dec 31 2019 at 14:23):
a section that has text, a questionnaire resource, and then more text? This would be analogous to a document with a section that has some narrative text, a questionnaire, and then some more text.
is "text" fixed text? Is it plain text, markdown...?
Jose Costa Teixeira (Dec 31 2019 at 14:26):
if it's fixed text (like a standard form header), perhaps Binary would be an option.
Matthew Koch (Dec 31 2019 at 15:00):
In our case it is HTML, authored by a staff member. When you say Binary, does that mean we'd just add additional Binary resources?
Jose Costa Teixeira (Dec 31 2019 at 15:15):
Yes, resources of type Binary
Matthew Koch (Dec 31 2019 at 15:16):
Neat. I can look into that, although the Binary type indicates you have to Base64 encode the content...
Jose Costa Teixeira (Dec 31 2019 at 15:17):
yeah... I am not sure if there is a resource like Annotation or something.. That could also be useful, but I didn't find it so I presume we don't have it.
Matthew Koch (Dec 31 2019 at 15:17):
It might not be so bad to have to encode the content, the client would just need to have to unpack it/decode it once received.
Jose Costa Teixeira (Dec 31 2019 at 15:22):
Should be easy to decode in any language. Perhaps I should have challenged a bit the requirement just to make sure the scope is clear to me: do you really need the text to be sent as an additional resource? I presume you considered that, but doesn't hurt to check the source for your requirements.
Matthew Koch (Dec 31 2019 at 15:26):
I don't think we need the text as an additional resource, it's more about the fact that when looking at our existing document structures, there are plenty with clearly defined "sections" that have text interspersed with other content like images and questionnaires. To me, it makes sense to fully qualify the questionnaires and possibly the images, but I don't see a clean way to then allow for more text "in between." - does this make sense?
Matthew Koch (Dec 31 2019 at 15:55):
Here's an updated JSON snippet, including a questionnaire and a binary resource for more textual content, base64 encoded. This seems like it might work:
{ "resourceType": "Bundle", "id": "cf-1577800382507", "type": "document", "entry": [ { "resource": { "resourceType": "Composition", "text": { "status": "generated", "div": "<div xmlns='http://www.w3.org/1999/xhtml'><a name='mm'/></div>" }, "id": "cf-1577800395586", "section": [ { "title": "Section 1", "text": { "status": "additional", "div": "<div xmlns='http://www.w3.org/1999/xhtml'><h2 class=\"md\" id=\"teststuffhere\">Test Stuff here</h2>\n<p>Paragraph HTML.</p></div>" }, "entry": [ { "reference": "Questionnaire/cf-1577800630025" }, { "reference": "Binary/cf-1577804877200" } ], "code": { "coding": [ { "system": "http://loinc.org", "code": "18776-5", "display": "Plan of care note" } ] } } ] } }, { "resource": { "resourceType": "Binary", "text": { "status": "generated", "div": "<div xmlns='http://www.w3.org/1999/xhtml'>More text goes here<a name='mm'/></div>" }, "contentType": "text/html", "data": "KJBNSFKJ8398y238djnjdfi9", "id": "cf-1577804877200" } }, { "resource": { "resourceType": "Questionnaire", "text": { "status": "generated", "div": "<div xmlns='http://www.w3.org/1999/xhtml'>Family Related Questions<a name='mm'/></div>" }, "id": "cf-1577800630025", "title": "Family Information", "version": "1" } } ] }
John Moehrke (Dec 31 2019 at 19:22):
note that although the binary content within the Binary resource must be base64 encoded... when one does a GET on the Binary, the http negotiate is used such that if the http negotiate allows the native mime-type then the native mime-type will be returned in the http response. Thus Binary requirement to base64 encode is only a burden when forcing FHIR mime-types.
Grahame Grieve (Dec 31 2019 at 19:23):
or when accessing it as a bundle. but you have to escape or base64 it either way... I think it's not that much different
Matthew Koch (Jan 01 2020 at 16:12):
Thanks all. @Grahame Grieve does this seem like it would work, given the snippet here?
Grahame Grieve (Jan 01 2020 at 19:21):
yes
Lloyd McKenzie (Jan 03 2020 at 17:32):
Rendering of a document will render the narrative for the section. If you want to have a rendering of certain text, then the questionnaire response, then additional text, you'll have to go with sub-sections.
Last updated: Apr 12 2022 at 19:14 UTC