FHIR Chat · modifierExtension · fhirpath

Stream: fhirpath

Topic: modifierExtension


view this post on Zulip Bryn Rhodes (Mar 17 2022 at 16:03):

I believe that the Functions topic should include a modifierExtension() function as well as extension, but want to double-check. @Grahame Grieve , will the Java FHIRPath extension function look in modifierExtensions as well, or will it only work on regular extensions?

view this post on Zulip Grahame Grieve (Mar 30 2022 at 23:55):

modifierExtensions are extensions so it includes them

view this post on Zulip ryan moehrke (Apr 07 2022 at 17:29):

is there some logic forbidding extension and modifierextensions from using the same canonical url? I doubt they will in practice but on the off chance it happens it could add ambiguity..

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 17:57):

The expectation is that the canonical URL for any artifact is unique to that artifact. A given extension is either a modifier or not (as declared in the StructureDefinition)

view this post on Zulip Gino Canessa (Apr 07 2022 at 18:04):

Does StructureDefinition contain a flag for modifier? I thought that the behavior was determined by where it appears in an instance. E.g., an extension could appear in Patient.extension or Patient.modifierExtension and would be treated as a regular or modifier extension accordingly.

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:12):

The 'isModifier' property of the root element in the StructureDefinition will be 'true' for modifierExtensions and false for all other StructureDefinitions. (I guess possibly with an exception for logical models?)

view this post on Zulip Gino Canessa (Apr 07 2022 at 18:14):

Thanks Lloyd - that is an annoying convention (both to discover and to use).

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:14):

Why?

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:15):

An extension can't be both a modifier and a non-modifier - it has to be clear up front which it is. And the 'isModifier' element is the logical place to capture that...

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:15):

There's no requirement to look up any extension definition unless you want to validate the content

view this post on Zulip Gino Canessa (Apr 07 2022 at 18:29):

Sure, but putting annotations on an element that control the behavior of the parent structure is a bit odd from a definitional point of view (considering we have StructureDefinition and ElementDefinition). And, I cannot actually find any documentation explaining it. The only reference to isModifier I can see is explaining how complex extensions can include it in elements to control their own behavior.

I can follow a lot of 'why' knowing it exists (e.g., simpler propagation in snapshots / differentials, etc.), but it adds a layer of 'magic' to a lot of tooling. E.g., the publisher sees the element and changes the root (do-not-perform renders as a modifierExtension while request-insurance renders as an extension).

I'm guessing there should be a ticket to add documentation for this?

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:32):

We do the same for cardinality. If the root element of the StructureDefinition is 0..1, that means the extension (or other profile) can't be referenced in a place with a cardinality greater than 1.

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:33):

In short, the root element of a StructureDefinition contains some of the metadata about the StructureDefinition when it's the same sort of information that might also need to be asserted about descendant elements.

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:33):

Feel free to submit a tracker for us to call this out though if you feel it's not obvious.

view this post on Zulip Gino Canessa (Apr 07 2022 at 18:40):

Sure, is there other stuff that is inherited like that? (don't know what I don't know =)

view this post on Zulip Gino Canessa (Apr 07 2022 at 18:44):

I assume that means that the specified profile/extension cannot appear more than once, right (because extension is always 0..*)?

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 18:45):

label, code, short, definition, comment, alias, min, max, meaningWhenMissing, pattern, example, constraint, mapping - all of these could come into play when referencing an extension - or any other data type profile.

view this post on Zulip Gino Canessa (Apr 07 2022 at 19:28):

Cool beans - created FHIR-36738 , also as an aside: ElementDefinition shows up in Related Pages instead of Related Artifacts in Jira.

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 20:18):

In the core spec, only resources show up in "Related Artifacts", for historical reasons.

view this post on Zulip Brian Postlethwaite (Apr 07 2022 at 23:40):

Um, hoping that when that additional clarification is added that the display style props aren't forced to be what is in the extension definition and that the profile can say what they want to about those things. Especially if they are profiles with display labels in another language or localisation.

view this post on Zulip Grahame Grieve (Apr 07 2022 at 23:44):

what is this about?

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 23:45):

Rules are the same as any other constraint - so you're free to override label, short, definition, etc. so long as you're refining/contextualizing, not completely changing the meaning.

view this post on Zulip Lloyd McKenzie (Apr 07 2022 at 23:45):

Making clear that elements in the 'root' elementDefinition are talking about characteristics of the type - e.g. cardinality, isModifier, but other things too.


Last updated: Apr 12 2022 at 19:14 UTC