Stream: conformance
Topic: Bundle (type = message) Validation
Kevin Mayfield (Jun 23 2020 at 05:13):
I've started creating a simple validation extension using MessageDefinition to control the (HAPI) validation.
Initial thought was to replace profile conformance listed in the meta sections to match MessageDefinition requirements.
So if the MessageDefinition states conformance against DM-MedicationRequest it will add that profile to MedicationRequest resources and so on.
Kevin Mayfield (Jun 23 2020 at 05:24):
That works but in some cases I will references to say UKCore-Patient but I've changed the Patient to DM-Patient.
The validator will throw up an error as it can't find a candidate UK-Core-Patient .... but DM-Patient is a derived profile of UKCore-Patient. So this should be ok?? <-- This is the bit I'm unsure about.
So
<issue>
<severity value="error"></severity>
<code value="processing"></code>
<diagnostics value="Unable to find matching profile for urn:uuid:C6750CAA-3CA9-4F29-A282-6EE1AA5D7D4C among choices: https://fhir.nhs.uk/R4/StructureDefinition/DM-Patient"></diagnostics>
<location value="Bundle.entry[2].resource.ofType(MedicationRequest).subject"></location>
<location value="Line 41, Col 408"></location>
</issue>
Kevin Mayfield (Jun 23 2020 at 05:34):
Screenshot-2020-06-23-at-06.31.29.png
I think this shows where I'm unsure. I'm seeing that reference as either saying
- The reference should validate as DM-Patient
- The reference should have a meta tag that says its DM-Patient and validates as DM-Patient.
I think the former is correct.
Kevin Mayfield (Jun 23 2020 at 05:38):
Background: The reason for not stating profile conformance in resources is to encourage reuse. E.g. the Patient resource X is sourced from service P and used to assemble a Bundle. Patient resource X is a UKCore-Patient, also P-Patient and also DM-Patient.
Lloyd McKenzie (Jun 23 2020 at 14:28):
There should be an accompanying Info message that tells you why the instance wasn't a valid DM-Patient
Lloyd McKenzie (Jun 23 2020 at 14:28):
There's no need to declare the profile in the instance - that's not what it's yelling about.
Kevin Mayfield (Jun 23 2020 at 15:06):
I'll investigate more and double check that. It is right the MessageDefinition defines the Bundle though? (I'm matching bundles to MessageDefinitions on event coding at the moment)
Lloyd McKenzie (Jun 23 2020 at 15:18):
The MessageDefinition defines the content of the Bundle - via the focus profile or the GraphDefinition. I don't think the GraphDefinition would actually describe the containing Bundle though.
Kevin Mayfield (Jun 24 2020 at 06:53):
Thanks @Lloyd McKenzie that was the issue. I was mislead by the error message.
Last updated: Apr 12 2022 at 19:14 UTC