FHIR Chat · Modularizing questionnaires · questionnaire

Stream: questionnaire

Topic: Modularizing questionnaires


view this post on Zulip Ilya Beda (May 21 2020 at 14:00):

Hi, all!

Let's move all discussions related to modularizing questionnaires
( FHIR-22356 FHIR-27049 FHIR-27132 ) to this thread.

It is not clear for me how inclusion should work accordingly https://jira.hl7.org/browse/FHIR-22356?focusedCommentId=173742&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-173742 :
For example

{
   "resourceType":"Questionnaire",
   "id":"parent",
   "item":[
      {
         "linkId":"1",
         "type":"text",
         "text":"What is your name?"
      },
      {
         "linkId":"2",
         "extension":[
            {
               "url":"http://hl7.org/fhir/StructureDefinition/sub-questionnaire",
               "valueCanonical":"Questionnaire/children"
            }
         ],
         "type":"display",
         "text":"This is placeholder for questionanire"
      }
   ]
}
{
   "resourceType":"Questionnaire",
   "id":"children",
   "item":[
      {
         "linkId":"2.1",
         "type":"text",
         "text":"How are you?"
      },
      {
         "linkId":"2.2",
         "type":"text",
         "text":"How old are you?"
      }
   ]
}

How the result of $assembe operation should look like:

Sub questionnaire should replace replace display and falt quetion into parent item

{
   "resourceType":"Questionnaire",
   "id":"assembled",
   "item":[
      {
         "linkId":"1",
         "type":"text",
         "text":"What is your name?"
      },
      {
         "linkId":"2.1",
         "type":"text",
         "text":"How are you?"
      },
      {
         "linkId":"2.2",
         "type":"text",
         "text":"How old are you?"
      }
   ]
}

Or Sub questionnaire should add items into display item

{
   "resourceType":"Questionnaire",
   "id":"parent",
   "item":[
      {
         "linkId":"1",
         "type":"text",
         "text":"What is your name?"
      },
      {
         "linkId":"2",
         "item":[
            {
               "linkId":"2.1",
               "type":"text",
               "text":"How are you?"
            },
            {
               "linkId":"2.2",
               "type":"text",
               "text":"How old are you?"
            }
         ],
         "type":"display",
         "text":"This is placeholder for questionanire"
      }
   ]
}

view this post on Zulip Yunwei Wang (May 21 2020 at 14:44):

I am not sure if the child Qusetionnarre could have more than one root items, like in the previous example. I think the first result is correct. "The expansion process will cause the display item to be replaced by the contents of the referenced questionnaire."

view this post on Zulip Yunwei Wang (May 21 2020 at 14:45):

But I am not sure if there could be more than one root items in the child questionnaire. I think yes.

view this post on Zulip Lloyd McKenzie (May 21 2020 at 16:19):

The child questionnaire can have multiple root items. The 'display' item would be replace all root items of the child questionnaire

view this post on Zulip Ilya Beda (May 21 2020 at 17:17):

So, I don't get how questionnaire-constraint, variable and itemContext will be propagated to the item that contains the 'display'.
https://jira.hl7.org/browse/FHIR-22356?focusedCommentId=174768&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-174768
Since the display item will be replaced by a set of items from included questionnaire.

view this post on Zulip Paul Lynch (May 21 2020 at 17:22):

It propagates to the item containing the display item. The display item is replaced, but the thing containing it is still there.

view this post on Zulip Ilya Beda (May 21 2020 at 17:25):

Thank you @Paul Lynch I finally get it.

view this post on Zulip Ilya Beda (May 21 2020 at 17:32):

Unfortunately, I will not join the workgroup meeting tonight.
In the previous meeting we discussed Prefix-based Modularized Questionnaires. It is great!

However, the issue I created initially was about two types of questionnaires.
https://jira.hl7.org/browse/FHIR-27132?focusedCommentId=174882&page=com.atlassian.jira.plugin.system.issuetabpanels%3Acomment-tabpanel#comment-174882

Should there will be two types of questionnaire inclusion?
subQuestionnaire that propagate attributes/extensions and reuseQuestionnaire that don't

What do you think?

view this post on Zulip Lloyd McKenzie (May 21 2020 at 17:34):

I don't see a benefit to two approaches. If the re-use questionnaire has attributes/extensions that need propagating, then they'll have to propagate. Having a different referencing mechanism doesn't really simplify things

view this post on Zulip Ilya Beda (May 21 2020 at 18:07):

Since inclusion for one questionnaire more the once allowed, it makes sense to provide different itemContext for populate operation.
Also, @Yunwei Wang provided a case https://jira.hl7.org/browse/FHIR-27049 when defining a variable that may be useful.

