FHIR Chat · Bad Choice Rendering + JSON mangling · IG creation

Stream: IG creation

Topic: Bad Choice Rendering + JSON mangling


view this post on Zulip Chris Moesel (Mar 23 2018 at 02:50):

In my 3.0.1-based IG, profiles on Observation suffer from a poorly rendered basedOn choice in the Snapshot table. See:

bad_choice.png

In the profile.json I send to the IG publisher, the basedOn type looks about right (as best I can tell):

"type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/CarePlan"
          },
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/DeviceRequest"
          },
         // etc
],

But if I download the profile.json from the IG-produced profile page, it looks like the IG publisher lost all my targetProfiles!

"type": [
          {
            "code": "Reference"
          },
          {
            "code": "Reference"
          },
          // etc
],

For an example, see the Snapshot Table here: http://build.fhir.org/ig/HL7/us-breastcancer/StructureDefinition-oncology-HER2byISH.html

view this post on Zulip Grahame Grieve (Mar 23 2018 at 02:52):

hmm. I thought I had found all those plaecs

view this post on Zulip Grahame Grieve (Mar 23 2018 at 02:55):

code seems to have fallen out; wait for this build and try again

view this post on Zulip Chris Moesel (Mar 23 2018 at 12:48):

So... I just rebuilt on the auto-build, which I think uses the latest available igpublisher.jar. Now I see the bars (i.e., |) between each choice item, but it's still not wrapping between any -- so we get a super long horizontal list. In addition, when I download the JSON, it still looks like the targetProfile is stripped from each object in the type.

view this post on Zulip Chris Moesel (Mar 23 2018 at 12:50):

bad_choice_2.png

view this post on Zulip Chris Moesel (Mar 23 2018 at 12:50):

I also just noticed that there is a trailing | at the end of the list of choices in the HTML rendering...

view this post on Zulip Chris Moesel (Mar 23 2018 at 15:19):

Looking at the page source, I see that there are no spaces between the links and the bars (|) -- and that there is a missing bar between the first two choices and an extra bar at the end:

view this post on Zulip Chris Moesel (Mar 23 2018 at 15:19):

Reference</a>(<a href="http://hl7.org/fhir/STU3/careplan.html">CarePlan</a><a href="http://hl7.org/fhir/STU3/devicerequest.html">DeviceRequest</a>|<a href="http://hl7.org/fhir/STU3/immunizationrecommendation.html">ImmunizationRecommendation</a>|<a href="http://hl7.org/fhir/STU3/medicationrequest.html">MedicationRequest</a>|<a href="http://hl7.org/fhir/STU3/nutritionorder.html">NutritionOrder</a>|<a href="http://hl7.org/fhir/STU3/procedurerequest.html">ProcedureRequest</a>|<a href="http://hl7.org/fhir/STU3/referralrequest.html">ReferralRequest</a>|)

view this post on Zulip Chris Moesel (Mar 23 2018 at 15:20):

Instead, this needs to be:

view this post on Zulip Chris Moesel (Mar 23 2018 at 15:21):

Reference</a>(<a href="http://hl7.org/fhir/STU3/careplan.html">CarePlan</a> | <a href="http://hl7.org/fhir/STU3/devicerequest.html">DeviceRequest</a> | <a href="http://hl7.org/fhir/STU3/immunizationrecommendation.html">ImmunizationRecommendation</a> | <a href="http://hl7.org/fhir/STU3/medicationrequest.html">MedicationRequest</a> | <a href="http://hl7.org/fhir/STU3/nutritionorder.html">NutritionOrder</a> | <a href="http://hl7.org/fhir/STU3/procedurerequest.html">ProcedureRequest</a> | <a href="http://hl7.org/fhir/STU3/referralrequest.html">ReferralRequest</a>)

view this post on Zulip Chris Moesel (Mar 23 2018 at 15:21):

The spaces on each side of the | allow the choice types to wrap -- and I've confirmed that fixes the display issue.

view this post on Zulip Chris Moesel (Mar 23 2018 at 15:22):

Now as for why the targetProfile is stripped from the exported JSON, I don't know -- nor do I know if it's at all related to this.

view this post on Zulip Grahame Grieve (Mar 23 2018 at 19:24):

which json is stripped from?

view this post on Zulip Chris Moesel (Mar 23 2018 at 19:42):

@Grahame Grieve See Observation:oncology-HER2byISH.basedOn element here: http://build.fhir.org/ig/HL7/us-breastcancer/StructureDefinition-oncology-HER2byISH.json.html

Now for comparison, look at the JSON structure definition I provided to the IG Publisher in the source: https://github.com/HL7/us-breastcancer/blob/master/resources/structuredefinition-oncology-HER2byISH.json#L490-L551

view this post on Zulip Grahame Grieve (Mar 23 2018 at 20:14):

fixed

view this post on Zulip Chris Moesel (Mar 24 2018 at 05:26):

The rendering looks much better. Thanks, @Grahame Grieve! There still seems to be an issue w/ the JSON / XML output, but it's a different issue now. I'll make a new thread for that.


Last updated: Apr 12 2022 at 19:14 UTC