Stream: shorthand
Topic: instance: extension at element level
Michaela Ziegler (Feb 03 2021 at 16:04):
I would be glad for help with inserting an extension for an instance at the element level.
It works on resource level:
SD for Device :
* extension contains StraumannExtensionAbutmentClass named abutmentclass 0..1
EX for Device:
* extension[abutmentclass].valueCodeableConcept = SCT#468936006 "Dental implant suprastructure, permanent (physical object)"
It doesn't work on element level -> Sushi: error Element Device.type.extension:abutmentclass.url has minimum cardinality 1 but occurs 0 time(s).
SD for Device :
* type.extension contains StraumannExtensionAbutmentClass named abutmentclass 0..1
EX for Device:
* type.extension[abutmentclass].valueCodeableConcept = SCT#468936006 "Dental implant suprastructure, permanent (physical object)"
Extension: StraumannExtensionAbutmentClass
Id: straumann-extension-abutmentclass
Title: "Straumann Extension Abutment Class"
Description: "Straumann Extension Abutment Class"
* valueCodeableConcept only CodeableConcept
* valueCodeableConcept ^min = 1
* valueCodeableConcept from StraumannVSAbutmentClass (required)
Chris Moesel (Feb 03 2021 at 16:46):
Hi @Michaela Ziegler -- what version of SUSHI are you using? It seems to work for me using SUSHI 1.1.0. I put it in FSH Online and it compiles correctly there: https://fshschool.org/FSHOnline/#/share/2YE8x0b
Michaela Ziegler (Feb 03 2021 at 17:18):
Sushi: info Running SUSHI v1.1.0 (implements FHIR Shorthand specification v1.1.0)
I have just seen that the problem only arises when I add the type. What am I doing wrong?
https://fshschool.org/FSHOnline/#/share/3rnFkmP
Chris Moesel (Feb 03 2021 at 19:02):
Actually your shared code did not give me that error, but that is because setting type
after setting type.extension
wiped out the extension (since you re-assigned the whole type
value including the extensions). But if I change the order and assign type
and then type.extension
, I see the problem. Looks like a bug to me; I don't think there is anything you did wrong. https://fshschool.org/FSHOnline/#/share/3toDtQo
Chris Moesel (Feb 03 2021 at 19:07):
For now, you can work around the bug by inserting this rule to explicitly set the URL:
* type.extension[abutmentclass].url = Canonical(StraumannExtensionAbutmentClass)
I also noticed one rule that I'd typically write a different way than you did:
* valueCodeableConcept ^min = 1
would usually be written as:
* valueCodeableConcept 1..1
or if you really don't want to state the max (since you're not changing it), you can also do:
* valueCodeableConcept 1..
Michaela Ziegler (Feb 03 2021 at 20:41):
Great, thx for your support!
Chris Moesel (Feb 04 2021 at 19:59):
I filed a bug for this: SUSHI#751
Last updated: Apr 12 2022 at 19:14 UTC