If attribute propagation is a default behavior there is no way to implement these two cases.

view this post on Zulip Lloyd McKenzie (May 21 2020 at 18:09):

You wouldn't include the same questionnaire more than once beneath the same item

view this post on Zulip Lloyd McKenzie (May 21 2020 at 18:10):

For example, if you have a questionnaire that asks questions about address (city, postal code, etc.), you might import that in multiple places, but you'd never import it multiple times in the same place

view this post on Zulip Ilya Beda (May 21 2020 at 18:24):

The address questionnaire is a good case.
For example, I create a form for patient resource.
I need to include the address questionnaire twice for patient's address and for patient contats' adresses.
For patient's address I need itemContext = %LaunchPatient.address
For patient contacts' address, I need set itemContext=%LaunchPatient.contact on contact group level
then set itemContext= address before the inclussion of a questionanire.

If I don't provide itemContext for address questionnaire I will get a questionnaire that can be used only for inclusion.
if I provide itemContext for address questionnaire it will clash with itemContext from parent questionnaire and cause an error.

Here is a full example
https://github.com/beda-software/aidbox-sdc/blob/master/tests/sdc/test_assemble.py#L122

view this post on Zulip Lloyd McKenzie (May 21 2020 at 19:10):

Right. So in that case, you wouldn't declare the itemContext in your child questionnaire - you'd define it on the parent element of the display that references the child questionnaire. That's a design choice, but not one that drives a different referencing mechanism

view this post on Zulip Lloyd McKenzie (May 21 2020 at 19:11):

What we might want to do is frag a Questionnaire as being a 'fragment' - i.e. you shouldn't try to validate everything in the Questionnaire. Alternatively, we could put extensions in the child questionnaire that explicitly indicate what contexts need to be available in the location where it's einvoked

view this post on Zulip Ilya Beda (May 21 2020 at 19:42):

What we might want to do is frag a Questionnaire as being a 'fragment' - i.e. you shouldn't try to validate everything in the Questionnaire. Alternatively, we could put extensions in the child questionnaire that explicitly indicate what contexts need to be available in the location where it's einvoked

Sounds good

view this post on Zulip Lloyd McKenzie (May 21 2020 at 20:31):

Would you like to submit a change request to that effect?

view this post on Zulip Ilya Beda (May 22 2020 at 03:07):

Sure, may I update the document https://confluence.hl7.org/display/FHIRI/Prefix-based+Modularized+Questionnaires and gather all details there?
Or should I submit a ticket first?

view this post on Zulip Ilya Beda (May 26 2020 at 06:57):

@Lloyd McKenzie Could you please advise?

view this post on Zulip Lloyd McKenzie (May 26 2020 at 15:25):

Sorry. Feel free to update the Confluence page

view this post on Zulip Ilya Beda (Jun 04 2020 at 06:48):

Hi!

I updated the document https://confluence.hl7.org/display/FHIRI/Prefix-based+Modularized+Questionnaires
Review and feedback are appreciated
As a next step, I am going to replace the example section with actual FHIR resources.

I also implemented described spec https://github.com/beda-software/aidbox-sdc/blob/master/app/operations/assemble.py

view this post on Zulip Ilya Beda (May 19 2021 at 07:26):

It seems that https://confluence.hl7.org/display/FHIRI/Prefix-based+Modularized+Questionnaires is not a part of SDC. Are we going to include it in the release?

view this post on Zulip Paul Lynch (May 19 2021 at 10:37):

It looks like the changes FHIR-22356 are approved but not yet applied. I think the plan is to get all approved changes for SDC into the IG before publication.

view this post on Zulip Eric Haas (Jun 28 2021 at 22:10):

this will be a SDC for FHIR R4 feature right. and what is this timeline?

view this post on Zulip Lloyd McKenzie (Jun 28 2021 at 22:11):

That sounded like you were asking the foolish question of "when will SDC be published?" :) Soon, I hope...

view this post on Zulip Eric Haas (Jun 28 2021 at 22:12):

will modularizing be in there for fhir R4?

view this post on Zulip Lloyd McKenzie (Jun 28 2021 at 22:12):

y

view this post on Zulip Richard Stanley (Sep 23 2021 at 16:18):

I have a use case for modular questionnaires. Is the above solution implemented in some tooling folks can share? thanks!

view this post on Zulip Ilya Beda (Sep 26 2021 at 06:34):

Hi @Richard Stanley
Thank you for asking.

Here is an implementation of assemble operation https://github.com/beda-software/aidbox-sdc/blob/master/app/operations/assemble.py

It is a part of aidbox-sdc.


Last updated: Apr 12 2022 at 19:14 UTC