-
Notifications
You must be signed in to change notification settings - Fork 190
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add test cases for general slice validation against the observation-bp
profile. PiperOrigin-RevId: 555635339
- Loading branch information
1 parent
1dde339
commit b77b848
Showing
6 changed files
with
264 additions
and
3 deletions.
There are no files selected for viewing
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
56 changes: 56 additions & 0 deletions
56
testdata/r4/validation/observation_bp_invalid_codes.outcome.prototxt
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,56 @@ | ||
issue { | ||
severity { | ||
value: ERROR | ||
} | ||
code { | ||
value: VALUE | ||
} | ||
diagnostics { | ||
value: "Constraint from slice Observation.category:VSCat not met. The slice implies the following constraint: category.where(coding.system = 'http://terminology.hl7.org/CodeSystem/observation-category' and coding.code = 'vital-signs').count() = 1" | ||
} | ||
expression { | ||
value: "Observation.category:VSCat" | ||
} | ||
} | ||
issue { | ||
severity { | ||
value: ERROR | ||
} | ||
code { | ||
value: VALUE | ||
} | ||
diagnostics { | ||
value: "Constraint from slice Observation.code.coding:BPCode not met. The slice implies the following constraint: coding.where(system = 'http://loinc.org' and code = '85354-9').count() = 1" | ||
} | ||
expression { | ||
value: "Observation.code.coding:BPCode" | ||
} | ||
} | ||
issue { | ||
severity { | ||
value: ERROR | ||
} | ||
code { | ||
value: VALUE | ||
} | ||
diagnostics { | ||
value: "Constraint from slice Observation.component:SystolicBP not met. The slice implies the following constraint: component.where(code.coding.system = 'http://loinc.org' and code.coding.code = '8480-6' and value.system = 'http://unitsofmeasure.org' and value.code = 'mm[Hg]').count() = 1" | ||
} | ||
expression { | ||
value: "Observation.component:SystolicBP" | ||
} | ||
} | ||
issue { | ||
severity { | ||
value: ERROR | ||
} | ||
code { | ||
value: VALUE | ||
} | ||
diagnostics { | ||
value: "Constraint from slice Observation.component:DiastolicBP not met. The slice implies the following constraint: component.where(code.coding.system = 'http://loinc.org' and code.coding.code = '8462-4' and value.system = 'http://unitsofmeasure.org' and value.code = 'mm[Hg]').count() = 1" | ||
} | ||
expression { | ||
value: "Observation.component:DiastolicBP" | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
testdata/r4/validation/observation_bp_invalid_codes.prototxt
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,59 @@ | ||
id { value: "123" } | ||
status { value: FINAL } | ||
# wrong vital signs code | ||
category { | ||
coding { | ||
system { value: "http://terminology.hl7.org/CodeSystem/observation-category" } | ||
code { value: "non-vital-signs" } | ||
} | ||
} | ||
# wrong blood pressure code | ||
code { | ||
coding { | ||
system { value: "http://loinc.org" } | ||
code { value: "blood-no-pressure" } | ||
} | ||
} | ||
# wrong systolic code | ||
component { | ||
code { | ||
coding { | ||
system { value: "http://loinc.org" } | ||
code { value: "wrong-code" } | ||
} | ||
} | ||
value { | ||
quantity { | ||
system { value: "http://unitsofmeasure.org" } | ||
code { value: "mm[Hg]" } | ||
value { value: "100" } | ||
} | ||
} | ||
} | ||
# wrong diastolic code | ||
component { | ||
code { | ||
coding { | ||
system { value: "http://loinc.org" } | ||
code { value: "another-wrong-code" } | ||
} | ||
} | ||
value { | ||
quantity { | ||
system { value: "http://unitsofmeasure.org" } | ||
code { value: "mm[Hg]" } | ||
value { value: "70" } | ||
} | ||
} | ||
} | ||
effective { | ||
date_time { | ||
value_us: 0 | ||
timezone: "UTC" | ||
precision: DAY | ||
} | ||
} | ||
subject { | ||
type { value: "http://a-person.com" } | ||
uri { value: "http://person-id.com" } | ||
} |
28 changes: 28 additions & 0 deletions
28
testdata/r4/validation/observation_bp_invalid_systems.outcome.prototxt
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,28 @@ | ||
issue { | ||
severity { | ||
value: ERROR | ||
} | ||
code { | ||
value: VALUE | ||
} | ||
diagnostics { | ||
value: "Constraint from slice Observation.code.coding:BPCode not met. The slice implies the following constraint: coding.where(system = 'http://loinc.org' and code = '85354-9').count() = 1" | ||
} | ||
expression { | ||
value: "Observation.code.coding:BPCode" | ||
} | ||
} | ||
issue { | ||
severity { | ||
value: ERROR | ||
} | ||
code { | ||
value: VALUE | ||
} | ||
diagnostics { | ||
value: "Constraint from slice Observation.component:SystolicBP not met. The slice implies the following constraint: component.where(code.coding.system = 'http://loinc.org' and code.coding.code = '8480-6' and value.system = 'http://unitsofmeasure.org' and value.code = 'mm[Hg]').count() = 1" | ||
} | ||
expression { | ||
value: "Observation.component:SystolicBP" | ||
} | ||
} |
59 changes: 59 additions & 0 deletions
59
testdata/r4/validation/observation_bp_invalid_systems.prototxt
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,59 @@ | ||
id { value: "123" } | ||
status { value: FINAL } | ||
# category = vital-signs | ||
category { | ||
coding { | ||
system { value: "http://terminology.hl7.org/CodeSystem/observation-category" } | ||
code { value: "vital-signs" } | ||
} | ||
} | ||
# wrong blood pressure system | ||
code { | ||
coding { | ||
system { value: "http://oink-oink.org" } | ||
code { value: "85354-9" } | ||
} | ||
} | ||
# wrong systolic system | ||
component { | ||
code { | ||
coding { | ||
system { value: "http://oink-oink.org" } | ||
code { value: "8480-6" } | ||
} | ||
} | ||
value { | ||
quantity { | ||
system { value: "http://unitsofmeasure.org" } | ||
code { value: "mm[Hg]" } | ||
value { value: "100" } | ||
} | ||
} | ||
} | ||
# diastolic | ||
component { | ||
code { | ||
coding { | ||
system { value: "http://loinc.org" } | ||
code { value: "8462-4" } | ||
} | ||
} | ||
value { | ||
quantity { | ||
system { value: "http://unitsofmeasure.org" } | ||
code { value: "mm[Hg]" } | ||
value { value: "70" } | ||
} | ||
} | ||
} | ||
effective { | ||
date_time { | ||
value_us: 0 | ||
timezone: "UTC" | ||
precision: DAY | ||
} | ||
} | ||
subject { | ||
type { value: "http://a-person.com" } | ||
uri { value: "http://person-id.com" } | ||
} |
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,59 @@ | ||
id { value: "123" } | ||
status { value: FINAL } | ||
# category = vital-signs | ||
category { | ||
coding { | ||
system { value: "http://terminology.hl7.org/CodeSystem/observation-category" } | ||
code { value: "vital-signs" } | ||
} | ||
} | ||
# code = blood pressure panel | ||
code { | ||
coding { | ||
system { value: "http://loinc.org" } | ||
code { value: "85354-9" } | ||
} | ||
} | ||
# systolic | ||
component { | ||
code { | ||
coding { | ||
system { value: "http://loinc.org" } | ||
code { value: "8480-6" } | ||
} | ||
} | ||
value { | ||
quantity { | ||
system { value: "http://unitsofmeasure.org" } | ||
code { value: "mm[Hg]" } | ||
value { value: "100" } | ||
} | ||
} | ||
} | ||
# diastolic | ||
component { | ||
code { | ||
coding { | ||
system { value: "http://loinc.org" } | ||
code { value: "8462-4" } | ||
} | ||
} | ||
value { | ||
quantity { | ||
system { value: "http://unitsofmeasure.org" } | ||
code { value: "mm[Hg]" } | ||
value { value: "70" } | ||
} | ||
} | ||
} | ||
effective { | ||
date_time { | ||
value_us: 0 | ||
timezone: "UTC" | ||
precision: DAY | ||
} | ||
} | ||
subject { | ||
type { value: "http://a-person.com" } | ||
uri { value: "http://person-id.com" } | ||
} |