FHIR Chat · IG Publisher always adds "url" to FHIR resources json · IG creation

Stream: IG creation

Topic: IG Publisher always adds "url" to FHIR resources json


view this post on Zulip Yolanda (Jan 24 2022 at 23:01):

I am creating a profile based on SDC adaptive questionnaire profile which prohibits/removes "url" on a Questionnaire. When I create the FSH file for an instance of the profile I create, FHIR shorthand handles it correctly without adding "url" when generating the Questionnaire json file. However, when I run IG publisher, the publisher automatically adds "url" and other data elements to the Json file of the Questionnaire. The qa.html complains with the following error: Questionnaire.url: max allowed = 0, but found 1. I am wondering if this is a known issue. Is there a workaround? Thanks in advance.

view this post on Zulip Lloyd McKenzie (Jan 25 2022 at 00:35):

This sounds like a publisher issue. You'll have to submit a Git issue against the publisher. (That said, SDC examples didn't seem to have a problem, so not sure why yours would...)

view this post on Zulip Chris Moesel (Jan 25 2022 at 14:01):

Yolanda asked me about this first and I suggested she post here. When she asked me, I created this simple project that reproduces the issue: QuestionnaireUrlBug.zip. If you run it through the IG Publisher, you can see that the Questionnaire-MyAdaptiveQuestionnaire.json generated by SUSHI in fsh-generated does not have url specified. The Questionnaire-MyAdaptiveQuestionnaire.json generated by the IG Publisher in output does have url specified (which then causes a QA error).

view this post on Zulip Yolanda (Jan 25 2022 at 14:29):

Thank you both Lloyd and Chris. Will open a JIRA ticket for this issue.

view this post on Zulip Lloyd McKenzie (Jan 25 2022 at 17:35):

The question is why it's added when generating using SUSHI, but not in the SDC IG itself.

view this post on Zulip Jose Costa Teixeira (Jan 25 2022 at 18:21):

Does the SDC have any example of an adaptive questionnaire? I don't find one

view this post on Zulip Jose Costa Teixeira (Jan 25 2022 at 18:21):

from what I see, the publisher is always adding a URL to the questionnaire

view this post on Zulip Yolanda (Jan 25 2022 at 18:38):

Here is the example QuestionnaireResponse which contains an adaptive questionnaire and the questionnaire doesn't have the "url" property: https://build.fhir.org/ig/HL7/sdc/QuestionnaireResponse-adaptive-questionnaireresponse-sdc-example-phq9.json.html

view this post on Zulip Yolanda (Jan 25 2022 at 18:39):

Created the issue: https://github.com/HL7/fhir-ig-publisher/issues/381

view this post on Zulip Jose Costa Teixeira (Jan 25 2022 at 19:06):

I'm lost

view this post on Zulip Jose Costa Teixeira (Jan 25 2022 at 19:06):

Questionnaire or QuestionnaireResponse?

view this post on Zulip Chris Moesel (Jan 25 2022 at 19:54):

@Jose Costa Teixeira -- I think she's referring to the contained Questionnaire in the QuestionnaireResponse.

view this post on Zulip Chris Moesel (Jan 25 2022 at 20:01):

@Lloyd McKenzie - It has nothing to do with SUSHI. Here is another example project that does not use SUSHI at all. The adaptive questionnaire in input/resources has no url property, but the IG Publisher adds one when it generates the same questionnaire to ouput. Example: QuestionnaireUrlBugNoSUSHI.zip

view this post on Zulip Lloyd McKenzie (Jan 25 2022 at 20:24):

I don't know what's going on. SDC seems to be publishing fine: https://build.fhir.org/ig/HL7/sdc/QuestionnaireResponse-adaptive-questionnaireresponse-sdc-example-phq9.xml.html

view this post on Zulip Chris Moesel (Jan 25 2022 at 22:18):

@Lloyd McKenzie -- that's a QuestionnaireResponse. It does have an AdaptiveQuestionnaire in its contained array, but I wouldn't be surprised if the IG Publisher doesn't process contained resources the same way it processes standalone resources. That's what I suspect is the difference here.

view this post on Zulip Lloyd McKenzie (Jan 25 2022 at 23:06):

The only place that the URL is prohibited is in the contained Questionnaire. You still need a URL in the stand-alone Questionnaire that says "Hi, I'm adaptive".

