Skip to content

Commit

Permalink
QA fixes in StructureDefinitions (#312)
Browse files Browse the repository at this point in the history
* Removed comments from gender identity and individual pronouns

* Removed short and definition from the identifier

* Rreorder invariants, correct invariant expressions, and align with FHIR-43848 changes

* Remove short from Observation.status and reorder invariants
  • Loading branch information
dbojicic authored Jan 16, 2025
1 parent 3cacabc commit 39f290c
Show file tree
Hide file tree
Showing 11 changed files with 40 additions and 46 deletions.
2 changes: 1 addition & 1 deletion input/resources/au-core-bloodpressure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@
<constraint>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="If a coded body site is provided, at least one code shall be from SNOMED CT"/>
<human value="If a coded body site is provided, at least one coding shall be from SNOMED CT"/>
<expression value="coding.exists() implies coding.where(system='http://snomed.info/sct').exists()"/>
<xpath value="not(exists(f:coding/f:system)) or exists(f:coding/f:system[@value='http://snomed.info/sct'])"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-bloodpressure"/>
Expand Down
12 changes: 6 additions & 6 deletions input/resources/au-core-bodytemp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<definition value="Measurement of a patient's body temperature at a point in time."/>
<comment value="Body temperature observation using a LOINC code, a SNOMED CT code and a metric UCUM unit of measure."/>
<constraint>
<key value="au-core-obs-02"/>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="At least value or data absent reason shall be present"/>
<expression value="dataAbsentReason.exists() or value.exists()"/>
Expand Down Expand Up @@ -250,7 +250,7 @@
</extension>
<path value="Observation.valueQuantity"/>
<short value="Body temperature"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
</element>
<element id="Observation.valueQuantity.value">
<extension url="http://hl7.org/fhir/StructureDefinition/obligation">
Expand Down Expand Up @@ -361,15 +361,15 @@
</extension>
</extension>
<path value="Observation.dataAbsentReason"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
</element>
<element id="Observation.bodySite">
<path value="Observation.bodySite" />
<condition value="au-core-obs-01"/>
<condition value="au-core-obs-02"/>
<constraint>
<key value="au-core-obs-01"/>
<key value="au-core-obs-02"/>
<severity value="error"/>
<human value="If a coded body site is provided, at least one code shall be from SNOMED CT"/>
<human value="If a coded body site is provided, at least one coding shall be from SNOMED CT"/>
<expression value="coding.exists() implies coding.where(system='http://snomed.info/sct').exists()"/>
<xpath value="not(exists(f:coding/f:system)) or exists(f:coding/f:system[@value='http://snomed.info/sct'])"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-bodytemp"/>
Expand Down
11 changes: 5 additions & 6 deletions input/resources/au-core-diagnosticresult-path.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<element id="Observation">
<path value="Observation"/>
<constraint>
<key value="au-core-obs-02"/>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="If there is no component or hasMember element then at least value or data absent reason shall be present"/>
<expression value="(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())"/>
Expand All @@ -44,7 +44,6 @@
</extension>
</extension>
<path value="Observation.status"/>
<short value="preliminary | final | amended +"/>
<mustSupport value="true"/>
</element>
<element id="Observation.category">
Expand Down Expand Up @@ -136,9 +135,9 @@
</extension>
<path value="Observation.effective[x]"/>
<short value="Time of specimen collection"/>
<condition value="au-core-obs-01"/>
<condition value="au-core-obs-02"/>
<constraint>
<key value="au-core-obs-01"/>
<key value="au-core-obs-02"/>
<severity value="error"/>
<human value="Date shall be at least to day or, if not available, the Data Absent Reason extension shall be present"/>
<expression value="(($this is dateTime implies $this.toString().length() >= 10) and extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').value.exists().not()) xor ($this is dateTime implies ($this.hasValue().not() and extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').value.exists()))"/>
Expand Down Expand Up @@ -193,7 +192,7 @@
</extension>
</extension>
<path value="Observation.value[x]"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
<mustSupport value="true"/>
</element>
<element id="Observation.dataAbsentReason">
Expand All @@ -214,7 +213,7 @@
</extension>
</extension>
<path value="Observation.dataAbsentReason"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
<mustSupport value="true"/>
</element>
<element id="Observation.interpretation">
Expand Down
13 changes: 6 additions & 7 deletions input/resources/au-core-diagnosticresult.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
<element id="Observation">
<path value="Observation"/>
<constraint>
<key value="au-core-obs-02"/>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="If there is no component or hasMember element then at least value or data absent reason shall be present"/>
<expression value="(component.empty() and hasMember.empty()) implies (dataAbsentReason.exists() or value.exists())"/>
Expand All @@ -44,7 +44,6 @@
</extension>
</extension>
<path value="Observation.status"/>
<short value="preliminary | final | amended +"/>
<mustSupport value="true"/>
</element>
<element id="Observation.category">
Expand Down Expand Up @@ -133,9 +132,9 @@
</extension>
<path value="Observation.effective[x]"/>
<min value="1"/>
<condition value="au-core-obs-01"/>
<condition value="au-core-obs-02"/>
<constraint>
<key value="au-core-obs-01"/>
<key value="au-core-obs-02"/>
<severity value="error"/>
<human value="Date shall be at least to day or, if not available, the Data Absent Reason extension shall be present"/>
<expression value="(($this is dateTime implies $this.toString().length() >= 10) and extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').value.exists().not()) xor ($this is dateTime implies ($this.hasValue().not() and extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').value.exists()))"/>
Expand Down Expand Up @@ -190,7 +189,7 @@
</extension>
</extension>
<path value="Observation.value[x]"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
<mustSupport value="true"/>
</element>
<element id="Observation.dataAbsentReason">
Expand All @@ -211,7 +210,7 @@
</extension>
</extension>
<path value="Observation.dataAbsentReason"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
<mustSupport value="true"/>
</element>
<element id="Observation.bodySite">
Expand All @@ -236,7 +235,7 @@
<constraint>
<key value="au-core-obs-04"/>
<severity value="error"/>
<human value="If a coded body site is provided, at least one code shall be from SNOMED CT"/>
<human value="If a coded body site is provided, at least one coding shall be from SNOMED CT"/>
<expression value="coding.exists() implies coding.where(system='http://snomed.info/sct').exists()"/>
<xpath value="not(exists(f:coding/f:system)) or exists(f:coding/f:system[@value='http://snomed.info/sct'])"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-diagnosticresult"/>
Expand Down
2 changes: 1 addition & 1 deletion input/resources/au-core-heartrate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,7 @@
<constraint>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="If a coded body site is provided, at least one code shall be from SNOMED CT"/>
<human value="If a coded body site is provided, at least one coding shall be from SNOMED CT"/>
<expression value="coding.exists() implies coding.where(system='http://snomed.info/sct').exists()"/>
<xpath value="not(exists(f:coding/f:system)) or exists(f:coding/f:system[@value='http://snomed.info/sct'])"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-heartrate"/>
Expand Down
2 changes: 0 additions & 2 deletions input/resources/au-core-location.xml
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
</element>
<element id="Location.identifier">
<path value="Location.identifier"/>
<short value="Unique code or number identifying the location to its users" />
<definition value="Unique code or number identifying the location to its users." />
<condition value="au-core-loc-01"/>
</element>
<element id="Location.name">
Expand Down
2 changes: 0 additions & 2 deletions input/resources/au-core-patient.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,6 @@
<path value="Patient.extension" />
<sliceName value="genderIdentity" />
<short value="Gender identity shall be a member of the Gender Identity Response value set if any codes within that value set can apply"/>
<comment value="Individual Gender identity [Gender Identity Response](https://healthterminologies.gov.au/fhir/ValueSet/gender-identity-response-1) ([Extensible](http://hl7.org/fhir/R4/terminologies.html#extensible)). See [Australian Bureau of Statics (ABS) Standard for Sex, Gender, Variations of Sex Characteristics and Sexual Orientation Variables, 2020](https://www.abs.gov.au/statistics/standards/standard-sex-gender-variations-sex-characteristics-and-sexual-orientation-variables/latest-release#gender) for further materials."/>
<mustSupport value="true"/>
</element>
<element id="Patient.extension:individualPronouns">
Expand All @@ -100,7 +99,6 @@
<path value="Patient.extension"/>
<sliceName value="individualPronouns"/>
<short value="Pronouns shall be a member of the Australian Pronouns value set if any codes within that value set can apply"/>
<comment value="Individual Pronouns [Australian Pronouns](https://healthterminologies.gov.au/fhir/ValueSet/australian-pronouns-1) ([Extensible](http://hl7.org/fhir/R4/terminologies.html#extensible))."/>
<mustSupport value="true"/>
</element>
<element id="Patient.identifier">
Expand Down
2 changes: 1 addition & 1 deletion input/resources/au-core-procedure.xml
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@
<constraint>
<key value="au-core-pro-01"/>
<severity value="error"/>
<human value="If a coded body site is provided, at least one code shall be from SNOMED CT"/>
<human value="If a coded body site is provided, at least one coding shall be from SNOMED CT"/>
<expression value="coding.exists() implies coding.where(system='http://snomed.info/sct').exists()"/>
<xpath value="not(exists(f:coding/f:system)) or exists(f:coding/f:system[@value='http://snomed.info/sct'])"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-procedure"/>
Expand Down
12 changes: 6 additions & 6 deletions input/resources/au-core-resprate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<definition value="Measurement of a patient's respiration rate at a point in time."/>
<comment value="Respiration rate observation using a LOINC code and a SNOMED CT code."/>
<constraint>
<key value="au-core-obs-02"/>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="At least value or data absent reason shall be present"/>
<expression value="dataAbsentReason.exists() or value.exists()"/>
Expand Down Expand Up @@ -250,7 +250,7 @@
</extension>
<path value="Observation.valueQuantity"/>
<short value="Respiration rate"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
</element>
<element id="Observation.valueQuantity.value">
<extension url="http://hl7.org/fhir/StructureDefinition/obligation">
Expand Down Expand Up @@ -346,15 +346,15 @@
</extension>
</extension>
<path value="Observation.dataAbsentReason"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
</element>
<element id="Observation.bodySite">
<path value="Observation.bodySite" />
<condition value="au-core-obs-01"/>
<condition value="au-core-obs-02"/>
<constraint>
<key value="au-core-obs-01"/>
<key value="au-core-obs-02"/>
<severity value="error"/>
<human value="If a coded body site is provided, at least one code shall be from SNOMED CT"/>
<human value="If a coded body site is provided, at least one coding shall be from SNOMED CT"/>
<expression value="coding.exists() implies coding.where(system='http://snomed.info/sct').exists()"/>
<xpath value="not(exists(f:coding/f:system)) or exists(f:coding/f:system[@value='http://snomed.info/sct'])"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-resprate"/>
Expand Down
16 changes: 8 additions & 8 deletions input/resources/au-core-smokingstatus.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<short value="Smoking status" />
<definition value="An observation of smoking status, i.e. current behaviour for all types of tobacco smoking, at a point in time." />
<constraint>
<key value="au-core-obs-02"/>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="At least value or data absent reason shall be present"/>
<expression value="dataAbsentReason.exists() or value.exists()"/>
Expand Down Expand Up @@ -193,13 +193,13 @@
<type>
<code value="dateTime" />
</type>
<condition value="au-core-obs-01"/>
<condition value="au-core-obs-02"/>
<constraint>
<key value="au-core-obs-01"/>
<key value="au-core-obs-02"/>
<severity value="error"/>
<human value="Date shall be at least to day"/>
<expression value="$this is DateTime implies $this.toString().length() &gt;= 8"/>
<xpath value="f:matches(effectiveDateTime,/\d{4}-[01]\d-[0-3]\dT[0-2]\d:[0-5]\d([+-][0-2]\d:[0-5]\d|Z)/)"/>
<human value="Date shall be at least to day or, if not available, the Data Absent Reason extension shall be present"/>
<expression value="(($this is dateTime implies $this.toString().length() >= 10) and extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').value.exists().not()) xor ($this is dateTime implies ($this.hasValue().not() and extension('http://hl7.org/fhir/StructureDefinition/data-absent-reason').value.exists()))"/>
<xpath value="((self::dateTime and string-length(.) >= 10 and not(extension[@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason'])) xor (self::dateTime and not(.) and extension[@url='http://hl7.org/fhir/StructureDefinition/data-absent-reason']))"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-smokingstatus"/>
</constraint>
<mustSupport value="true"/>
Expand All @@ -225,7 +225,7 @@
<type>
<code value="CodeableConcept" />
</type>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
<mustSupport value="true"/>
<binding>
<strength value="extensible" />
Expand All @@ -250,7 +250,7 @@
</extension>
</extension>
<path value="Observation.dataAbsentReason"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
<mustSupport value="true"/>
</element>
</differential>
Expand Down
12 changes: 6 additions & 6 deletions input/resources/au-core-waistcircum.xml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
<definition value="Measurement of a patient's waist circumference at a point in time."/>
<comment value="Waist circumference observation using a LOINC code, a SNOMED CT code and a metric UCUM unit of measure."/>
<constraint>
<key value="au-core-obs-02"/>
<key value="au-core-obs-01"/>
<severity value="error"/>
<human value="At least value or data absent reason shall be present"/>
<expression value="dataAbsentReason.exists() or value.exists()"/>
Expand Down Expand Up @@ -279,7 +279,7 @@
</extension>
<path value="Observation.valueQuantity"/>
<short value="Waist circumference"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
</element>
<element id="Observation.valueQuantity.value">
<path value="Observation.valueQuantity.value"/>
Expand Down Expand Up @@ -349,15 +349,15 @@
</extension>
</extension>
<path value="Observation.dataAbsentReason"/>
<condition value="au-core-obs-02"/>
<condition value="au-core-obs-01"/>
</element>
<element id="Observation.bodySite">
<path value="Observation.bodySite" />
<condition value="au-core-obs-01"/>
<condition value="au-core-obs-02"/>
<constraint>
<key value="au-core-obs-01"/>
<key value="au-core-obs-02"/>
<severity value="error"/>
<human value="If a coded body site is provided, at least one code shall be from SNOMED CT"/>
<human value="If a coded body site is provided, at least one coding shall be from SNOMED CT"/>
<expression value="coding.exists() implies coding.where(system='http://snomed.info/sct').exists()"/>
<xpath value="not(exists(f:coding/f:system)) or exists(f:coding/f:system[@value='http://snomed.info/sct'])"/>
<source value="http://hl7.org.au/fhir/core/StructureDefinition/au-core-waistcircum"/>
Expand Down

0 comments on commit 39f290c

Please sign in to comment.