FHIR Chat · Extensions in example narrative · IG creation

Stream: IG creation

Topic: Extensions in example narrative


view this post on Zulip Niklas Haldorn (Sep 02 2020 at 12:59):

Hi everyone,
in my IG I have a StructureDefinition that adds an Extension to the ResearchStudy resource, but the auto-generated narrative for the examples does not show this extension.
I have already created a liquid template for the extension, but if I use that template for the ResearchStudy then the narrative only shows the extension.
Is there a way to just add the rules for the extension to the default template or do I have to copy the complete default template into my template?
Thanks for your attention,
Niklas

view this post on Zulip Lloyd McKenzie (Sep 02 2020 at 13:18):

@Eric Haas Could we set up some sort of inheritance of liquid templates? (Obviously we'd need to convert all the existing narrative code to be liquid and I don't know how feasible that is either - @Grahame Grieve)

view this post on Zulip Eric Haas (Sep 02 2020 at 13:49):

we can refactor the base templates as layouts and then template get inserted as content. but that requires the templating to use front matter to indicate the layout. https://jekyllrb.com/docs/layouts/

otherwise use conditional includes

{% if foo %} {%  include  bar.md %} {% endif  %}

view this post on Zulip Lloyd McKenzie (Sep 02 2020 at 13:53):

This isn't about the rendering templates, this is about the liquid templates the publisher uses to generate narratives.

view this post on Zulip Eric Haas (Sep 02 2020 at 14:56):

ok let me think about this ... I only created one of those.

view this post on Zulip Saul Kravitz (Sep 02 2020 at 18:51):

@Niklas Haldorn is modifying the liquid template something that mere mortals might attempt? Can you point me to the example of what you did?

I've taken a different approach, just doing a concise pseudo-FSH dump of the examples in the notes section with no customization for the profile. https://build.fhir.org/ig/HL7/davinci-pdex-plan-net/InsurancePlan-AcmeQHPGold.html#notes

view this post on Zulip Grahame Grieve (Sep 02 2020 at 20:06):

no liquid doesn't have any concept of inheritance.

view this post on Zulip Lloyd McKenzie (Sep 02 2020 at 20:30):

So no way to define one liquid narrative that leverages a different liquid file?

view this post on Zulip Grahame Grieve (Sep 02 2020 at 20:33):

I'm not sure what that means. you can always provide your own liquid template, either in a template or an implementation guide

view this post on Zulip Grahame Grieve (Sep 02 2020 at 20:34):

back to @Niklas Haldorn's question: is this something I can reproduce? It actually sounds like something I've overlooked to me

view this post on Zulip Lloyd McKenzie (Sep 02 2020 at 20:36):

Sure, you can provide your own - but if you want to use the 'standard' one (including taking advantage of future enhancements), but insert some stuff, it'd be nice if there was a way. Could we possibly embed special comments that a subsequent liquid processor could use in consuming the results of a liquid first pass to add extra stuff at certain key locations?

view this post on Zulip Grahame Grieve (Sep 02 2020 at 20:54):

some things are just a bad idea

view this post on Zulip Lloyd McKenzie (Sep 02 2020 at 20:58):

So your preference is fork from what exists and override and monitor the base for your fork to see if you want to incorporate future changes?

view this post on Zulip Grahame Grieve (Sep 02 2020 at 21:37):

it's not really my preference. that's like asking me if gravity is my preference

view this post on Zulip Niklas Haldorn (Sep 03 2020 at 11:15):

@Saul Kravitz i found a documentation about how to use liquid in the IG Stream: https://chat.fhir.org/#narrow/stream/179252-IG-creation/topic/Using.20liquid. I dont know how to modify the default templates, but if you just want to replace the default template with your custom one, you can follow the steps in the documentation

view this post on Zulip Niklas Haldorn (Sep 03 2020 at 11:22):

@Grahame Grieve this is my ResearchStudyExample: http://build.fhir.org/ig/Daelam/rdd-example/branches/master/ResearchStudy-exampleStudy_extern.html. The narrative does not display the DataSetDefinition, but the extensions content is important to understand the example. I have written a template for the extension(https://github.com/Daelam/rdd-example/blob/master/input/liquid/DataSetDefinition.liquid), but I am not sure how to include this, because with the current name it gets ignored and if I rename it to ResearchStudy.liquid it overrides the default template and the narrative only show the extension.

view this post on Zulip Grahame Grieve (Sep 04 2020 at 04:47):

well, I fixed the various bugs that were stopping extensions being rendered.I did note that you extension has an odd structure. Here's what you have:

"extension": [ {
    "url": "http://interopehrate.eu/fhir/StructureDefinition/DataSetDefinition",
    "extension": [ {
      "url": "DataRequirement",
      "valueDataRequirement": {  ...  }
    }, {
      "url": "DataRequirement",
      "valueDataRequirement": { ...  }
    }, {
      "url": "DataRequirement",
      "valueDataRequirement": { ...  }
    }, {
      "url": "DataRequirement",
      "valueDataRequirement": {... }
} ]

view this post on Zulip Grahame Grieve (Sep 04 2020 at 04:47):

Just do this:

view this post on Zulip Grahame Grieve (Sep 04 2020 at 04:48):

"extension": [ {
    "url": "http://interopehrate.eu/fhir/StructureDefinition/DataSetDefinition",
    "valueDataRequirement": {  ...  }
  }, {
    "url": "http://interopehrate.eu/fhir/StructureDefinition/DataSetDefinition",
    "valueDataRequirement": { ...  }
  }, {
    "url": "http://interopehrate.eu/fhir/StructureDefinition/DataSetDefinition",
    "valueDataRequirement": { ...  }
  }, {
    "url": "http://interopehrate.eu/fhir/StructureDefinition/DataSetDefinition",
    "valueDataRequirement": {... }
 }]

view this post on Zulip Grahame Grieve (Sep 04 2020 at 04:49):

as for liquid templates... if you still want to do the liquid template thing, you'll have to handle the whole resource


Last updated: Apr 12 2022 at 19:14 UTC