view this post on Zulip Lloyd McKenzie (Jan 25 2022 at 23:06):

The profile for searchable adaptive forms absolutely expects the URL to be there.

view this post on Zulip Chris Moesel (Jan 26 2022 at 13:31):

@Lloyd McKenzie - Maybe I don't understand how adaptive questionnaires work (sorry). I'm not that familiar with SDC; just trying to understand what is going on here.

The SDC IG has an Adaptive Questionnaire Profile. That profile prohibits url (using 0..0). Are you saying that this profile should only be used for contained Questionnaires? That it's actually incorrect to have a standalone instance of an Adaptive Questionnaire?

view this post on Zulip Lloyd McKenzie (Jan 26 2022 at 15:07):

Correct on both counts. The "Adaptive Questionnaire" is always contained (and is allowed to have items). The "Adaptive Questionnaire - Search" is the stand-alone one (and generally shouldn't have items).

view this post on Zulip Chris Moesel (Jan 26 2022 at 15:22):

@Lloyd McKenzie - OK, then I think that helps to clear things up. Thanks for patiently walking us through this! Is this documented somewhere in the guide? I know I reviewed the AdaptiveQuestionnaire profile page and I don't think it said anywhere that it is only to be used in contained. I expect maybe it is documented in a different part of the guide?

@Yolanda, what is your use case for creating a standalone instance of an AdaptiveQuestionnaire? If you just need to create it so you can put it into the contained of a QuestionnaireResponse, then use Usage: #inline in your SUSHI definition of the AdaptiveQuestionnaire instance. This will tell SUSHI not to create a standalone instance of it.

view this post on Zulip Yolanda (Jan 26 2022 at 16:00):

DTR is creating a profile which extends the adaptive questionnaire profile from SDC. In this case, we need to create an example of the new profile in the IG.

view this post on Zulip Yolanda (Jan 26 2022 at 18:01):

If there is a profile in the IG, it is expecting an example/instance for the profile. Otherwise, qa reprt would complain. Is there a way to get around that.

view this post on Zulip Chris Moesel (Jan 26 2022 at 18:30):

@Yolanda -- you can tell the IG Publisher to ignore that warning. This is actually exactly what the SDC project does. See the last 2 lines in SDC's input/ignoreWarnings.txt file:

# This is a contained adaptive Questionnaire in QuestionnaireReponse profile, so ignoring this warning
WARNING: StructureDefinition.where(url = 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire-adapt'): The Implementation Guide contains no examples for this profile

view this post on Zulip Yolanda (Jan 26 2022 at 18:36):

oh, I see. Great, will do that. Thanks Chris.

view this post on Zulip Yolanda (Feb 14 2022 at 22:52):

@Lloyd McKenzie @Grahame Grieve I added the adaptive questionnaire as contained resource to the QuestionnaireResponse. FSH is not generating the resource as the Questionnaire is "inline". But the QA report is complaining about the JSON can't be resolved for the inline Questionnaire. Any thoughts? Thanks. Here is the QA report warnings: https://build.fhir.org/ig/HL7/davinci-dtr/qa.html

view this post on Zulip Grahame Grieve (Feb 14 2022 at 22:56):

where's the complaint?

view this post on Zulip Chris Moesel (Feb 14 2022 at 23:00):

@Grahame Grieve - I think it is these two: image.png

view this post on Zulip Chris Moesel (Feb 14 2022 at 23:01):

Those appear to be pages that are supposed to represent the Questionnaire that was inlined as a contained resource in the example QuestionnaireResponse here: https://build.fhir.org/ig/HL7/davinci-dtr/QuestionnaireResponse-home-o2-sdc-adaptive-questionnaireresponse.json

view this post on Zulip Grahame Grieve (Feb 14 2022 at 23:01):

looks like a contained resource issue. I'll think about it when Lloyd says it's not a template issue

view this post on Zulip Yolanda (Feb 14 2022 at 23:04):

Yes, thanks Chris :-)

view this post on Zulip Lloyd McKenzie (Feb 15 2022 at 03:44):

I suspect it's a template issue. So ignore for now.

view this post on Zulip Yolanda (Feb 15 2022 at 12:56):

Sounds good, thanks Lloyd and Grahame.


Last updated: Apr 12 2022 at 19:14 UTC