FHIR Chat · Specifying a Logic Model as type · implementers

Stream: implementers

Topic: Specifying a Logic Model as type


view this post on Zulip Chris Moesel (Mar 01 2018 at 19:18):

We're working on logical models for which many of the fields (represented by ElementDefinition in StructureDef) have a type that is another logical model. (Simple example: A "Condition" logical model might have a field whose type is a "Status" logical model). This type should _not_ be a reference -- but is more like an inlined type.

The doc on ElementDefinition.type.code says: "Absolute URLs are only allowed in logical models." This led me to believe that in the case noted above, the type.code should be (or at least could be) the absolute URI of Status.

When I do this and run the IG publisher, however, the generated table shows the type as the URI and doesn't link to the page for that type (it's just plain, non-linked text). If I make it a reference, however, (with code as "Reference" and profile as the URI), it appears as nice linked text to the type (showing the type's name instead of URI).

It would be great to have the IG render the non-reference types in the same way (as linked type names). Am I just doing this wrong, or is this a limitation of the IG publisher? I'm using STU3 w/ the STU3 IG publisher jar.

view this post on Zulip Chris Moesel (Mar 01 2018 at 19:35):

non-ref-vs-ref.png

view this post on Zulip Grahame Grieve (Mar 01 2018 at 20:38):

make a task against the IG publisher. I won't get to until at least after the freeze. But it's definitely something I want to do

view this post on Zulip Chris Moesel (Mar 03 2018 at 02:35):

Thanks, Grahame. I'm going to double-check to ensure I haven't made any other mistakes first -- but assuming not, I'll file a task.

view this post on Zulip Chris Moesel (Mar 20 2018 at 03:07):

@Grahame Grieve -- I haven't made that task yet, but I tried to wade through the code and figure out where the fix should be applied. I was not successful in finding it. For a minute, I thought I found the place in StructureDefinitionRenderer.java#describeType, but looking at that code, it seems like the linking _would_ work, so that must not be it.

If you know exactly where I should be looking, I'd be glad to take just a hint from you and carry it from there. On the other hand, if it requires some investigation on your end, then I'll just file the task for now...

view this post on Zulip Chris Moesel (Mar 29 2018 at 04:13):

For anyone else who runs into this and cares... I'm not particularly proud of it, but I was able to achieve what I wanted via this hack in my template for logical models (where the snapshot goes):

view this post on Zulip Chris Moesel (Mar 29 2018 at 04:13):

{% capture "snapshotTable" %}{% include {{[type]}}-{{[id]}}-snapshot.xhtml %}{% endcapture %}
  {% for sd in site.data.structuredefinitions %}
    {% capture "original" %}>{{sd[1].url}}</td>{% endcapture %}
    {% capture "replacement" %}><a href="StructureDefinition-{{sd[0]}}.html">{{sd[1].name}}</a></td>{% endcapture %}
    {% assign snapshotTable = snapshotTable | replace: original, replacement %}
    {% capture "original" %}>{{sd[1].url}},{% endcapture %}
    {% capture "replacement" %}><a href="StructureDefinition-{{sd[0]}}.html">{{sd[1].name}}</a>,{% endcapture %}
    {% assign snapshotTable = snapshotTable | replace: original, replacement %}
    {% capture "original" %}, {{sd[1].url}},{% endcapture %}
    {% capture "replacement" %}, <a href="StructureDefinition-{{sd[0]}}.html">{{sd[1].name}}</a>,{% endcapture %}
    {% assign snapshotTable = snapshotTable | replace: original, replacement %}
    {% capture "original" %}, {{sd[1].url}}</td>{% endcapture %}
    {% capture "replacement" %}, <a href="StructureDefinition-{{sd[0]}}.html">{{sd[1].name}}</a></td>{% endcapture %}
    {% assign snapshotTable = snapshotTable | replace: original, replacement %}
  {% endfor %}
  {{snapshotTable}}

Last updated: Apr 12 2022 at 19:14 UTC