Stream: implementers
Topic: Warning iso Error for missing slice
David Simons (Mar 21 2022 at 21:57):
I want to profile Patient (https://my.profile) that a certain slice SHOULD exist, not MUST, and hence want a validation warning rather than an error, on the conformant Resource.
Getting a Error: Exception in thread "main" java.lang.Error: Not done yet (ValidatorHostServices.resolveFunction): slice
from HL7 validator.
Is my approach in the right direction, and how to overcome .slice() apparently not being implemented yet?
<element id="Patient.identifier">
<path value="Patient.identifier"/>
<slicing>
<discriminator>
<type value="pattern"/>
<path value="type.coding"/>
</discriminator>
<description value="At least MR type Identifier is required"/>
<rules value="open"/>
</slicing>
<constraint>
<key value="mrslice" />
<severity value="warning" />
<human value="MyPatient SHOULD have an MR Identifier slice" />
<expression value="$this.slice('https://my.profile', 'MRSlice').exists()" />
<source value="https://my.profile" />
</constraint>
<mustSupport value="true" />
</element>
<element id="Patient.identifier:MRSlice">
<path value="Patient.identifier"/>
<sliceName value="MRSlice"/>
<min value="0"/>
<max value="1"/>
</element>
<element id="Patient.identifier:MRSlice.use">
<path value="Patient.identifier.use"/>
<fixedCode value="official"/>
</element>
<element id="Patient.identifier:MRSlice.type.coding">
<path value="Patient.identifier.type.coding"/>
<patternCoding>
<system value=" http://terminology.hl7.org/CodeSystem/v2-0203"/>
<code value="MR"/>
</patternCoding>
</element>
Lloyd McKenzie (Mar 21 2022 at 23:11):
It seems right. Only way to overcome the slice not existing would be to drive the invariant by the discriminator values for the slice
David Simons (Mar 28 2022 at 08:35):
For completeness, indeed I switched to a constraint at the Patient resource level, for example:
<differential>
<element id="Patient">
<path value="Patient"/>
<constraint>
<key value="identifierofficial" />
<severity value="warning" />
<human value="SHOULD have exactly 1 'official' Identifier" />
<expression value="identifier.where(use='official').count() = 1" />
<source value="https://my.profile" />
</constraint>
</element>
</differential>
Lloyd McKenzie (Mar 28 2022 at 15:07):
As an example, drawing from my own jurisdiction, 'official' would be the medical record number assigned by the clinic. 'usual' would be a provincial health number. (Most people know and use their provincial health number, almost no-one knows their MRN.)
Last updated: Apr 12 2022 at 19:14 UTC