Stream: conformance
Topic: Slicing on valueset binding
Brett Esler (Nov 17 2017 at 01:44):
Hi all - looking for slicing options for the following, would like to slice a CodeableConcept 0..* element to support multiple slices bound to different ValueSets from a single CodeSystem hierarchy - how do i define discriminators so can determine which ValueSet binding is relevant since codes are all in the same CodeSystem (i.e. can't use Coding.system value to discriminate)?
Vadim Peretokin (Nov 17 2017 at 10:55):
Yeah, it's pretty hard then. Could you give some context - why do you need to do this? Why not one valueset?
Lloyd McKenzie (Nov 17 2017 at 12:19):
Just slice on the element that has the binding and declare the value set for each. So long as the value sets are mutually exclusive (or at least all the codes you receive only exist in one of the value sets), validation should work.
Brett Esler (Nov 17 2017 at 12:52):
@Vadim Peretokin couple of example cases - Australian Medicines Terminology (SNOMED-CT AU Edition) Medication.code.coding slices for Medicinal Product Pack and Trade Product Pack (0..1 of each) both are SNOMED-CT but want to restrict to up to one of each subset. Another one Organization.type slices using ANZSIC (industry classification); there are two levels in this CodeSystem; want to allow up to one from each level in a profile.
Brett Esler (Nov 17 2017 at 13:21):
@Lloyd McKenzie how would a validator know which slice is to be applied? Is the discriminator then the 'code' value itself? obviously this is more difficult for a validator as needs to check contained in ValueSet rather than a matched value
Lloyd McKenzie (Nov 17 2017 at 17:04):
The validator would evaluate the code against each slice. If it finds 0 or more than one match, it yells. If it only finds one, it knows what slice applies and then validates the rest accordingly.
Brett Esler (Nov 18 2017 at 05:50):
thanks @Lloyd McKenzie will try this out
Eric Haas (Nov 18 2017 at 15:50):
Just slice on the element that has the binding and declare the value set for each. So long as the value sets are mutually exclusive (or at least all the codes you receive only exist in one of the value sets), validation should work.
```so if I have valueset A = a,b,c And valueset B = a,c,d,f. It will yell if the code is a or c?
Lloyd McKenzie (Nov 18 2017 at 23:02):
Yup. Because the element will match multiple slices and that's not (presently) allowed.
Richard Townley-O'Neill (May 03 2018 at 06:01):
@Lloyd McKenzie
As I read the documentation on discriminators the slice's discriminator specifies the elements and method of testing used to test for slice membership, so if I slice Medication.code with discriminator Medication.code.coding.system, I can only have one slice for each value of system. That would prevent what Brett is asking for.
Lloyd McKenzie (May 03 2018 at 12:19):
You can also slice by valueset. So long as the valuesets don't have overlapping codes (i.e. code + system the same), it's fine if they have codes from the same code system
Richard Townley-O'Neill (May 03 2018 at 22:26):
How do you slice by value set? It is obvious how to slice by CodeSystem: value of coding.system, but I cannot see how to slice by ValueSet.
Would I slice Medication.code with two discriminators, discriminator1 a 'value' on Medication.code.coding.system and discriminator2 a 'value' on Medication.code.coding.code and then the definitions for each slice specify a value for system, but not for code? That looks wrong.
Lloyd McKenzie (May 03 2018 at 22:31):
Slice by value and declare non-overlapping value sets (or fixed values) in your slices. It looks like the documentation about this as an option could be better, so feel free to submit a change request. So you'd slice on Medication.code and then in each slice you'd declare a different binding for Medication.code
Richard Townley-O'Neill (May 08 2018 at 04:01):
Thanks
#16522 added
Last updated: Apr 12 2022 at 19:14 UTC