hl7au / au-fhir-base

AU Base FHIR Implementation Guide Source
36 stars 26 forks source link

AU Base Medication: Medication.code invariants always get triggered #280

Closed dbojicic-agency closed 4 years ago

dbojicic-agency commented 5 years ago

Medication.code invariants always get triggered despite the fact they are always true.

Please see the sample medication instance and reported IG Publisher qa errors below:

<Medication xmlns="http://hl7.org/fhir">
    <id value="2f70f312-8323-11e9-bc42-526af7764f64"/>
    <meta>
        <profile
            value="http://hl7.org.au/fhir/StructureDefinition/au-medication"
        />
    </meta>
    <extension url="http://hl7.org.au/fhir/StructureDefinition/medication-brand-name">
        <valueString value="Ferro-Grad C"/>
    </extension>
     <!--  Ferro-Grad C-->
    <code>
        <coding>
            <extension
                url="http://hl7.org.au/fhir/StructureDefinition/medication-type">
                <valueCoding>
                    <system value="http://hl7.org.au/fhir/CodeSystem/medication-type"/>
                    <code value="BPD"/>
                    <display value="Branded product with no strengths or form"/>
                </valueCoding>
            </extension>
            <system value="http://snomed.info/sct"/>
            <code value="53373011000036103"/>
        </coding>
        <text value="Ferro-Grad C"/>
    </code>
</Medication>

Errors:

AMT TPUU valueset membership required [coding.where((system = 'http://snomed.info/sct') and (extention.where(url = 'http://hl7.org.au/fhir/CodeSystem/medication-type').valueCoding = 'BPDSF')).exists() implies coding.where((system = 'http://snomed.info/sct') and (extension.where(url = 'http://hl7.org.au/fhir/CodeSystem/medication-type').valueCoding = 'BPDSF')).first().code in 'http://hl7.org.au/fhir/ValueSet/amt-tpuu-codes']

AMT TPU valueset membership required [coding.where((system = 'http://snomed.info/sct') and (extention.where(url = 'http://hl7.org.au/fhir/CodeSystem/medication-type').valueCoding = 'BPG')).exists() implies coding.where((system = 'http://snomed.info/sct') and (extension.where(url = 'http://hl7.org.au/fhir/CodeSystem/medication-type').valueCoding = 'BPG')).first().code in 'http://hl7.org.au/fhir/ValueSet/amt-tpp-codes']
....
Could not match any discriminators ([system, code]) for slice Medication.code.coding:pbs in profile http://hl7.org.au/fhir/StructureDefinition/au-medication - does not have fixed value, binding or existence assertions for any of the discriminators
...
Could not match any discriminators ([system, code]) for slice Medication.code.coding:gtin in profile http://hl7.org.au/fhir/StructureDefinition/au-medication - does not have fixed value, binding or existence assertions for any of the discriminators
...
brettesler-ext commented 5 years ago

I am not sure AU sct (AMT) is being resolved by the IG builder - the pbs and gitn looks like an issue with proflles will check

dbojicic-agency commented 5 years ago

Thanks Brett, please see also https://gforge.hl7.org/gf/project/fhir/tracker/?action=TrackerItemEdit&tracker_item_id=20009

brettesler-ext commented 5 years ago

will check all FHIRPath on ballot resolution

brettesler-ext commented 5 years ago

Discriminator: to system only Add fixed system value in each slice to discriminate on binding AMT (preferred); to allow other SNOMED-CT codes with warnings across all meds profiles

RichardTON commented 4 years ago

The invariants that caused this have been deleted. The extension, medication-type (http://hl7.org.au/fhir/StructureDefinition/medication-type), that the invariants constrained is no longer mentioned in the profile. Can this issue be closed?

brettesler-ext commented 4 years ago

if in valueset (MP, TPP etc) implies medication-type is absent or correct

dbojicic-agency commented 4 years ago

Closing this issue as the original problem has gone away. @oridashi, please raise another issue for any other work related to this.