Skip to content

Commit e028899

Browse files
committed
update validator suite
1 parent 11f9adb commit e028899

File tree

5 files changed

+181
-179
lines changed

5 files changed

+181
-179
lines changed

dev_suites/dev_validator_suite/validator_suite.rb

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,23 @@ class ValidatorSuite < Inferno::TestSuite
5959
assert_valid_resource
6060
end
6161
end
62+
63+
test do
64+
title 'Validate Patient from File'
65+
id :patient_validate_from_file_test
66+
67+
input :patient_json,
68+
title: 'Patient Resource JSON',
69+
description: 'JSON content of a US Core 6.1.0 Patient resource.',
70+
type: 'textarea'
71+
72+
run do
73+
assert_valid_json(patient_json)
74+
patient = FHIR.from_contents(patient_json)
75+
assert_resource_type(:patient, resource: patient)
76+
assert_valid_resource(resource: patient, profile_url: 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient')
77+
end
78+
end
6279
end
6380

6481
group do

execution_scripts/validator/coverage_json_input.json

Lines changed: 0 additions & 175 deletions
This file was deleted.
Lines changed: 160 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,160 @@
1+
{
2+
"resourceType" : "Patient",
3+
"id" : "example",
4+
"meta" : {
5+
"profile" : ["http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient"]
6+
},
7+
"text" : {
8+
"status" : "generated",
9+
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p style=\"border: 1px #661aff solid; background-color: #e6e6ff; padding: 10px;\"><b>Amy V. Baxter </b> female, DoB: 1987-02-20 ( Medical Record Number:\u00a01032702\u00a0(use:\u00a0USUAL))</p><hr/><table class=\"grid\"><tr><td style=\"background-color: #f3f5da\" title=\"Record is active\">Active:</td><td colspan=\"3\">true</td></tr><tr><td style=\"background-color: #f3f5da\" title=\"Alternate names (see the one above)\">Alt. Name:</td><td colspan=\"3\">Amy V. Shaw (OLD)</td></tr><tr><td style=\"background-color: #f3f5da\" title=\"Ways to contact the Patient\">Contact Details:</td><td colspan=\"3\"><ul><li>ph: 555-555-5555(HOME)</li><li><a href=\"mailto:amy.shaw@example.com\">amy.shaw@example.com</a></li><li>49 Meadow St Mounds OK 74047 US (OLD)</li><li>183 Mountain View St Mounds OK 74048 US </li></ul></td></tr><tr><td style=\"background-color: #f3f5da\" title=\"The Sex Extension is used to reflect the documentation of a person's sex. Systems choosing to record sources of information should use the [Provenance resource](basic-provenance.html#element-level-provenance).\n \nUSCDI v3 includes a data element for sex, intended to support the exchange of a sex value that is not characterized as sex assigned at birth or birth sex. This Sex extension supports USCDI v3. Sex assigned at birth or birth sex can be recorded using the more specific [US Core Birth Sex Extension](http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex).\nFuture versions of this extension may be informed by the content of the HL7 Cross Paradigm IG: Gender Harmony - Sex and Gender Representation, which may include additional guidance on its relationship to administrative gender ([Patient.gender](StructureDefinition-us-core-patient-definitions.html#Patient.gender)).\"><a href=\"StructureDefinition-us-core-sex.html\">US Core Sex Extension:</a></td><td colspan=\"3\"><ul><li>248152002</li></ul></td></tr><tr><td style=\"background-color: #f3f5da\" title=\"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The ethnicity codes used to represent these concepts are based upon the [CDC ethnicity and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html) which includes over 900 concepts for representing race and ethnicity of which 43 reference ethnicity. The ethnicity concepts are grouped by and pre-mapped to the 2 OMB ethnicity categories: - Hispanic or Latino - Not Hispanic or Latino.\">US Core Ethnicity Extension:</td><td colspan=\"3\"><ul><li>ombCategory: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-2135-2\">CDC Race and Ethnicity</a> 2135-2: Hispanic or Latino</li><li>detailed: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-2184-0\">CDC Race and Ethnicity</a> 2184-0: Dominican</li><li>detailed: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-2148-5\">CDC Race and Ethnicity</a> 2148-5: Mexican</li><li>text: Hispanic or Latino</li></ul></td></tr><tr><td style=\"background-color: #f3f5da\" title=\"A code classifying the person's sex assigned at birth as specified by the [Office of the National Coordinator for Health IT (ONC)](https://www.healthit.gov/newsroom/about-onc). This extension aligns with the C-CDA Birth Sex Observation (LOINC 76689-9). After version 6.0.0, this extension is no longer a *USCDI Requirement*.\"><a href=\"StructureDefinition-us-core-birthsex.html\">US Core Birth Sex Extension:</a></td><td colspan=\"3\"><ul><li>F</li></ul></td></tr><tr><td style=\"background-color: #f3f5da\" title=\"Concepts classifying the person into a named category of humans sharing common history, traits, geographical origin or nationality. The race codes used to represent these concepts are based upon the [CDC Race and Ethnicity Code Set Version 1.0](http://www.cdc.gov/phin/resources/vocabulary/index.html#3) which includes over 900 concepts for representing race and ethnicity of which 921 reference race. The race concepts are grouped by and pre-mapped to the 5 OMB race categories:\n\n - American Indian or Alaska Native\n - Asian\n - Black or African American\n - Native Hawaiian or Other Pacific Islander\n - White.\">US Core Race Extension:</td><td colspan=\"3\"><ul><li>ombCategory: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-2106-3\">CDC Race and Ethnicity</a> 2106-3: White</li><li>ombCategory: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-1002-5\">CDC Race and Ethnicity</a> 1002-5: American Indian or Alaska Native</li><li>ombCategory: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-2028-9\">CDC Race and Ethnicity</a> 2028-9: Asian</li><li>detailed: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-1586-7\">CDC Race and Ethnicity</a> 1586-7: Shoshone</li><li>detailed: <a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-CDCREC.html#CDCREC-2036-2\">CDC Race and Ethnicity</a> 2036-2: Filipino</li><li>text: Mixed</li></ul></td></tr><tr><td style=\"background-color: #f3f5da\" title=\"This Extension profile represents a tribe or band with which a person associates and, optionally, whether they are enrolled.\">US Core Tribal Affiliation Extension:</td><td colspan=\"3\"><ul><li>tribalAffiliation: <span title=\"Codes: {http://terminology.hl7.org/CodeSystem/v3-TribalEntityUS 187}\">Shoshone</span></li><li>isEnrolled: false</li></ul></td></tr><tr><td style=\"background-color: #f3f5da\" title=\"This extension represents an individual's sense of being a man, woman, boy, girl, nonbinary, or something else, ascertained by asking them what that identity is. Systems requiring multiple gender identities and associated dates **SHOULD** use the FHIR R5 [genderIdentity extension](http://hl7.org/fhir/extensions/StructureDefinition-individual-genderIdentity.html). When future versions of US Core are based on FHIR R5, the FHIR R5 extension will supersede this extension.\"><a href=\"StructureDefinition-us-core-genderIdentity.html\">US Core Gender Identity Extension:</a></td><td colspan=\"3\"><ul><li><span title=\"Codes: {http://terminology.hl7.org/CodeSystem/v3-NullFlavor UNK}\">Unknown</span></li></ul></td></tr></table></div>"
10+
},
11+
"extension" : [{
12+
"extension" : [{
13+
"url" : "ombCategory",
14+
"valueCoding" : {
15+
"system" : "urn:oid:2.16.840.1.113883.6.238",
16+
"code" : "2106-3",
17+
"display" : "White"
18+
}
19+
},
20+
{
21+
"url" : "ombCategory",
22+
"valueCoding" : {
23+
"system" : "urn:oid:2.16.840.1.113883.6.238",
24+
"code" : "1002-5",
25+
"display" : "American Indian or Alaska Native"
26+
}
27+
},
28+
{
29+
"url" : "ombCategory",
30+
"valueCoding" : {
31+
"system" : "urn:oid:2.16.840.1.113883.6.238",
32+
"code" : "2028-9",
33+
"display" : "Asian"
34+
}
35+
},
36+
{
37+
"url" : "text",
38+
"valueString" : "Mixed"
39+
}],
40+
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race"
41+
},
42+
{
43+
"extension" : [{
44+
"url" : "ombCategory",
45+
"valueCoding" : {
46+
"system" : "urn:oid:2.16.840.1.113883.6.238",
47+
"code" : "2135-2",
48+
"display" : "Hispanic or Latino"
49+
}
50+
},
51+
{
52+
"url" : "text",
53+
"valueString" : "Hispanic or Latino"
54+
}],
55+
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"
56+
},
57+
{
58+
"extension" : [{
59+
"url" : "tribalAffiliation",
60+
"valueCodeableConcept" : {
61+
"coding" : [{
62+
"system" : "http://terminology.hl7.org/CodeSystem/v3-TribalEntityUS",
63+
"code" : "187",
64+
"display" : "Paiute-Shoshone Tribe of the Fallon Reservation and Colony, Nevada"
65+
}],
66+
"text" : "Shoshone"
67+
}
68+
},
69+
{
70+
"url" : "isEnrolled",
71+
"valueBoolean" : false
72+
}],
73+
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-tribal-affiliation"
74+
},
75+
{
76+
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex",
77+
"valueCode" : "F"
78+
},
79+
{
80+
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-sex",
81+
"valueCode" : "248152002"
82+
},
83+
{
84+
"url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity",
85+
"valueCodeableConcept" : {
86+
"coding" : [{
87+
"system" : "http://terminology.hl7.org/CodeSystem/v3-NullFlavor",
88+
"code" : "UNK",
89+
"display" : "Unknown"
90+
}],
91+
"text" : "Unknown"
92+
}
93+
}],
94+
"identifier" : [{
95+
"use" : "usual",
96+
"type" : {
97+
"coding" : [{
98+
"system" : "http://terminology.hl7.org/CodeSystem/v2-0203",
99+
"code" : "MR",
100+
"display" : "Medical Record Number"
101+
}],
102+
"text" : "Medical Record Number"
103+
},
104+
"system" : "http://hospital.smarthealthit.org",
105+
"value" : "1032702"
106+
}],
107+
"active" : true,
108+
"name" : [{
109+
"use" : "old",
110+
"family" : "Shaw",
111+
"given" : ["Amy",
112+
"V."],
113+
"period" : {
114+
"start" : "2016-12-06",
115+
"end" : "2020-07-22"
116+
}
117+
},
118+
{
119+
"family" : "Baxter",
120+
"given" : ["Amy",
121+
"V."],
122+
"suffix" : ["PharmD"],
123+
"period" : {
124+
"start" : "2020-07-22"
125+
}
126+
}],
127+
"telecom" : [{
128+
"system" : "phone",
129+
"value" : "555-555-5555",
130+
"use" : "home"
131+
},
132+
{
133+
"system" : "email",
134+
"value" : "amy.shaw@example.com"
135+
}],
136+
"gender" : "female",
137+
"birthDate" : "1987-02-20",
138+
"address" : [{
139+
"use" : "old",
140+
"line" : ["49 Meadow St"],
141+
"city" : "Mounds",
142+
"state" : "OK",
143+
"postalCode" : "74047",
144+
"country" : "US",
145+
"period" : {
146+
"start" : "2016-12-06",
147+
"end" : "2020-07-22"
148+
}
149+
},
150+
{
151+
"line" : ["183 Mountain View St"],
152+
"city" : "Mounds",
153+
"state" : "OK",
154+
"postalCode" : "74048",
155+
"country" : "US",
156+
"period" : {
157+
"start" : "2020-07-22"
158+
}
159+
}]
160+
}

execution_scripts/validator/validator_suite_with_file_input.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,14 @@ steps:
66
state_description: created
77
action_description: run the suite
88
start_run:
9-
runnable: suite
9+
runnable: 1
1010
inputs:
1111
url: http://inferno.healthit.gov/reference-server/r4
1212
access_token: SAMPLE_TOKEN
1313
patient_id: 85
14-
coverage_json: '@coverage_json_input.json'
14+
patient_json: '@patient_json_input.json'
1515
timeout: 600 # allow for validator startup
1616

1717
- status: done
18-
last_completed: suite
18+
last_completed: 1
1919
action: END_SCRIPT

execution_scripts/validator/validator_suite_with_file_input_expected.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)