Stream: implementers
Topic: Questionnaire and FHIR document
Michael W Rutherford (Jun 28 2019 at 01:29):
Hi everyone.
I have two documents. Doc1 is simply informational with lists, and doc2 has many questions to answer.
Let me know if I have this workflow is correct.
Step 1) To populate the form, a Questionnaire is created and rendered (simple for doc1, adaptive for doc2).
Step 2) The Questionnaire is rendered, completed, and a QuestionnaireResponse is generated.
Step 3) Data is extracted from the QuestionnaireResponse to fill various resources (including composition?).
Step 4) The resources are wrapped in a bundle of type 'document' along with the Composition resource to create a FHIR document.
Step 5) The static bundle is stored and can be rendered as a formatted and human readable document.
I feel I'm on the right track, but there's a few gaps I can't seem to fill.
1) At step 3, I assume I'll have a Composition profile created for each form? Should step 3 also generate the Narratives for rendering?
2) At step 3, for the adaptive form, how do you recommend formatting the Composition to account for adaptiveness?
3) At step 4, should I include the QuestionnaireResponse in the bundle?
4) At step 5, I don't think simply rendering the Narratives is going to be very well formatted, will it? I've seen a vague mention of using Thymeleaf templates for rendering. Any recommendations for rendering?
And last question, unrelated to above.
5) If Doc1 stores an identifier from a previous form (not stored or fhir bound) as reference. Would you recommend I insert it into a Composition.Identifier resource or a Basic.Identifier.
I'm learning, so forgive me if I'm way off base.
Thank you in advance for any help you provide.
Lloyd McKenzie (Jun 28 2019 at 02:58):
1. Ideally, Step 3 can (and should) include the creation of the Bundle as well. It could do narratives, but that's complex to do using either FHIRPath or CQL. You might want to look at doing that using a separate post-processing step.
2. It's not totally clear why doc2 needs to be adaptive just because it has many questions. However, whether adaptive or not, if some of the questions or groups are conditional or optional, the 'extract' process will have to take that into account
3. Typically, the thing a document is derived from is maintained separately from the document (though the Composition for the document can - and probably should - reference the QuestionnaireResponse
4. How nicely things are formatted depends on what you tell the code generation process to do. You can make pretty narrative using pretty much anything - though authoring it will certainly be easier in some tools than others. (Not familiar with Thymeleaf, so can't say one way or the other)
5. Not really understanding the question. doc1 is being populated from a QuestionnaireResponse, no? What does the identifier represent?
Michael W Rutherford (Jun 28 2019 at 15:04):
Thank you @Lloyd McKenzie
1) That's how I suspected it needed to work. Thank you.
2) "conditional or optional" made it click, thanks. My apologies, my description of the docs were way too general. doc2 is a consent form which will have some skip logic built in to it.
3) Perfect. I just wasn't sure if there was a use for it in the bundle. Would I use Composition.relatesTo or a custom extension like Composition.derivedFrom?
4) So a template is the right direction? Is there an example of this somewhere? I've scoured the web to find something to give me an idea, but all I find are piecing together and rendering narratives.
5) Let say what I'm referencing is an id assigned to a request which we'll call doc0. It's the request that the determination, doc1, is being sent to inform decision for request. Problem is, we aren't porting doc0 to FHIR, but we are doc1. I'm trying to figure out what Resource to store the unique id for doc0 in.
Lloyd McKenzie (Jun 28 2019 at 15:25):
3. The right semantics would be derivedFrom
4. We've done a bit of work using Liquid to template narrative. However, in general HL7 has only done bare minimal work around the creation of 'nice' narratives. You may find yourself leading rather than following here. However, you might raise an item here specifically around narrative tools and catch people's attention who might have ignored this thread
5. If you're pointing to doc0 and not representing it at all, you could just stick the identifier in Reference.identifier within doc1. If you're exposing it as something other than FHIR (e.g. PDF), then you could expose it as a Binary if you just want the raw data or DocumentReference is you want some metadata too
Michael W Rutherford (Jun 28 2019 at 18:12):
Thank you so much Lloyd. You have been so helpful! I'll post back on the rendering when I cross that bridge.
Last updated: Apr 12 2022 at 19:14 UTC