AuDigitalHealth / ci-fhir-stu3

Working drafts of HL7™ FHIR® Release 3 (STU) artefacts authored and maintained by the Clinical Informatics team at the Australian Digital Health Agency.
Other
11 stars 0 forks source link

Profile invariants constraining meta.profile not working - need to be relative not absolute #39

Closed dtr-agency closed 5 years ago

dtr-agency commented 5 years ago

Prerequisites

The bug

In some profiles a conformance points is that the profile shall declare itself conformant, this is done via an invariant on the meta element of the applicable resource e.g. Composition.meta, to fix the value of one instance of meta.profile.uri to be the uri of that profile.

The FHIRPath is written with an absolute path (i.e. includes the root resource element), e.g.:

Composition.meta.profile.where($this = 'http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/composition-shs-1').exists()

When building an IG the QA report coming out of IG Publisher generates an error for any example claiming conformance to one of these profiles with this type of rule declaring that the rule isn't satisifed. In other words a Composition example claiming conformance to 'http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/composition-shs-1' by including a that value in the Composition.meta.profile.uri.value will generate an error that Composition.meta.profile.uri.value is missing the value.

Clearly it is not missing the value, so the issue is with the invariant - on build generates errors that the composition does not include the meta.profile uri for which it claims conformance, e.g. if a composition claims to be conformant to 'http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/composition-shs-1' which requires that meta.profile.uri value then an error that the meta.profile.uri is missing is generated in the QA.html.

Changing the FHIRPath of the invariant in the profile to a relative path eliminates the error, e.g.:

profile.where($this='http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/composition-shs-1').exists()

The FHIRPath of the invariants on meta to fix an instance of meta.profile.uri.value need to be changed from absolute path to relative path in the following profiles:

What I expected to happen

On build of the FHIR-IGs in this repository none of the generated QA error reports includes an error 'One meta.profile shall be ...'

Steps to reproduce

  1. Build one of the FHIR-IGs (it must have examples included)
  2. View the QA report, e.g. '..//git/ci-fhir-stu3/output/EventSummary/qa.html'
  3. Scroll down to the error report for a bundle example e.g. ..\git\ci-fhir-stu3\examples\bundle-7fdbd082-b9c4-46bf-ac8d-8f71de24ac4a.xml
  4. Confirm there is no instance of the error 'One meta.profile shall be ...'
  5. Confirm that the bundle example actually conforms to the required profile by including a value in meta.profile.uri as required by the applicable profile in the implementation guide

Screenshots

If applicable, add screenshots to help explain your problem.

Workarounds

N/A

QA.html excerpt

The QA.html report for Shared Health Summary FHIR IG outputs this error for 8 example instances (there are 8 examples with a composition claiming conformance to composition-shs-1):

One meta.profile shall be 'http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/composition-shs-1' [Composition.meta.profile.where($this = 'http://ns.electronichealth.net.au/ci/fhir/3.0/StructureDefinition/composition-shs-1').exists()]

Desktop (please complete the following information):

Additional context

Add any other context about the problem here.