Skip to content

Commit

Permalink
Addition of XPath for SNOMED system + conditional reference population
Browse files Browse the repository at this point in the history
  • Loading branch information
dtr-agency committed Jul 14, 2022
1 parent ba56104 commit bcd4799
Show file tree
Hide file tree
Showing 28 changed files with 41 additions and 0 deletions.
1 change: 1 addition & 0 deletions resources/dh-allergyintolerance-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
value="If present, an asserter shall at least have a reference, an identifier or a display"/>
<expression
value="asserter.exists() implies asserter.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:asserter)) or exists(f:asserter/f:reference) or exists(f:asserter/f:identifier) or exists(f:asserter/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-allergyintolerance-core-1"
/>
Expand Down
2 changes: 2 additions & 0 deletions resources/dh-bodystructure-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<human value="If a coded body site is provided, at least one code 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://ns.electronichealth.net.au/fhir/StructureDefinition/dh-bodystructure-core-1"/>
</constraint>
Expand All @@ -74,6 +75,7 @@
<human value="If a coded location qualifier is provided, at least one code 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://ns.electronichealth.net.au/fhir/StructureDefinition/dh-bodystructure-core-1"/>
</constraint>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-composition-document-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
value="If present, an information recipient shall at least have a reference, an identifier or a display"/>
<expression
value="informationRecipient.exists() implies informationRecipient.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:informationRecipient)) or exists(f:informationRecipient/f:reference) or exists(f:informationRecipient/f:identifier) or exists(f:informationRecipient/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-document-1"
/>
Expand Down
2 changes: 2 additions & 0 deletions resources/dh-condition-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<severity value="error"/>
<human value="If present, an asserter shall at least have a reference, an identifier or a display"/>
<expression value="asserter.exists() implies asserter.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:asserter)) or exists(f:asserter/f:reference) or exists(f:asserter/f:identifier) or exists(f:asserter/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-condition-core-1"/>
</constraint>
<constraint>
Expand Down Expand Up @@ -81,6 +82,7 @@
<severity value="error"/>
<human value="If a coded body site is provided, at least one code 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://ns.electronichealth.net.au/fhir/StructureDefinition/dh-condition-core-1"/>
</constraint>
<mustSupport value="true"/>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-consent-aodr-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,7 @@
<severity value="error"/>
<human value="Specific provisions shall be specified if the individual is willing to donate, otherwise prohibited"/>
<expression value="provision.exists() xor (type='deny')"/>
<xpath value="not(f:provision) or exists(f:type/@value = 'deny')"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-consent-aodr-1"/>
</constraint>
<mustSupport value="true"/>
Expand Down
2 changes: 2 additions & 0 deletions resources/dh-device-participant-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,15 @@
<severity value="error"/>
<human value="If present, an owner shall at least have a reference or display or a valid identifier"/>
<expression value="owner.exists() implies owner.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:owner)) or exists(f:owner/f:reference) or exists(f:owner/f:identifier) or exists(f:owner/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-device-participant-1" />
</constraint>
<constraint>
<key value="inv-dh-dev-02"/>
<severity value="error"/>
<human value="If present, a location shall at least have a reference or display or a valid identifier"/>
<expression value="location.exists() implies location.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:location)) or exists(f:location/f:reference) or exists(f:location/f:identifier) or exists(f:location/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-device-participant-1" />
</constraint>
</element>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-documentreference-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
value="If present, a custodian shall at least have a reference or a valid identifier"/>
<expression
value="custodian.exists() implies custodian.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:custodian)) or exists(f:custodian/f:reference) or exists(f:custodian/f:identifier) or exists(f:custodian/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-documentreference-core-1"
/>
Expand Down
3 changes: 3 additions & 0 deletions resources/dh-encounter-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<severity value="error"/>
<human value="If present, the service provider shall at least have a reference or display or a valid identifier"/>
<expression value="serviceProvider.exists() implies serviceProvider.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:serviceProvider)) or exists(f:serviceProvider/f:reference) or exists(f:serviceProvider/f:identifier) or exists(f:serviceProvider/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-encounter-core-1"/>
</constraint>
</element>
Expand Down Expand Up @@ -91,6 +92,7 @@
<severity value="error"/>
<human value="If present, an individual shall at least have a reference, an identifier or a display"/>
<expression value="individual.exists() implies individual.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:individual)) or exists(f:individual/f:reference) or exists(f:individual/f:identifier) or exists(f:individual/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-encounter-core-1"/>
</constraint>
<mustSupport value="true"/>
Expand Down Expand Up @@ -149,6 +151,7 @@
<severity value="error"/>
<human value="If present, location shall at least have a reference or display or a valid identifier"/>
<expression value="location.exists() implies location.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:location)) or exists(f:location/f:reference) or exists(f:location/f:identifier) or exists(f:location/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-encounter-core-1"/>
</constraint>
<mustSupport value="true"/>
Expand Down
2 changes: 2 additions & 0 deletions resources/dh-healthcareservice-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
value="If present, the organization providing the service shall at least have a reference, an identifier or a display"/>
<expression
value="providedBy.exists() implies providedBy.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:providedBy)) or exists(f:providedBy/f:reference) or exists(f:providedBy/f:identifier) or exists(f:providedBy/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-healthcareservice-core-1"
/>
Expand All @@ -47,6 +48,7 @@
value="If present, a location shall at least have a reference, an identifier or a display"/>
<expression
value="location.exists() implies location.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:location)) or exists(f:location/f:reference) or exists(f:location/f:identifier) or exists(f:location/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-healthcareservice-core-1"
/>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-list-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
value="If present, a source shall at least have a reference or a valid identifier"/>
<expression
value="source.exists() implies source.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:source)) or exists(f:source/f:reference) or exists(f:source/f:identifier) or exists(f:source/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-list-core-1"/>
</constraint>
<constraint>
Expand Down
2 changes: 2 additions & 0 deletions resources/dh-location-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,15 @@
<severity value="error" />
<human value="If present, the managing organization shall at least have a reference, an identifier or a display" />
<expression value="managingOrganization.exists() implies managingOrganization.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())" />
<xpath value="not(exists(f:managingOrganization)) or exists(f:managingOrganization/f:reference) or exists(f:managingOrganization/f:identifier) or exists(f:managingOrganization/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-location-core-1" />
</constraint>
<constraint>
<key value="inv-dh-loc-03" />
<severity value="error" />
<human value="If present, a location this location is a part of shall at least have a reference, an identifier or a display" />
<expression value="partOf.exists() implies partOf.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())" />
<xpath value="not(exists(f:partOf)) or exists(f:partOf/f:reference) or exists(f:partOf/f:identifier) or exists(f:partOf/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-location-core-1" />
</constraint>
</element>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-media-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<severity value="error"/>
<human value="If present, an operator shall at least have a reference, an identifier or a display"/>
<expression value="operator.exists() implies operator.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:operator)) or exists(f:operator/f:reference) or exists(f:operator/f:identifier) or exists(f:operator/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-media-core-1"/>
</constraint>
</element>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-medication-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
value="If present, a manufacturer shall at least have a reference, an identifier or a display"/>
<expression
value="manufacturer.exists() implies manufacturer.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:manufacturer)) or exists(f:manufacturer/f:reference) or exists(f:manufacturer/f:identifier) or exists(f:manufacturer/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-medication-core-1"/>
</constraint>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-medicationadministration-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@
value="If present, an actor shall at least have a reference, an identifier or a display"/>
<expression
value="actor.exists() implies actor.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:actor)) or exists(f:actor/f:reference) or exists(f:actor/f:identifier) or exists(f:actor/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-medicationadministration-core-1"
/>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-medicationdispense-disp-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
<severity value="error"/>
<human value="If present, the authorising prescription shall at least have a reference or a valid identifier"/>
<expression value="authorizingPrescription.exists() implies authorizingPrescription.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:authorizingPrescription)) or exists(f:authorizingPrescription/f:reference) or exists(f:authorizingPrescription/f:identifier) or exists(f:authorizingPrescription/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-medicationdispense-disp-1"/>
</constraint>
</element>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-medicationrequest-pres-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
<severity value="error"/>
<human value="If present, the prescription this is based on shall at least have a reference or a valid identifier"/>
<expression value="basedOn.exists() implies basedOn.all($this.reference.exists() or $this.display.exists() or $this.identifier.where(system.count() + value.count() &gt;1).exists())"/>
<xpath value="not(exists(f:basedOn)) or exists(f:basedOn/f:reference) or exists(f:basedOn/f:identifier) or exists(f:basedOn/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-medicationrequest-pres-1"/>
</constraint>
</element>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-medicationstatement-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
value="If present, an information source shall at least have a reference, an identifier or a display"/>
<expression
value="informationSource.exists() implies informationSource.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:informationSource)) or exists(f:informationSource/f:reference) or exists(f:informationSource/f:identifier) or exists(f:informationSource/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-medicationstatement-core-1"
/>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-observation-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@
<severity value="error"/>
<human value="If a coded body site is provided, at least one code 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://ns.electronichealth.net.au/fhir/StructureDefinition/dh-observation-core-1"/>
</constraint>
<mustSupport value="true"/>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-observation-diagnosticresult-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<severity value="error"/>
<human value="If a coded body site is provided, at least one code 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://ns.electronichealth.net.au/fhir/StructureDefinition/dh-observation-diagnosticresult-1"/>
</constraint>
<mustSupport value="true"/>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-observation-diagnosticresult-imag-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,7 @@
<severity value="error"/>
<human value="If a coded body site is provided, at least one code 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://ns.electronichealth.net.au/fhir/StructureDefinition/dh-observation-diagnosticresult-imag-1"/>
</constraint>
<mustSupport value="true"/>
Expand Down
1 change: 1 addition & 0 deletions resources/dh-organization-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
value="If present, the organization of which this organization forms a part shall at least have a reference, an identifier or a display"/>
<expression
value="partOf.exists() implies (partOf.reference.exists() or partOf.identifier.exists() or partOf.display.exists())"/>
<xpath value="not(exists(f:partOf)) or exists(f:partOf/f:reference) or exists(f:partOf/f:identifier) or exists(f:partOf/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-organization-core-1"
/>
Expand Down
2 changes: 2 additions & 0 deletions resources/dh-patient-core-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
<severity value="error"/>
<human value="At least one patient identifier shall be valid"/>
<expression value="identifier.where(system.count() + value.count() &gt;1).exists()"/>
<xpath value="exists(f:identifier/f:system)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-patient-core-1"
/>
</constraint>
Expand All @@ -53,6 +54,7 @@
value="If present, a general practitioner shall at least have a reference, an identifier or a display"/>
<expression
value="generalPractitioner.exists() implies generalPractitioner.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:generalPractitioner)) or exists(f:generalPractitioner/f:reference) or exists(f:generalPractitioner/f:identifier) or exists(f:generalPractitioner/f:display)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-patient-core-1"
/>
</constraint>
Expand Down
2 changes: 2 additions & 0 deletions resources/dh-patient-demographics-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@
value="If present, a general practitioner shall at least have a reference, an identifier or a display"/>
<expression
value="generalPractitioner.exists() implies generalPractitioner.all($this.reference.exists() or $this.identifier.exists() or $this.display.exists())"/>
<xpath value="not(exists(f:generalPractitioner)) or exists(f:generalPractitioner/f:reference) or exists(f:generalPractitioner/f:identifier) or exists(f:generalPractitioner/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-patient-demographics-1"
/>
Expand Down Expand Up @@ -154,6 +155,7 @@
value="If present, a contact's organisation shall at least have a reference, an identifier or a display"/>
<expression
value="organization.exists() implies (organization.reference.exists() or organization.identifier.exists() or organization.display.exists())"/>
<xpath value="not(exists(f:organization)) or exists(f:organization/f:reference) or exists(f:organization/f:identifier) or exists(f:organization/f:display)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-patient-demographics-1"
/>
Expand Down
Loading

0 comments on commit bcd4799

Please sign in to comment.