Stream: implementers
Topic: Forge R4 22.0 Create new extensions
Maria Hu (Jul 10 2019 at 22:04):
When using FORGE R4 to define data type of new extension, the value stays at value[x] instead of the actual data type being selected; it used to work properly with FORGE STU3.
When loaded to simplifier.net site, the extension failed to render due to 'Invalid resource format: Type checking the data: Encountered unknown element 'type' at location 'StructureDefinition.context[0].type[0] while parsing.
Emailed Firely Support Team, was told it's likely a bug but it's summer holidays, will have to take couple of weeks for the fix.
Does anyone has a workaround meanwhile to get the extension created properly? Please advise, thanks.
Michel Rutten (Jul 16 2019 at 12:22):
Hi @Maria Hu, this is due to a change in FHIR R4 about the interpretation of type slices (i.e. type constraints on a polymorphic element whose name ends with [x]
): http://build.fhir.org/elementdefinition.html#typesx
In R4, constraints on the original [x]
element (without a slice name) apply to all element values that may occur in an actual instance, regardless of the datatype. You can further constrain the list of datatypes of the original [x]
element in order to disallow certain datatypes (allowed by the base profile). You can also specify type-specific constraints by adding a named type slice for a specific datatype.
In comparison, STU3 allows you to constrain the original [x]
element itself to a single datatype, optionally including other element constraints associated with that type, by means of a short-hand notation (without using slicing).
The new FHIR R4 syntax is more verbose, but also more powerful and flexible. However as a result, this also complicates the relevant UI/UX in Forge R4. The current implementation is somewhat crude and we're looking into ways to improve the user experience.
Last updated: Apr 12 2022 at 19:14 UTC