Stream: conformance
Topic: Question on value binding
ryan moehrke (Dec 18 2020 at 15:48):
code snip:
"differential": {
"element": [
{
"id": "Patient.maritalStatus",
"path": "Patient.maritalStatus",
"min": 1
},
{
"id": "Patient.maritalStatus.coding",
"path": "Patient.maritalStatus.coding",
"slicing": {
"discriminator": [
{
"type": "value",
"path": "coding.system"
}
],
"rules": "open"
},
"min": 1
},
{
"id": "Patient.maritalStatus.coding:ValuesetSlice",
"path": "Patient.maritalStatus.coding",
"sliceName": "ValuesetSlice",
"min": 1,
"max": "1",
"binding": {
"strength": "required",
"valueSet": "http://hl7.org/fhir/ValueSet/marital-status"
}
},
{
"id": "Patient.maritalStatus.coding:ValuesetSlice.system",
"path": "Patient.maritalStatus.coding.system",
"patternUri": "http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"
}
]
}
Would we expect a structure definition defined like this to slice-match on the binding and system's patternUri? just one and not the other? I would expect it to slice match on just the system value and then validate against the binding after it knows it matches this slice. But I recently learned that type:value slicing also has bindings in scope for discriminator. But still because the path in this case is defined as system I would expect the binding to be ignored for slice-matching.
for example, I'm expecting 1 below to not match the slice and thus not be evaluated against the binding. I'm expecting 2 below to also not match the slice and not throw an error because of the binding (the original binding at the root element is extensible so it would instead throw a warning). I'm expecting 3 to match the slice on the system value and then be forced to comply with the binding. Are my expectations the intended functionality? or am I misguided?
1
<maritalStatus>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/v3-NullFlavor"/>
<code value="UNK"/>
<display value="unknown"/>
</coding>
</maritalStatus>
2
<maritalStatus>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/v3-NullFlavor"/>
<code value="UNK"/>
<display value="invalid-code"/>
</coding>
</maritalStatus>
3
<maritalStatus>
<coding>
<system value="http://terminology.hl7.org/CodeSystem/v3-MaritalStatus"/>
<code value="M"/>
<display value="Married"/>
</coding>
</maritalStatus>
Richard Townley-O'Neill (Dec 22 2020 at 01:18):
Are my expectations the intended functionality? or am I misguided?
I hope it would behave that way.
Lloyd McKenzie (Dec 22 2020 at 03:56):
That should work.
ryan moehrke (Dec 22 2020 at 15:19):
so validation should look at the discriminator path, evaluate that into a different StructureDefinition element than declares the slice name if needed, and only use the fixed[x]/pattern[x]/binding in that element to evaluate the slice matching. leaving all else as validation that is only required once a slice is matched? @Lloyd McKenzie (just want to make sure I know what you are agreeing with)
Lloyd McKenzie (Dec 22 2020 at 19:45):
When the validator hits a sliced element, it iterates through each slice and checks the element to see if it matches the discriminator. If it finds more than one match, that's an error. If it finds zero matches, that's a warning (or an error if slicing is closed). If it finds exactly one match, then it enforces all of the rules associated with that slice.
Last updated: Apr 12 2022 at 19:14 UTC