Stream: shorthand
Topic: differential binding
David Hay (Jul 21 2020 at 20:25):
So I've got a multi element extension - elements name (string) and value (CodeableConcept). Is it possible to 'slice' it so that the value binding is dependant on the value of name? Ie a specific ValueSet for each name...
Jean Duteau (Jul 21 2020 at 20:30):
slice the extension with discriminator of extension.extension.valueString and within each slice give a different binding?
that seems like it should work
David Hay (Jul 21 2020 at 20:37):
Yeah - I did try that - will have another go...
Jean Duteau (Jul 21 2020 at 20:46):
hmm, here is what I thought the syntax would allow but it didn't work...
Profile: TestProcedure
Parent: Procedure
* extension contains SlicedExtension named slicedExtension 0..*
* extension[slicedExtension] ^slicing.discriminator.type = #pattern
* extension[slicedExtension] ^slicing.discriminator.path = "extension[namepart].valueString"
* extension[slicedExtension] contains test1 0..1 and test2 0..1
* extension[slicedExtension][test1].extension[namepart].valueString = "test1" (exactly)
* extension[slicedExtension][test1].extension[valuepart].valueCodeableConcept from TransfusionProcedureCodeVS (extensible)
Extension: SlicedExtension
* extension contains namepart 1..1 valuepart 1..1
* extension[namepart].value[x] only string
* extension[valuepart].value[x] only CodeableConcept
Jean Duteau (Jul 21 2020 at 20:46):
here were my errors...
error Cannot read property 'fixValue' of undefined
File: /Users/jeanduteau/Documents/DDIWork/IBM-BEST/datastandards/fsh/TestSlice.fsh
Line: 7
error No element found at path extension[slicedExtension][test1] for TestProcedure, skipping rule
File: /Users/jeanduteau/Documents/DDIWork/IBM-BEST/datastandards/fsh/TestSlice.fsh
Line: 7
error No element found at path extension[slicedExtension][test2] for TestProcedure, skipping rule
File: /Users/jeanduteau/Documents/DDIWork/IBM-BEST/datastandards/fsh/TestSlice.fsh
Line: 7
error No element found at path extension[slicedExtension][test1].extension[namepart].valueString for TestProcedure, skipping rule
File: /Users/jeanduteau/Documents/DDIWork/IBM-BEST/datastandards/fsh/TestSlice.fsh
Line: 8
error No element found at path extension[slicedExtension][test1].extension[valuepart].valueCodeableConcept for TestProcedure, skipping rule
File: /Users/jeanduteau/Documents/DDIWork/IBM-BEST/datastandards/fsh/TestSlice.fsh
Line: 9
error No element found at path extension[slicedExtension][test1].value[x] for TestProcedure, skipping rule
error No element found at path extension[slicedExtension][test1].extension[namepart].extension for TestProcedure, skipping rule
error No element found at path extension[slicedExtension][test1].extension[valuepart].extension for TestProcedure, skipping rule
David Hay (Jul 21 2020 at 20:57):
Maybe the extension definition needs to be sliced on url and namePart (somehow)?
Jean Duteau (Jul 21 2020 at 20:59):
yeah, it is that "(somehow)" that is the kicker
Nick Freiter (Jul 22 2020 at 12:27):
I think what @Jean Duteau ran into is that SUSHI doesn't really have support for reslicing slices. I know SUSHI can work with a profile that already has resliced slices, but SUSHI can't actually correctly add reslices using the contains
keyword. I've made a bug for this here https://github.com/FHIR/sushi/issues/542.
Last updated: Apr 12 2022 at 19:14 UTC