Stream: implementers
Topic: Validator Error in MedicationAdministration effective choice
Dennis Kipping (Mar 10 2022 at 11:53):
Hello,
We are currently getting errors for the effective choice element during the validation of Example-Instances of MedicationAdministrations.
For the validation, we are using the latest version of the HL7 FHIR Validator.
The error we get is:
"MedicationAdministration.effective[x]:effectivePeriod: mindestens erforderlich = 1, aber nur gefunden 0"
So an element of type Period is expected, even though our instance contains an effectiveDateTime.
We are allowing only the types dateTime and Period, both with 0..1 cardinality, while the effective[x] choice element has a cardinality of 1..1. So one of the types should be present, but not both.
Could this be an error in the HL7 Validator @Grahame Grieve , or are we missing something here?
Extract from the profile:
<element id="MedicationAdministration.effective[x]">
<path value="MedicationAdministration.effective[x]" />
<slicing>
<discriminator>
<type value="type" />
<path value="$this" />
</discriminator>
<rules value="closed" />
</slicing>
<type>
<code value="dateTime" />
</type>
<type>
<code value="Period" />
</type>
<mustSupport value="true" />
</element>
<element id="MedicationAdministration.effective[x]:effectiveDateTime">
<path value="MedicationAdministration.effective[x]" />
<sliceName value="effectiveDateTime" />
<type>
<code value="dateTime" />
</type>
<mustSupport value="true" />
</element>
<element id="MedicationAdministration.effective[x]:effectivePeriod">
<path value="MedicationAdministration.effectivePeriod" />
<sliceName value="effectivePeriod" />
<type>
<code value="Period" />
</type>
<mustSupport value="true" />
</element>
<element id="MedicationAdministration.effective[x]:effectivePeriod.start">
<path value="MedicationAdministration.effectivePeriod.start" />
<mustSupport value="true" />
</element>
<element id="MedicationAdministration.effective[x]:effectivePeriod.end">
<path value="MedicationAdministration.effectivePeriod.end" />
<mustSupport value="true" />
</element>
Extract from an instance causing the error:
...
<subject>
<reference value="urn:uuid:dca59b4e-3179-11ec-8d3d-0242ac130003" />
</subject>
<effectiveDateTime value="2020-07-20T20:00:00+01:00" />
<reasonCode>
<coding>
<system value="http://snomed.info/sct" />
...
Any help is appreciated
Lloyd McKenzie (Mar 10 2022 at 15:48):
The path should remain 'effective[x]'. It shouldn't change to effectivePeriod. (Whether that is the cause of your problem, I don't know)
Grahame Grieve (Mar 10 2022 at 19:44):
well, it looks like it should work, but if you want me to look at it, please provide a whole resource and a profile to validate it against
Last updated: Apr 12 2022 at 19:14 UTC