Stream: IG creation
Topic: Generating and rendering contained ValueSets
Elliot Silver (Dec 04 2020 at 03:11):
Does anyone have an IG that has a contained ValueSet?
The valueset xml.html, json.html, and ttl.html links are not being generated, and I'm getting QA errors about it.
Lloyd McKenzie (Dec 04 2020 at 03:12):
There are a couple of examples in the SDC IG
Elliot Silver (Dec 04 2020 at 03:13):
For IG publisher, I assume that they aren't in a separate json from the enclosing resource, correct?
Lloyd McKenzie (Dec 04 2020 at 03:23):
Contained resources couldn't be
Elliot Silver (Dec 04 2020 at 03:25):
Right. So IG publisher should be extracting the contained resources from the enclosing, and generating narrative, xml, json, and ttl forms. For some reason it's only generating the narrative html.
Grahame Grieve (Dec 04 2020 at 03:25):
no it should only generate the html
Elliot Silver (Dec 04 2020 at 03:31):
It's actually broken in SDC too: http://build.fhir.org/ig/HL7/sdc/ValueSet-questionnaire-sdc-profile-example-PHQ9_VSPHQ9.html. I wonder if there were QA error for that too.
I'm guessing the issue is that the template doesn't know not to generate the other forms for contained resources.
Grahame Grieve (Dec 04 2020 at 03:31):
right. The source is contained, so it would be wrong to generate that. The template should referencer the contained content in the owning resource.
Elliot Silver (Dec 04 2020 at 17:01):
Is this an issue with the template or the publisher?
Lloyd McKenzie (Dec 04 2020 at 19:34):
No. There'd be no expectation that the contained references would generate as separate files. They're 'contained'. That means they live only in the containing resource.
Elliot Silver (Dec 04 2020 at 20:09):
@Lloyd McKenzie , if you look at https://build.fhir.org/ig/HL7/sdc/Questionnaire-questionnaire-sdc-profile-example-PHQ9.html, you'll see that all the answers are from the VSPHQ9 value set (with a funny closing bracket on the url). Looking at https://build.fhir.org/ig/HL7/sdc/Questionnaire-questionnaire-sdc-profile-example-PHQ9.json.html, I can see that this value set is contained in the questionnaire.
Clicking on the VSPHQ9 link in the questionnaire narrative, it takes me to a page for the value set. This page has tabs for narrative, xml, json, and ttl, but only the narrative page exists. This it does generate a separate file for at least the narrative page. Clicking on any of the other formats leads to a 404 error.
(It might be nice to visually differentiate contained resources from non-contained ones, both where they are linked to from the containing resource narrative, and on the contained resource page.)
Elliot Silver (Dec 08 2020 at 04:42):
As far as I can tell, the templates have no awareness of contained resources. Is this a capability they're missing, or something that should be handled upstream in the publisher?
Lloyd McKenzie (Dec 08 2020 at 04:49):
What sort of awareness should they have?
Elliot Silver (Dec 08 2020 at 04:50):
Contained resources shouldn't have XML or JSON representations, they should link back to the containing resource's XML or JSON.
Grahame Grieve (Dec 08 2020 at 04:50):
not to generate links for their base source
Elliot Silver (Dec 08 2020 at 06:33):
I've now spent more time looking at templates, temp/pages, and the IG publisher than is safe. I don't think Jekyll has the information needed to omit the XML/JSON tabs for contained resources, or to link to the containing resources' pages. By the time the template processing is happening, contained resources are indistinguishable (to me at least) from standalone. My suspicion is that the publisher needs to generate a data file for contained resources, which includes the containing resource. Once that is in place, the template can be updated to make use of that new information.
Or I could be totally wrong, and in way over my head. I'm not going to put money on which is more likely.
Grahame Grieve (Dec 08 2020 at 06:52):
there is a data file just like that
Grahame Grieve (Dec 08 2020 at 06:53):
for that reason
Elliot Silver (Dec 08 2020 at 07:01):
Which one? I couldn’t find it.
Jose Costa Teixeira (Dec 08 2020 at 16:35):
Should we add to the resources.json the contained resources (or anywhere else)?
we could do:
- Just add the contained resources to the resources.json, addding a
{{"contained":"true",{"containedIn"="Questionnaire/myQuestionnaire"}}
- Add a
{"containedResources":["ValueSet/Valueset1"]}
to the containing resources - A separate json file?
Elliot Silver (Dec 08 2020 at 17:01):
I'm not sure that "contained" is needed, the presence of the "containing" is sufficient. (And I'd change "containing" to "containedIn" for clarity.) I hadn't thought about "containedResources" but that would help with decorating the link to the contained resource, or adding a list of contained resources to the containing resource.
I envisioned a separate json file, since that has lower risk of breaking things that use resources.json.
Jose Costa Teixeira (Dec 08 2020 at 17:14):
(updated option 1 to "containedIn").
Jose Costa Teixeira (Dec 08 2020 at 17:15):
I'd think it's safer for the template to look at one single file, otherwise the liquid becomes more complicated, I guess..
Elliot Silver (Dec 08 2020 at 17:26):
Fair enough, and as far as I can tell, it's only the history attribute that is being used in the resources.json. There are plenty of other things in there, but none are used by the templates.
Jose Costa Teixeira (Dec 08 2020 at 20:31):
...yet
Jose Costa Teixeira (Dec 08 2020 at 20:32):
Correct. The resources JSON is not used for much but should be used to add cool stuff as we go, like "testing"
Jose Costa Teixeira (Dec 08 2020 at 20:35):
Or maybe 'this resource was inherited as a dependency, it is not defined here'
Grahame Grieve (Dec 08 2020 at 20:38):
hmm so apparently I had not not put this in resources.json. Looks like contained resources are just listed there at all...
Elliot Silver (Dec 08 2020 at 20:39):
Grahame Grieve said:
Looks like contained resources are just listed there at all...
Are not listed there?
Grahame Grieve (Dec 08 2020 at 20:39):
err, that's what I meant
Elliot Silver (Dec 08 2020 at 20:41):
I've got template changes that will skip the nav tabs for contained resources, if you can include them in resources.json. Ideally with the containing resource as Jose and I were theorizing above.
Jose Costa Teixeira (Dec 08 2020 at 20:42):
What should the resources JSON look like?
Elliot Silver (Dec 08 2020 at 20:46):
- Contained resource should be included in
resources.json
along with the other resources, with all the regular attributes. (The only odd thing for contained resources will be the "source" attribute, which will be the containing resource.) - Contained resources also have a "containedIn" attribute with the id of the containing resource.
- Containing resources should have a "contains" attribute which is an array of contained resource ids.
- add a "path" attribute for contained or containing resources which is the relative url of the base page for the resource.
(edited to reflect what I ended up needing.)
Elliot Silver (Dec 08 2020 at 20:47):
Here is a contained and a containing sample resource.
Elliot Silver (Dec 08 2020 at 20:47):
"ValueSet/WhoCrQuestionnaireCovid19Surveillance_WhoCrValueSetQuestionnaireReasonForTesting": {
"containedIn": "Questionnaire/WhoCrQuestionnaireCovid19Surveillance",
"path" : "ValueSet-WhoCrQuestionnaireCovid19Surveillance_WhoCrValueSetQuestionnaireReasonForTesting.html",
"history": false,
"index": 99,
"source": "/Users/elliot/src/covid-ig/fsh-generated/resources/questionnaire-WhoCrQuestionnaireCovid19Surveillance.json",
"url": "http://openhie.github.io/covid-19/Questionnaire/WhoCrQuestionnaireCovid19Surveillance#WhoCrValueSetQuestionnaireReasonForTesting",
"name": "WhoCrValueSetQuestionnaireReasonForTesting",
"title": "WhoCrValueSetQuestionnaireReasonForTesting",
"version": "0.1.0",
"date": "2020-12-07T19:50:36-08:00",
"status": {
"class": "colstu",
"owner": "OpenHIE",
"link": "http://www.ohie.org",
"status": "Active"
}
},
"Questionnaire/WhoCrQuestionnaireCovid19Surveillance": {
"contains": [
"ValueSet/WhoCrQuestionnaireCovid19Surveillance_WhoCrValueSetQuestionnaireCountry",
"ValueSet/WhoCrQuestionnaireCovid19Surveillance_WhoCrValueSetQuestionnaireReasonForTesting",
"ValueSet/WhoCrQuestionnaireCovid19Surveillance_WhoCrValueSetQuestionnaireComorbidity",
"ValueSet/WhoCrQuestionnaireCovid19Surveillance_WhoCrValueSetQuestionnairePatientOutcome",
"ValueSet/WhoCrQuestionnaireCovid19Surveillance_WhoCrValueSetQuestionnaireAdmin1"
],
"path" : "Questionnaire-WhoCrQuestionnaireCovid19Surveillance.html",
"history": false,
"index": 80,
"source": "/Users/elliot/src/covid-ig/fsh-generated/resources/questionnaire-WhoCrQuestionnaireCovid19Surveillance.json",
"url": "http://openhie.github.io/covid-19/Questionnaire/WhoCrQuestionnaireCovid19Surveillance",
"name": "WhoCrQuestionnaireCovid19Surveillance",
"version": "0.1.0",
"date": "2020-12-08T22:22:09-08:00",
"status": {
"class": "colsd",
"owner": "OpenHIE",
"link": "http://www.ohie.org",
"status": "Draft"
}
}
(edited to reflect "as built")
Elliot Silver (Dec 08 2020 at 20:53):
By the way, I've found some other issues with contained resources:
- Section numbering is broken. The sections are ".1", ".1.2", etc. instead of a proper numbering. I don't know how sections should be numbered for contained resources (sequential after all the standalone resources? alphabetical within the containing resource?), but this looks wrong.
- There are no breadcrumb links
- The text element is not rendered
- The contained resource is not processed correctly by jekyll. I've got
"copyright": "{{{year}}}"
which doesn't get converted to"copyright": "2020"
in either the XML/JSON representation of the containing resource, or the separate narrative rendering of the contained resource. However, the same line in the containing resource does get converted correctly.
Grahame Grieve (Dec 08 2020 at 20:59):
I'll look at this next week after final content deadline for HL7 ballot is due
Elliot Silver (Dec 08 2020 at 20:59):
Thank you.
Elliot Silver (Dec 08 2020 at 23:41):
For the list:
- "References" for contained resources are incorrect. I suspect the references should list the (a) containing resource, as well as (b) any resource contained by (a) which references this contained resource.
Elliot Silver (Dec 09 2020 at 06:39):
OK, I've got something working to link between the contained and containing resources, and have updated my comments above for what it actually needs. I'll create a pull request for ig-template-base once the contents of resource.json are confirmed.
Elliot Silver (Jan 29 2021 at 03:32):
Along the lines of my previous "References" issue, I've just noticed that in my IG that a regular (i.e., not contained) CodeSystem which is only used by ValueSets which are contained in a Questionnaire displays:
This Code system is referenced in the content logical definition of the following value sets:
This CodeSystem is not used here; it may be used elsewhere (e.g. specifications and/or implementations that use this content)
It definitely is used, but I don't know if it should be pointing to the containing or contained resource.
Lloyd McKenzie (Jan 29 2021 at 04:51):
Capture a Git issue against the publisher
Last updated: Apr 12 2022 at 19:14 UTC