AuDigitalHealth / ci-fhir-r4

Working drafts of HL7™ FHIR® Release 4 (R4) artefacts authored and maintained by the Informatics Architecture team at the Australian Digital Health Agency.
Other
14 stars 3 forks source link

FixedPattern conflict in DiagnosticReport.category; Observation.category; ServiceRequest.category #87

Closed dtr-agency closed 4 years ago

dtr-agency commented 4 years ago

Prerequisites

The bug

The use of FixedPattern is conflicting with the intended design - we want to fix a domain category, e.g. imaging, and encourage the sending of a second finer grained category, but current profile forces all instances of category to match the fixed pattern.... which is the right behaviour of fixed pattern but the wrong behaviour for our profiles. For:

What I expected to happen

A resource without one instance of category that has the desired value should fail with error. A resource with only one instance of category with the desired value of category should pass. A resource with one or more instances of category with a different code to the desired value in addition to one instance of category with the desired value of category should pass.

Workarounds

Could just remove entirely.

QA.html excerpt

An instance of DiagnosticReport we want to pass inside a Bundle (see below for code) is failing.

<DiagnosticReport>
...
        <category>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v2-0074"/>
            <code value="LAB"/>
          </coding>
        </category>
        <category>
          <coding>
            <system value="http://terminology.hl7.org/CodeSystem/v2-0074"/>
            <code value="MB"/>
          </coding>
        </category>
...
<DiagnosticReport>
Bundle/559b66ea-abbf-45fb-8627-554817830095: Bundle.entry[0].resource.category[1] (l372/c27) error Expected CodeableConcept pattern not found for system: http://terminology.hl7.org/CodeSystem/v2-0074 code: LAB display: null - Issues: [ValidationMessage[level=ERROR,type=VALUE,location=Bundle.entry[0].resource.category[1].coding.code,message=Value is "MB" but must be "LAB"]]

Additional context

Not an issue for Other Diagnostics profiles that do not fix a category.

dtr-agency commented 4 years ago

Removed patternCodeableConcept

dtr-agency commented 4 years ago

Added invariant to ensure one category shall be ...

Added invariant that One category shall be 'imaging' 'http://terminology.hl7.org/CodeSystem/observation-category' - FHIRPath only enforcing category.coding.code value and not system in this draft (system may not be needed as an extensible value set is bound here.). Added to:

Added invariant that One category shall be 'imaging' 'http://terminology.hl7.org/CodeSystem/observation-category' - FHIRPath only enforcing category.coding.code value and not system in this draft (system may not be needed an extensible value set is expected to be bound here.). Added to:

Added invariant that One category shall be 'laboratory' 'http://terminology.hl7.org/CodeSystem/observation-category' - FHIRPath only enforcing category.coding.code value and not system in this draft . Added to:

Added invariant that One category shall be 'LAB' 'http://terminology.hl7.org/CodeSystem/v2-0074' - FHIRPath only enforcing category.coding.code value and not system in this draft (system may not be needed as category is bound as extensible). Added to:

Added invariant that One category shall be '108252007' 'http://snomed.info/sct' - FHIRPath only enforcing category.coding.code value and not system in this draft (system may not be needed as the SNOMED codes are fairly unique). Added to:

dtr-agency commented 4 years ago

Removed category (pattern) known issue now this is fixed in the profiles for:

NOTE: Observation (Atomic Imaging Observation) known issues have not been touched as the phase 2 work for this profile including updating the known issues is in progress and thus this profile did not have this issue documented yet.

dtr-agency commented 4 years ago

Ready for joint product owner review @davidmckillop and internal reviewer @dbojicic-agency.

dbojicic-agency commented 4 years ago

In review with @dbojicic-agency.

dbojicic-agency commented 4 years ago

Confirmed all changes made as described. Require including system value for the expression to fully match invariant description. This be machine processable and probably easier for novice readers to understand.

dtr-agency commented 4 years ago

Added system value; please review.

dbojicic-agency commented 4 years ago

Confirmed changes, all new invariants include system and code values now.

dtr-agency commented 4 years ago

Merged, regenerated, pushed to GitHub.