Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add dosage sequence constraints #263
- Loading branch information
Showing
9 changed files
with
53 additions
and
16 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
// Base - Dosage.sequence | ||
Invariant: ch-dosage-1 | ||
Description: "No sequence number (for one dosage element) or sequence number = 1 (for more than one dosage element)" | ||
Severity: #error | ||
Expression: "$this.count() = 0 or $this = 1" | ||
|
||
// Split - Dosage.sequence | ||
Invariant: ch-dosage-2 | ||
Description: "The sequence number must be greater than 1" | ||
Severity: #error | ||
Expression: "$this > 1" | ||
|
||
// MedicationRequest | ||
Invariant: ch-dosage-3 | ||
Description: "Patient instruction/free text dosage instruction, timing or as needed has to be specified" | ||
Severity: #error | ||
Expression: "patientInstruction.exists() or timing.exists() or asNeeded.exists()" | ||
|
||
// Dosage | ||
Invariant: ch-dosage-4 | ||
Description: "For split dosage timing event and dose/rate are required" | ||
Severity: #error | ||
Expression: "sequence.exists() implies (timing.repeat.when.exists() and doseAndRate.dose.exists())" | ||
|
||
// MedicationStatement | ||
Invariant: ch-dosage-medstat | ||
Description: "If one dosage element is present, it should not have a sequence number. | ||
If more than one dosage element is present, the base entry has the sequence number 1." | ||
Severity: #error | ||
Expression: "(dosage.count() > 1 implies dosage.where($this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage') and sequence = 1).exists()) | ||
and (dosage.count() = 1 implies dosage.single().sequence.exists().not())" | ||
|
||
// MedicationDispense | ||
Invariant: ch-dosage-meddis | ||
Description: "If one dosage element is present, it should not have a sequence number. | ||
If more than one dosage element is present, the base entry has the sequence number 1." | ||
Severity: #error | ||
Expression: "(dosageInstruction.count() > 1 implies dosageInstruction.where($this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage') and sequence = 1).exists()) | ||
and (dosageInstruction.count() = 1 implies dosageInstruction.single().sequence.exists().not())" | ||
|
||
// MedicationRequest | ||
Invariant: ch-dosage-medreq | ||
Description: "If one dosage element is present, it should not have a sequence number. | ||
If more than one dosage element is present, the base entry has the sequence number 1." | ||
Severity: #error | ||
Expression: "(dosageInstruction.count() > 1 implies dosageInstruction.where($this.conformsTo('http://fhir.ch/ig/ch-emed/StructureDefinition/ch-emed-dosage-medicationrequest') and sequence = 1).exists()) | ||
and (dosageInstruction.count() = 1 implies dosageInstruction.single().sequence.exists().not())" | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters