FHIR Chat · extension element cardionality change · shorthand

Stream: shorthand

Topic: extension element cardionality change


view this post on Zulip John Moehrke (Dec 30 2020 at 16:46):

I have a profile that adds in an optional IG specific element (extension) at 0..1. And a second profile that needs to increases the cardinality to 1..1. I need both profiles. I can't figure out how to have the second (which has the first as parent) increase the element to mandatory.

view this post on Zulip John Moehrke (Dec 30 2020 at 17:27):

Figured it out... I didn't think to address it like one does in an Instance

* extension[TypeOfList] 1..1

view this post on Zulip John Moehrke (Dec 30 2020 at 18:29):

Actually, this only made sushi happy.. but it didn't do what I wanted.

view this post on Zulip Jose Costa Teixeira (Dec 30 2020 at 18:54):

what is missing? Do you have code somewhere to look at it?

view this post on Zulip Jose Costa Teixeira (Dec 30 2020 at 18:59):

this seems to do it

Profile: MyPatientProfile
Parent: Patient
* extension contains http://hl7.org/fhir/StructureDefinition/patient-disability named disability 0..1

Profile: MyOtherPatientProfile
Parent: MyPatientProfile
* extension[disability] 1..1

view this post on Zulip Jose Costa Teixeira (Dec 30 2020 at 19:00):

gives

"kind":"resource"
"abstract":false
"type":"Patient"
"baseDefinition":"http://example.org/StructureDefinition/MyPatientProfile"
"derivation":"constraint"
"differential":{
"element":[
{
"id":"Patient.extension"
"path":"Patient.extension"
"min":1
}
{
"id":"Patient.extension:disability"
"path":"Patient.extension"
"sliceName":"disability"
"min":1
}
]
}

view this post on Zulip John Moehrke (Dec 30 2020 at 19:43):

that is what I thought... but later that fails in the IG builder

view this post on Zulip John Moehrke (Dec 30 2020 at 20:08):

case... I used the wrong case

view this post on Zulip John Moehrke (Dec 30 2020 at 20:09):

shouldn't sushi complain when I say extension[TypeOfList] when there is no "TypeOfList", but rather "typeOfList"?

view this post on Zulip David Pyke (Dec 30 2020 at 20:11):

That sounds like a good check they could add.

view this post on Zulip Chris Moesel (Dec 31 2020 at 00:42):

Yeah. I'm kind of surprised SUSHI doesn't complain then. I thought SUSHI would output an error about an invalid path. In fact, I just tested this w/ Jose's example above and when I use extension[Disability] instead of extension[disability], SUSHI does indeed give an error:

error No element found at path extension[Disability] for MyOtherPatientProfile, skipping rule
Line: 7

So, it seems I can't reproduce the case where SUSHI allows an invalid path (when it's invalid due to different case of the slice name). I get an error (as I should).

view this post on Zulip John Moehrke (Dec 31 2020 at 12:36):

Given @Chris Moesel discussion, I checked again... My case was not exactly Jose's example. The problem is not simply a case issue. It is that my case-change (camelCase used) happened to align with the extension definition (PascalCase used). So I had defined my extension, not used a pre-existing one.

Extension: TypeOfList

I added that extension to my profile

  • extension contains TypeOfList named typeOfList 0..1

and tried to increase cardinality using the wrong one of these. I used the extension definition rather than the named

* extension[TypeOfList] 1..1

should have been

  • extension[typeOfList] 1..1

my IG git repo https://github.com/IHE/ITI.MHD if you want to see (comments welcome)


Last updated: Apr 12 2022 at 19:14 UTC