Stream: conformance
Topic: Forge22: setting cardinalities for Extension elements
Simone Heckmann (Aug 07 2019 at 06:55):
I'm currently creating an Extension of Datatype Coding
with Forge 22.0
I want to set the cardinalities for Coding.code to 1..1 but I can't find a way to do this since the value[x] Element doesn't expand.
Do I need to create a Profile for Coding first? But then I don't see a way to bind my Extension to the Profile...
What am I missing?
Simone Heckmann (Aug 07 2019 at 06:58):
Ah! I found the way to bind Coding to a Profile under the Datatype Selection!
pasted image
Alexander Zautke (Aug 07 2019 at 07:36):
The value[x] element does not expand by default anymore according to the new slicing rules in R4. You have to create new slices and then restrict the slices.
Alexander Zautke (Aug 07 2019 at 07:39):
Michel Rutten (Aug 07 2019 at 08:40):
Correct, thanks @Alexander Zautke!
Forge R4 no longer expands polymorphic elements such as value[x]
, even when constrained to a single datatype. In R4, the meaning of [x]
elements has changed, they now specify the list of allowed types. A profile can introduce concrete named slices to specify constraints specific datatypes. In Forge R4, you can slice the [x]
element, add a named slice and constrain it to a single datatype; now, Forge will try to expand the child elements of the named slice.
For example, compare the definition of a simple boolean extension in STU3:
Extension Extension.valueBoolean { Min = 1 }
to a similar definition in R4:
Extension Extension.value[x] { Type = boolean } Extension.valueBoolean { Min = 1 }
Michel Rutten (Aug 07 2019 at 08:46):
Note: The former syntax is still valid in R4, but interpreted differently. Without a constraint on the value[x]
element, the extension value accepts any datatype (as defined by the Extension base profile). The valueBoolean
element specifies constraints that are specific for boolean values; all other datatypes are allowed and unconstrained.
Simone Heckmann (Aug 08 2019 at 06:03):
Got it, thanks!
Last updated: Apr 12 2022 at 19:14 UTC