From da25906b0f1b3e7c35cdcfe21d251848ae9a471d Mon Sep 17 00:00:00 2001 From: Rob Hausam Date: Wed, 31 Jul 2024 07:28:53 -0500 Subject: [PATCH] FHIR-41554 - Adopt the invariants from the Lab Report IG (EU and UV) profiles). --- input/fsh/invariants/ips-2.fsh | 6 +++--- input/fsh/invariants/ips-3.fsh | 4 ++++ .../profiles/ObservationResultsLaboratoryPathologyUvIps.fsh | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) create mode 100644 input/fsh/invariants/ips-3.fsh diff --git a/input/fsh/invariants/ips-2.fsh b/input/fsh/invariants/ips-2.fsh index 396dc1df..41db9603 100644 --- a/input/fsh/invariants/ips-2.fsh +++ b/input/fsh/invariants/ips-2.fsh @@ -1,4 +1,4 @@ Invariant: ips-2 -Description: "if no \"hasMember\" element is present then Observation must have a\" value\"" -* severity = #error -* expression = "value.exists() or hasMember.exists()" \ No newline at end of file +Description: "If observation status is other then \"registered\" or \"cancelled\", at least one of these Observation elements shall be provided: \"value\", \"dataAbsentReason\", \"hasMember\" or \"component\"" +Severity: #error +Expression: "(status in ('registered'|'cancelled')) or value.exists() or hasMember.exists() or component.exists() or dataAbsentReason.exists()" diff --git a/input/fsh/invariants/ips-3.fsh b/input/fsh/invariants/ips-3.fsh new file mode 100644 index 00000000..b4ba6a58 --- /dev/null +++ b/input/fsh/invariants/ips-3.fsh @@ -0,0 +1,4 @@ +Invariant: ips-3 +Description: "If observation has components and observation status is other than \"registered\" or \"cancelled\", at least one of these Observation.component elements shall be provided: \"value\" or \"dataAbsentReason\"" +Severity: #error +Expression: "component.exists() implies (status in ('registered'|'cancelled')) or component.value.exists() or component.dataAbsentReason.exists()" diff --git a/input/fsh/profiles/ObservationResultsLaboratoryPathologyUvIps.fsh b/input/fsh/profiles/ObservationResultsLaboratoryPathologyUvIps.fsh index f0d35203..a615a8a9 100644 --- a/input/fsh/profiles/ObservationResultsLaboratoryPathologyUvIps.fsh +++ b/input/fsh/profiles/ObservationResultsLaboratoryPathologyUvIps.fsh @@ -16,7 +16,7 @@ This observation may represent the result of a simple laboratory test such as he * . ^short = "Laboratory (including Pathology) result for a simple test or for a panel/study" * . ^definition = "This observation may represent the result of a simple laboratory or pathology test such as hematocrit, or it may group the set of results produced by a multi-test study or panel such as a complete blood count, a dynamic function test, or a urine specimen study. In the latter case, the observation carries the overall conclusion of the study and references the atomic results of the study as \"has-member\" child observations" * . ^comment = "Represents either a lab simple observation or the group of observations produced by a laboratory study." -* obeys ips-2 +* obeys ips-2 and ips-3 * status = #final (exactly) * status ^extension[0].url = "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint" * status ^extension[=].valueString = "default: final"