FHIR Chat · Issue with extension differentials and rendering · IG creation

Stream: IG creation

Topic: Issue with extension differentials and rendering


view this post on Zulip Eric Haas (Nov 05 2019 at 20:07):

When updating race and ethnicity extensions in US Core we discovered a few issues.... Our complex differentials lacked the element ...

    <element id="Extension.value[x]">
      <path value="Extension.value[x]"/>
      <min value="0"/>
      <max value="0"/>
    </element>

... but contain Extension.extension elements.

This resulted in:

  • a valid StructureDefinition according to the validator (yay!)
  • an error in US Core Patient example instance that populate the extension: The Extension 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' definition is for a simple extension, so it must contain a value, not extensions (dang!)
  • US Core Patient rendering of an extension with type of an array of every value[x] instead of "(Complex)" (dang!) here is a screenshot of this...

pasted image

Unless there is some irreconcilable technical reason for this, I think a valid diff should be able to have an Extension.value[x] or Extension.extension element without having to declare a max value="0" for the other element.

*Note source for race and ethnicity are here: https://github.com/HL7/US-Core-R4/blob/master/source/resources/structuredefinition-us-core-race.xml and https://github.com/HL7/US-Core-R4/blob/master/source/resources/structuredefinition-us-core-ethnicity.xml

view this post on Zulip Grahame Grieve (Nov 05 2019 at 20:43):

I think a valid diff should be able to have an Extension.value[x] or Extension.extension element without having to declare a max value="0" for the other element.

view this post on Zulip Grahame Grieve (Nov 05 2019 at 20:43):

why?

view this post on Zulip Lloyd McKenzie (Nov 05 2019 at 20:44):

Extensions aren't 'special'. If you want to prohibit an element, you need to be explicit.

view this post on Zulip Eric Haas (Nov 05 2019 at 20:50):

@Grahame Grieve there is an invariant that says you can't have both so my reasoning if you have a value[x] then you would assume the extension.extension is max = 0 and vice versa in your differential.

view this post on Zulip Eric Haas (Nov 05 2019 at 20:51):

and besides value[x] and extension are min = 0

view this post on Zulip Eric Haas (Nov 05 2019 at 20:53):

But if I am wrong or missed some key documentation then that's OK too. But if this is not documented then would be nice to make explicit ( where to document is the question )

view this post on Zulip Grahame Grieve (Nov 05 2019 at 20:56):

@Eric Haas it's not really about wrong or right, to me. The code that does the rendering is generic for all structure definitions. It doesn't know anything about extensions, or the implications of the invariant that refer to. And I'm not going to try and infer meaning out of inherited invariants like that while rendering. (sorry). It does mean that that differentials need to be a bit more verbose, but it makes them consistent.

view this post on Zulip Grahame Grieve (Nov 05 2019 at 20:59):

as for

The Extension 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race' definition is for a simple extension, so it must contain a value, not extensions

I could revise that, since it's extension specific logic, but what should that code do when the extension definition allows for both value[x] and extension? How does that code decide what you actually mean? The base extension allows both, and says, choose one. That means you actually have to choose, and you do that by setting the cardinality one of them to 0. All the extension processing logic works that way. So just set it to 0.

As for where this is documented.... I don't know. It's obvious to me. But I'm ok to make it explicit somewhere if you can identify the most logical place

view this post on Zulip Eric Haas (Nov 05 2019 at 21:05):

Since it was not obvious to me, I'll assume won't be to others. I'll read through spec and see where is make the most sense to document it and create a tracker...

view this post on Zulip Grahame Grieve (Nov 05 2019 at 21:13):

ok. and you're going to fix US-Core?

view this post on Zulip Eric Haas (Nov 06 2019 at 00:35):

Fixed

view this post on Zulip Grahame Grieve (Nov 06 2019 at 00:52):

Ok I’ll release shorlty


Last updated: Apr 12 2022 at 19:14 UTC