Skip to content

Commit

Permalink
Refactor invariant + Xpath for section entry population
Browse files Browse the repository at this point in the history
  • Loading branch information
dtr-agency committed Jul 15, 2022
1 parent adcfe5d commit 27b1c43
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 18 deletions.
5 changes: 3 additions & 2 deletions resources/dh-composition-acts-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
<constraint>
<key value="inv-dh-acts-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-acts-1"/>
</constraint>
Expand Down
5 changes: 3 additions & 2 deletions resources/dh-composition-cocs-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@
<constraint>
<key value="inv-dh-cocs-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-cocs-1"/>
</constraint>
Expand Down
9 changes: 5 additions & 4 deletions resources/dh-composition-ds-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@
<constraint>
<key value="inv-dh-ds-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-ds-1"/>
</constraint>
Expand Down Expand Up @@ -197,7 +198,7 @@
<human
value="If a list is provided, no other entry shall be present"/>
<expression
value="entry.resolve().where($this is List).exists() implies entry.resolve().where($this is List).count() &lt; 2"/>
value="entry.resolve().where($this is List).exists() implies entry.count() &lt; 2"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-ds-1"/>
</constraint>
Expand Down Expand Up @@ -248,7 +249,7 @@
<human
value="If a list is provided, no other entry shall be present"/>
<expression
value="entry.resolve().where($this is List).exists() implies (entry.resolve().where($this is List).count() &lt; 2"/>
value="entry.resolve().where($this is List).exists() implies (entry.count() &lt; 2"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-ds-1"/>
</constraint>
Expand Down
5 changes: 3 additions & 2 deletions resources/dh-composition-es-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,9 @@
<constraint>
<key value="inv-dh-es-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-es-1"/>
</constraint>
Expand Down
5 changes: 3 additions & 2 deletions resources/dh-composition-pdl-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,9 @@
<constraint>
<key value="inv-dh-pdl-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-pdl-1"/>
</constraint>
Expand Down
5 changes: 3 additions & 2 deletions resources/dh-composition-phs-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,9 @@
<constraint>
<key value="inv-dh-phs-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-phs-1"/>
</constraint>
Expand Down
5 changes: 3 additions & 2 deletions resources/dh-composition-shs-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -103,8 +103,9 @@
<constraint>
<key value="inv-dh-shs-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-shs-1"/>
</constraint>
<constraint>
Expand Down
5 changes: 3 additions & 2 deletions resources/dh-composition-sml-1.xml
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@
<constraint>
<key value="inv-dh-sml-01"/>
<severity value="error"/>
<human value="A section shall at least have an entry or an empty reason, but not both"/>
<expression value="entry.exists() xor emptyReason.exists()"/>
<human value="A section shall at least have an entry or an empty reason"/>
<expression value="entry.exists() or emptyReason.exists()"/>
<xpath value="exists(f:emptyReason) or exists(f:entry)"/>
<source
value="http://ns.electronichealth.net.au/fhir/StructureDefinition/dh-composition-sml-1"/>
</constraint>
Expand Down

0 comments on commit 27b1c43

Please sign in to comment.