uds_plus_test_kit 0.9.1 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (36) hide show
  1. checksums.yaml +4 -4
  2. data/lib/uds_plus_test_kit/examples/condition.ndjson +1 -0
  3. data/lib/uds_plus_test_kit/examples/encounter.ndjson +1 -0
  4. data/lib/uds_plus_test_kit/examples/invalid_condition.ndjson +1 -0
  5. data/lib/uds_plus_test_kit/examples/invalid_encounter.ndjson +1 -0
  6. data/lib/uds_plus_test_kit/examples/invalid_patient.ndjson +2 -0
  7. data/lib/uds_plus_test_kit/examples/manifest.json +76 -14
  8. data/lib/uds_plus_test_kit/examples/observation.ndjson +3 -0
  9. data/lib/uds_plus_test_kit/examples/patient.ndjson +2 -0
  10. data/lib/uds_plus_test_kit/input_resource_tests/read_immunization_test.rb +54 -0
  11. data/lib/uds_plus_test_kit/input_resource_tests/read_lab_test.rb +54 -0
  12. data/lib/uds_plus_test_kit/input_resource_tests/read_med_request_test.rb +54 -0
  13. data/lib/uds_plus_test_kit/input_resource_tests/read_med_statement_test.rb +54 -0
  14. data/lib/uds_plus_test_kit/input_resource_tests/read_related_person_test.rb +54 -0
  15. data/lib/uds_plus_test_kit/input_resource_tests/read_service_request_test.rb +54 -0
  16. data/lib/uds_plus_test_kit/input_resource_tests/read_special_observation_test.rb +54 -0
  17. data/lib/uds_plus_test_kit/input_resource_tests/resource_group.rb +30 -2
  18. data/lib/uds_plus_test_kit/manifest_tests/invalid_type_test.rb +4 -1
  19. data/lib/uds_plus_test_kit/manifest_tests/uds_plus_test_group.rb +16 -2
  20. data/lib/uds_plus_test_kit/post_tests/post_group.rb +59 -0
  21. data/lib/uds_plus_test_kit/post_tests/post_manifest_test.rb +41 -0
  22. data/lib/uds_plus_test_kit/post_tests/read_post_test.rb +32 -0
  23. data/lib/uds_plus_test_kit/uds_plus_test_suite.rb +40 -0
  24. data/lib/uds_plus_test_kit/validate_immunization_test.rb +33 -0
  25. data/lib/uds_plus_test_kit/validate_income_test.rb +7 -10
  26. data/lib/uds_plus_test_kit/validate_lab_test.rb +65 -0
  27. data/lib/uds_plus_test_kit/validate_med_request_test.rb +33 -0
  28. data/lib/uds_plus_test_kit/validate_med_statement_test.rb +33 -0
  29. data/lib/uds_plus_test_kit/validate_related_person_test.rb +33 -0
  30. data/lib/uds_plus_test_kit/validate_service_request_test.rb +33 -0
  31. data/lib/uds_plus_test_kit/validate_sexual_orientation_test.rb +6 -9
  32. data/lib/uds_plus_test_kit/validate_special_observation_test.rb +65 -0
  33. data/lib/uds_plus_test_kit/version.rb +2 -2
  34. metadata +26 -4
  35. data/lib/uds_plus_test_kit/examples/manifest_2.json +0 -101
  36. data/lib/uds_plus_test_kit/examples/manifest_not_deidentified.json +0 -67
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 80e78dbee19286a1e0c84c1116ef47474ec612052d994ed37adc3fc1b330eafd
4
- data.tar.gz: a3a6f27dea067f3120aa8f9ba4e22fce59d1d18715bf9dacc507968f92701446
3
+ metadata.gz: 891c9ba749e3b6939300314696ca315585a1d7a0142a6ed8bd36a13f6604a275
4
+ data.tar.gz: 76ad5cb9ba7cbcf3e7f32d4c5971a3585b6612c517f4f0ad8c7aeddcf441aa49
5
5
  SHA512:
6
- metadata.gz: c800f94e83747a35e1807923ffd6b42d6753839624c68e834974c2f7894786b3c3ec913ba100cebd5b18ed6422efdc23bf327168ee3b96fe5493b14727b405ac
7
- data.tar.gz: d375d5d37e9ae1cff23ce6ea10a02513da7653a95ec3a615d8aa94d068486bff51869d7c8ba4caa525f2b3e6d6d3569083dbfa15c5ec11f1ff778ec20cdcf904
6
+ metadata.gz: c55b0176836f1a674be73c3c3274aae3d67572f3652776dc787b11fd04dce4b406535277955065c260a55490f8ff2ea9adf6ca6a7e9b7fa39b3613f69562f969
7
+ data.tar.gz: c82a7bf34b65b49e6258ea1f4a17fc3d766bb07ec60b835ae7db3f69cb6259b5904e22f9b248bc54ebd70736158ea4a0c8508db6d0f260994b77d775e6a54f4d
@@ -0,0 +1 @@
1
+ { "resourceType": "Condition", "id": "de-identified-example", "meta": { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString": "De-identified Diagnosis Example" }, { "url": "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown": "This example of a UDS+ Diagnosis profile which illustrates its use to capture de-identified information about a patient's diagnosis." } ], "profile": [ "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-diagnosis" ] }, "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/condition-assertedDate", "valueDateTime": "2007" } ], "clinicalStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/condition-clinical", "code": "active", "display": "Active" } ] }, "verificationStatus": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/condition-ver-status", "code": "confirmed", "display": "Confirmed" } ] }, "category": [ { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/condition-category", "code": "problem-list-item", "display": "Problem List Item" } ] } ], "code": { "coding": [ { "system": "http://hl7.org/fhir/sid/icd-10-cm", "code": "B18.2", "display": "Chronic viral hepatitis C" } ] }, "subject": { "reference": "Patient/de-identified-example" }, "onsetDateTime": "2007", "recordedDate": "2007"}
@@ -0,0 +1 @@
1
+ { "resourceType": "Encounter", "id": "de-identified-example", "meta": { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString": "De-Identified Encounter Example" }, { "url": "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown": "This is an encounter example for the *US Core Encounter Profile*." } ], "lastUpdated": "2022-05-26T11:56:57.250-04:00", "profile": [ "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-encounter" ] }, "extension": [ { "url": "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-age-extension", "valueQuantity": { "value": 36, "unit": "yr", "system": "http://unitsofmeasure.org", "code": "a" } } ], "status": "finished", "class": { "system": "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code": "AMB", "display": "ambulatory" }, "type": [ { "coding": [ { "system": "http://www.ama-assn.org/go/cpt", "code": "99201" } ] } ], "subject": { "reference": "Patient/de-identified-example" }, "period": { "start": "2022", "end": "2022" }, "hospitalization": { "dischargeDisposition": { "coding": [ { "system": "http://www.nubc.org/patient-discharge", "code": "01", "display": "Discharged to Home" } ] } }, "location": [ { "location": { "reference": "Location/hospital", "display": "Holy Family Hospital" } } ]}
@@ -0,0 +1 @@
1
+ { "resourceType" : "Condition", "id" : "example", "meta" : { "extension" : [ { "url" : "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString" : "Diagnosis Example" }, { "url" : "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown" : "This example of a US Core Condition Problems and Health Concerns Profile illustrates its use to capture information about a patient's diagnosis." } ], "profile" : [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition-problems-health-concerns" ] }, "text" : { "status" : "extensions", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Generated Narrative: Condition</b><a name=\"example\"> </a></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource Condition &quot;example&quot; </p><p style=\"margin-bottom: 0px\">Profile: <a href=\"http://hl7.org/fhir/us/core/STU6/StructureDefinition-us-core-condition-problems-health-concerns.html\">US Core Condition Problems and Health Concerns Profile</a></p></div><p><b>assertedDate</b>: 2007-12-14</p><p><b>clinicalStatus</b>: Active <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-condition-clinical.html\">Condition Clinical Status Codes</a>#active)</span></p><p><b>verificationStatus</b>: Confirmed <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-condition-ver-status.html\">ConditionVerificationStatus</a>#confirmed)</span></p><p><b>category</b>: Problem List Items <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-condition-category.html\">Condition Category Codes</a>#problem-list-item &quot;Problem List Item&quot;)</span></p><p><b>code</b>: Chronic viral hepatitis C <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/5.0.0/CodeSystem-icd10CM.html\">International Classification of Diseases, 10th Revision, Clinical Modification (ICD-10-CM)</a>#B18.2)</span></p><p><b>subject</b>: <a href=\"Patient-example.html\">Patient/example: Amy Shaw</a> &quot; SHAW&quot;</p><p><b>onset</b>: 2007-12-14</p><p><b>recordedDate</b>: 2007-12-14 07:15:07-0800</p><p><b>note</b>: Amy Shaw has Hepatitis</p></div>" }, "extension" : [ { "url" : "http://hl7.org/fhir/StructureDefinition/condition-assertedDate", "valueDateTime" : "2007-12-14" } ], "clinicalStatus" : { "coding" : [ { "system" : "http://terminology.hl7.org/CodeSystem/condition-clinical", "code" : "active", "display" : "Active" } ], "text" : "Active" }, "verificationStatus" : { "coding" : [ { "system" : "http://terminology.hl7.org/CodeSystem/condition-ver-status", "code" : "confirmed", "display" : "Confirmed" } ], "text" : "Confirmed" }, "category" : [ { "coding" : [ { "system" : "http://terminology.hl7.org/CodeSystem/condition-category", "code" : "problem-list-item", "display" : "Problem List Item" } ], "text" : "Problem List Items" } ], "code" : { "coding" : [ { "system" : "http://hl7.org/fhir/sid/icd-10-cm", "code" : "B18.2", "display" : "Chronic viral hepatitis C" } ], "text" : "Chronic viral hepatitis C" }, "subject" : { "reference" : "Patient/example", "display" : "Amy Shaw" }, "onsetDateTime" : "2007-12-14", "recordedDate" : "2007-12-14T07:15:07-08:00", "note" : [ { "text" : "Amy Shaw has Hepatitis" } ] }
@@ -0,0 +1 @@
1
+ { "resourceType" : "Encounter", "id" : "example", "meta" : { "extension" : [ { "url" : "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString" : "Encounter Example" }, { "url" : "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown" : "This is an encounter example for the *US Core Encounter Profile*." } ], "lastUpdated" : "2017-05-26T11:56:57.250-04:00", "profile" : [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter" ] }, "text" : { "status" : "extensions", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Narrative</b></p><div style=\"display: inline-block; background-color: #d9e0e7; padding: 6px; margin: 4px; border: 1px solid #8da1b4; border-radius: 5px; line-height: 60%\"><p style=\"margin-bottom: 0px\">Resource \"example-1\" Updated \"2017-05-26 11:56:57-0400\" </p><p style=\"margin-bottom: 0px\">Profile:US Core Encounter Profile</p></div><p><b>status</b>: finished</p><p><b>class</b>: ambulatory (Details: http://terminology.hl7.org/CodeSystem/v3-ActCode code AMB = 'ambulatory', stated as 'ambulatory')</p><p><b>type</b>: Office Visit <span style=\"background: LightGoldenRodYellow; margin: 4px; border: 1px solid khaki\"> (<a href=\"http://terminology.hl7.org/3.1.0/CodeSystem-CPT.html\">Current Procedural Terminology (CPT)</a>#99201)</span></p><p><b>subject</b>: <a href=\"Patient-example.html\">Patient/example</a> \" SHAW\"</p><p><b>period</b>: 2015-11-01 05:00:14-0500 --&gt; 2015-11-01 06:00:14-0500</p></div>" }, "status" : "finished", "class" : { "system" : "http://terminology.hl7.org/CodeSystem/v3-ActCode", "code" : "AMB", "display" : "ambulatory" }, "type" : [ { "coding" : [ { "system" : "http://www.ama-assn.org/go/cpt", "code" : "99201" } ], "text" : "Office Visit" } ], "subject" : { "reference" : "Patient/example", "display" : "Amy" }, "period" : { "start" : "2015-11-01T17:00:14-05:00", "end" : "2015-11-01T18:00:14-05:00" }, "hospitalization" : { "dischargeDisposition" : { "coding" : [ { "system" : "http://www.nubc.org/patient-discharge", "code" : "01", "display" : "Discharged to Home" } ], "text" : "Amy was dischaged to home" } }, "location" : [ { "location" : { "reference" : "Location/hospital", "display" : "Holy Family Hospital" } } ] }
@@ -0,0 +1,2 @@
1
+ { "resourceType" : "Patient", "id" : "smallpop-example", "meta" : { "extension" : [ { "url" : "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString" : "Patient Example" }, { "url" : "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown" : "This is a patient example for the *US Core Patient Profile*." } ], "profile" : [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient" ] }, "text" : { "status" : "generated", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Amy V. Baxter </b> female, DoB: 1987-02-20 ( Medical Record Number: 1032702 (USUAL))</p></div>" }, "extension" : [ { "extension" : [ { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2106-3", "display" : "White" } }, { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "1002-5", "display" : "American Indian or Alaska Native" } }, { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2028-9", "display" : "Asian" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "1586-7", "display" : "Shoshone" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2036-2", "display" : "Filipino" } }, { "url" : "text", "valueString" : "Mixed" } ], "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race" }, { "extension" : [ { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2135-2", "display" : "Hispanic or Latino" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2184-0", "display" : "Dominican" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2148-5", "display" : "Mexican" } }, { "url" : "text", "valueString" : "Hispanic or Latino" } ], "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" }, { "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", "valueCode" : "F" }, { "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity", "valueCodeableConcept" : { "coding" : [ { "system" : "http://terminology.hl7.org/CodeSystem/v3-NullFlavor", "code" : "ASKU", "display" : "asked but unknown" } ], "text" : "asked but unknown" } } ], "identifier" : [ { "use" : "usual", "type" : { "coding" : [ { "system" : "http://terminology.hl7.org/CodeSystem/v2-0203", "code" : "MR", "display" : "Medical Record Number" } ], "text" : "Medical Record Number" }, "system" : "http://hospital.smarthealthit.org", "value" : "1032702" } ], "active" : true, "name" : [ { "use" : "old", "family" : "Shaw", "given" : [ "Amy", "V." ], "period" : { "start" : "2016-12-06", "end" : "2020-07-22" } }, { "family" : "Baxter", "given" : [ "Amy", "V." ], "suffix" : [ "PharmD" ], "period" : { "start" : "2020-07-22" } } ], "telecom" : [ { "system" : "phone", "value" : "555-555-5555", "use" : "home" }, { "system" : "email", "value" : "amy.shaw@example.com" } ], "gender" : "female", "birthDate" : "1987-02-20", "address" : [ { "use" : "old", "line" : [ "49 Meadow St" ], "city" : "Norton", "state" : "VT", "postalCode" : "05907", "country" : "US", "period" : { "start" : "2016-12-06", "end" : "2020-07-22" } }, { "line" : [ "183 Mountain View St" ], "city" : "Norton", "state" : "VT", "postalCode" : "05907", "country" : "US", "period" : { "start" : "2020-07-22" } } ] }
2
+ { "resourceType" : "Patient", "id" : "example", "meta" : { "extension" : [ { "url" : "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString" : "Patient Example" }, { "url" : "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown" : "This is a patient example for the *US Core Patient Profile*." } ], "profile" : [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient" ] }, "text" : { "status" : "generated", "div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b>Amy V. Baxter </b> female, DoB: 1987-02-20 ( Medical Record Number: 1032702 (USUAL))</p></div>" }, "extension" : [ { "extension" : [ { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2106-3", "display" : "White" } }, { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "1002-5", "display" : "American Indian or Alaska Native" } }, { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2028-9", "display" : "Asian" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "1586-7", "display" : "Shoshone" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2036-2", "display" : "Filipino" } }, { "url" : "text", "valueString" : "Mixed" } ], "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race" }, { "extension" : [ { "url" : "ombCategory", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2135-2", "display" : "Hispanic or Latino" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2184-0", "display" : "Dominican" } }, { "url" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2148-5", "display" : "Mexican" } }, { "url" : "text", "valueString" : "Hispanic or Latino" } ], "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" }, { "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", "valueCode" : "F" }, { "url" : "http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity", "valueCodeableConcept" : { "coding" : [ { "system" : "http://terminology.hl7.org/CodeSystem/v3-NullFlavor", "code" : "ASKU", "display" : "asked but unknown" } ], "text" : "asked but unknown" } } ], "identifier" : [ { "use" : "usual", "type" : { "coding" : [ { "system" : "http://terminology.hl7.org/CodeSystem/v2-0203", "code" : "MR", "display" : "Medical Record Number" } ], "text" : "Medical Record Number" }, "system" : "http://hospital.smarthealthit.org", "value" : "1032702" } ], "active" : true, "name" : [ { "use" : "old", "family" : "Shaw", "given" : [ "Amy", "V." ], "period" : { "start" : "2016-12-06", "end" : "2020-07-22" } }, { "family" : "Baxter", "given" : [ "Amy", "V." ], "suffix" : [ "PharmD" ], "period" : { "start" : "2020-07-22" } } ], "telecom" : [ { "system" : "phone", "value" : "555-555-5555", "use" : "home" }, { "system" : "email", "value" : "amy.shaw@example.com" } ], "gender" : "female", "birthDate" : "1987-02-20", "address" : [ { "use" : "old", "line" : [ "49 Meadow St" ], "city" : "Alstead", "state" : "NH", "postalCode" : "03602", "country" : "US", "period" : { "start" : "2016-12-06", "end" : "2020-07-22" } }, { "line" : [ "183 Mountain View St" ], "city" : "Alstead", "state" : "NH", "postalCode" : "03602", "country" : "US", "period" : { "start" : "2020-07-22" } } ] }
@@ -16,20 +16,65 @@
16
16
  "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-import-manifest"
17
17
  ]
18
18
  },
19
- "parameter": [
20
- {
21
- "name": "inputFormat",
22
- "valueCode": "application/ndjson"
23
- },
24
- {
25
- "name": "inputSource",
26
- "valueUrl": "http://localhost:4567/"
27
- },
28
- {
29
- "name": "storageDetail",
30
- "valueCode": "https"
31
- },
32
- {
19
+ "parameter" : [
20
+ {
21
+ "name" : "inputFormat",
22
+ "valueCode" : "fhir+ndjson"
23
+ },
24
+ {
25
+ "name" : "submissionId",
26
+ "valueString" : "234343-aaa-32432"
27
+ },
28
+ {
29
+ "name" : "hcInformation",
30
+ "part" : [
31
+ {
32
+ "name" : "uei",
33
+ "valueString" : "12343434"
34
+ },
35
+ {
36
+ "name" : "grantNumber",
37
+ "valueString" : "H80CS34333"
38
+ },
39
+ {
40
+ "name" : "hcName",
41
+ "valueString" : "Example FQHC"
42
+ },
43
+ {
44
+ "name" : "hcAddress",
45
+ "valueAddress" : {
46
+ "line": [
47
+ "123 Rocky point place"
48
+ ],
49
+ "city": "Atlanta",
50
+ "state": "GA",
51
+ "postalCode": "23434",
52
+ "country": "US"
53
+ }
54
+ },
55
+ {
56
+ "name" : "hcContactPerson",
57
+ "valueHumanName" : {
58
+ "family": "Taylor",
59
+ "given": [
60
+ "Elizabeth"
61
+ ]
62
+ }
63
+ },
64
+ {
65
+ "name" : "hcContactPhone",
66
+ "valueContactPoint" : {
67
+ "system": "phone",
68
+ "value": "234-234-5648"
69
+ }
70
+ }
71
+ ]
72
+ },
73
+ {
74
+ "name" : "importProtocol",
75
+ "valueCode" : "https"
76
+ },
77
+ {
33
78
  "name": "udsData",
34
79
  "part": [
35
80
  {
@@ -63,6 +108,23 @@
63
108
  }
64
109
  ]
65
110
  },
111
+ {
112
+ "name": "udsData",
113
+ "part": [
114
+ {
115
+ "name": "type",
116
+ "valueCode": "Observation"
117
+ },
118
+ {
119
+ "name": "url",
120
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/observation"
121
+ },
122
+ {
123
+ "name": "expirationTime",
124
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
125
+ }
126
+ ]
127
+ },
66
128
  {
67
129
  "name": "udsData",
68
130
  "part": [
@@ -0,0 +1,3 @@
1
+ { "resourceType": "Observation", "id": "de-identified-example", "meta": { "profile": [ "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-lab-observation" ] }, "status": "final", "category": [ { "coding": [ { "system" : "http://terminology.hl7.org/CodeSystem/observation-category", "code" : "laboratory", "display" : "Laboratory" } ] } ], "code": { "coding": [ { "system" : "http://loinc.org", "code" : "718-7", "display" : "Hemoglobin [Mass/volume] in Blood" } ] }, "subject": { "reference": "Patient/de-identified-example" }, "encounter": { "reference": "Encounter/de-identified-example" }, "effectiveDateTime" : "2005", "issued": "2005-04-03T15:30:10+01:00", "performer": [ { "reference": "Practitioner/example" } ], "valueQuantity" : { "value" : 17, "unit" : "g/dL", "system" : "http://unitsofmeasure.org" }, "bodySite": { "coding": [ { "system": "http://snomed.info/sct", "code": "368208006", "display": "Left upper arm structure" } ] }}
2
+ { "resourceType": "Observation", "id": "de-identified-income-example", "meta": { "profile": [ "http://hl7.org/fhir/us/uds-plus/StructureDefinition/de-identified-uds-plus-income-observation" ] }, "status": "final", "code": { "coding": [ { "system": "http://loinc.org", "code": "63058-2" } ] }, "subject": { "reference": "Patient/de-identified-example" }, "effectiveDateTime": "2016-03-28", "valueRange": { "low": { "value": 101 }, "high": { "value": 150 } }}
3
+ { "resourceType": "Observation", "id": "de-identified-sexual-orientation-example", "meta": { "profile": [ "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-sexual-orientation-observation" ] }, "status": "final", "code": { "coding": [ { "system": "http://loinc.org", "code": "76690-7" } ] }, "subject": { "reference": "Patient/example" }, "effectiveDateTime": "2007", "valueCodeableConcept": { "coding": [ { "system": "http://snomed.info/sct", "code": "20430005", "display": "Heterosexual state" } ] }}
@@ -0,0 +1,2 @@
1
+ { "resourceType": "Patient", "id": "de-identified-example", "meta": { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString": "De-identified Patient Example" }, { "url": "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown": "This is a patient example for the *UDS+ Patient Profile*." } ], "profile": [ "http://hl7.org/fhir/us/uds-plus/StructureDefinition/de-identified-uds-plus-patient" ] }, "extension": [ { "extension": [ { "url": "ombCategory", "valueCoding": { "system": "urn:oid:2.16.840.1.113883.6.238", "code": "2106-3", "display": "White" } }, { "url": "text", "valueString": "White" } ], "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race" }, { "extension": [ { "url": "ombCategory", "valueCoding": { "system": "urn:oid:2.16.840.1.113883.6.238", "code": "2135-2", "display": "Hispanic or Latino" } }, { "url": "text", "valueString": "Hispanic or Latino" } ], "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" }, { "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", "valueCode": "F" }, { "url": "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-age-extension", "valueQuantity": { "value" : 36, "unit" : "yr", "system" : "http://unitsofmeasure.org", "code" : "a" } }, { "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity", "valueCodeableConcept": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor", "code": "ASKU", "display": "asked but unknown" } ], "text": "asked but unknown" } }, { "url": "http://hl7.org/fhir/us/uds-plus/StructureDefinition/udsplus-agriculture-worker-status", "valueCode": "migratory" }, { "url": "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-housing-status-extension", "valueCode": "permanent-supportive-housing" }, { "url": "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-veteran-status-extension", "valueBoolean": false } ], "active": true, "gender": "female", "address": [ { "postalCode": "03600" } ]}
2
+ { "resourceType": "Patient", "id": "de-identified-smallpop-example", "meta": { "extension": [ { "url": "http://hl7.org/fhir/StructureDefinition/instance-name", "valueString": "De-identified Patient Example" }, { "url": "http://hl7.org/fhir/StructureDefinition/instance-description", "valueMarkdown": "This is a patient example for the *UDS+ Patient Profile*." } ], "profile": [ "http://hl7.org/fhir/us/uds-plus/StructureDefinition/de-identified-uds-plus-patient" ] }, "extension": [ { "extension": [ { "url": "ombCategory", "valueCoding": { "system": "urn:oid:2.16.840.1.113883.6.238", "code": "2106-3", "display": "White" } }, { "url": "text", "valueString": "White" } ], "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-race" }, { "extension": [ { "url": "ombCategory", "valueCoding": { "system": "urn:oid:2.16.840.1.113883.6.238", "code": "2135-2", "display": "Hispanic or Latino" } }, { "url": "text", "valueString": "Hispanic or Latino" } ], "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" }, { "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex", "valueCode": "F" }, { "url": "http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-age-extension", "valueQuantity": { "value" : 36, "unit" : "yr", "system" : "http://unitsofmeasure.org", "code" : "a" } }, { "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-genderIdentity", "valueCodeableConcept": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor", "code": "ASKU", "display": "asked but unknown" } ], "text": "asked but unknown" } } ], "active": true, "gender": "female", "address": [ { "postalCode": "00000", "_postalCode": { "extension" : [ { "url" : "http://hl7.org/fhir/StructureDefinition/data-absent-reason", "valueCode" : "masked" }] } } ]}
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadImmunizationTest < Inferno::Test
5
+ id :uds_plus_read_immunization_test
6
+ title 'Receive UDS+ Immunization Data'
7
+ description %(
8
+ Test takes from the user either: the http location of immunization data
9
+ or the raw JSON of the data itself.
10
+ It attempts to GET the data stored at the given location if a link is provided,
11
+ then validates whether a FHIR resource can be generated from the input data.
12
+ )
13
+
14
+ input :immunization_data,
15
+ title: 'Immunization Data',
16
+ optional: true,
17
+ description: %q(
18
+ User can input the data as:
19
+ a URL link to the location of the data (ex: http://www.example.com/immunization_data.json)
20
+ OR a JSON string that composes the data. Leaving this blank will skip the test.
21
+ )
22
+
23
+ def data_scratch
24
+ scratch[:data_resources] ||= {}
25
+ end
26
+
27
+ def data_to_test
28
+ data_scratch['Immunization'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !immunization_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if immunization_data.strip[0] != '{'
36
+ assert_valid_http_uri(immunization_data, "Location provided is not a valid http uri.")
37
+ get immunization_data
38
+ assert_response_status(200)
39
+ assert_valid_json(request.response_body, "Data received from request is not a valid JSON")
40
+ data = request.response_body
41
+ else
42
+ assert_valid_json(immunization_data, "JSON inputted was not in a valid format")
43
+ data = immunization_data
44
+ end
45
+
46
+ resource = FHIR::Json.from_json(data)
47
+ assert resource.is_a?(FHIR::Model), "Could not generate a valid resource from the input provided"
48
+
49
+ if resource.is_a?(FHIR::Model)
50
+ data_to_test << resource
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadLabTest < Inferno::Test
5
+ id :uds_plus_read_lab_test
6
+ title 'Receive UDS+ Lab Observation Data'
7
+ description %(
8
+ Test takes from the user either: the http location of lab observation data
9
+ or the raw JSON of the data itself.
10
+ It attempts to GET the data stored at the given location if a link is provided,
11
+ then validates whether a FHIR resource can be generated from the input data.
12
+ )
13
+
14
+ input :lab_data,
15
+ title: 'Lab Observation Data',
16
+ optional: true,
17
+ description: %q(
18
+ User can input the data as:
19
+ a URL link to the location of the data (ex: http://www.example.com/lab_data.json)
20
+ OR a JSON string that composes the data. Leaving this blank will skip the test.
21
+ )
22
+
23
+ def data_scratch
24
+ scratch[:data_resources] ||= {}
25
+ end
26
+
27
+ def data_to_test
28
+ data_scratch['Observation'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !lab_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if lab_data.strip[0] != '{'
36
+ assert_valid_http_uri(lab_data, "Location provided is not a valid http uri.")
37
+ get lab_data
38
+ assert_response_status(200)
39
+ assert_valid_json(request.response_body, "Data received from request is not a valid JSON")
40
+ data = request.response_body
41
+ else
42
+ assert_valid_json(lab_data, "JSON inputted was not in a valid format")
43
+ data = lab_data
44
+ end
45
+
46
+ resource = FHIR::Json.from_json(data)
47
+ assert resource.is_a?(FHIR::Model), "Could not generate a valid resource from the input provided"
48
+
49
+ if resource.is_a?(FHIR::Model)
50
+ data_to_test << resource
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadMedicationRequestTest < Inferno::Test
5
+ id :uds_plus_read_medication_request_test
6
+ title 'Receive UDS+ Medication Request Data'
7
+ description %(
8
+ Test takes from the user either: the http location of medication request data
9
+ or the raw JSON of the data itself.
10
+ It attempts to GET the data stored at the given location if a link is provided,
11
+ then validates whether a FHIR resource can be generated from the input data.
12
+ )
13
+
14
+ input :medication_request_data,
15
+ title: 'Medication Request Data',
16
+ optional: true,
17
+ description: %q(
18
+ User can input the data as:
19
+ a URL link to the location of the data (ex: http://www.example.com/medication_request_data.json)
20
+ OR a JSON string that composes the data. Leaving this blank will skip the test.
21
+ )
22
+
23
+ def data_scratch
24
+ scratch[:data_resources] ||= {}
25
+ end
26
+
27
+ def data_to_test
28
+ data_scratch['MedicationRequest'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !medication_request_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if medication_request_data.strip[0] != '{'
36
+ assert_valid_http_uri(medication_request_data, "Location provided is not a valid http uri.")
37
+ get medication_request_data
38
+ assert_response_status(200)
39
+ assert_valid_json(request.response_body, "Data received from request is not a valid JSON")
40
+ data = request.response_body
41
+ else
42
+ assert_valid_json(medication_request_data, "JSON inputted was not in a valid format")
43
+ data = medication_request_data
44
+ end
45
+
46
+ resource = FHIR::Json.from_json(data)
47
+ assert resource.is_a?(FHIR::Model), "Could not generate a valid resource from the input provided"
48
+
49
+ if resource.is_a?(FHIR::Model)
50
+ data_to_test << resource
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadMedicationStatementTest < Inferno::Test
5
+ id :uds_plus_read_medication_statement_test
6
+ title 'Receive UDS+ Medication Statement Data'
7
+ description %(
8
+ Test takes from the user either: the http location of medication statement data
9
+ or the raw JSON of the data itself.
10
+ It attempts to GET the data stored at the given location if a link is provided,
11
+ then validates whether a FHIR resource can be generated from the input data.
12
+ )
13
+
14
+ input :medication_statement_data,
15
+ title: 'Medication Statement Data',
16
+ optional: true,
17
+ description: %q(
18
+ User can input the data as:
19
+ a URL link to the location of the data (ex: http://www.example.com/medication_statement_data.json)
20
+ OR a JSON string that composes the data. Leaving this blank will skip the test.
21
+ )
22
+
23
+ def data_scratch
24
+ scratch[:data_resources] ||= {}
25
+ end
26
+
27
+ def data_to_test
28
+ data_scratch['MedicationStatement'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !medication_statement_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if medication_statement_data.strip[0] != '{'
36
+ assert_valid_http_uri(medication_statement_data, "Location provided is not a valid http uri.")
37
+ get medication_statement_data
38
+ assert_response_status(200)
39
+ assert_valid_json(request.response_body, "Data received from request is not a valid JSON")
40
+ data = request.response_body
41
+ else
42
+ assert_valid_json(medication_statement_data, "JSON inputted was not in a valid format")
43
+ data = medication_statement_data
44
+ end
45
+
46
+ resource = FHIR::Json.from_json(data)
47
+ assert resource.is_a?(FHIR::Model), "Could not generate a valid resource from the input provided"
48
+
49
+ if resource.is_a?(FHIR::Model)
50
+ data_to_test << resource
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadRelatedPersonTest < Inferno::Test
5
+ id :uds_plus_read_related_person_test
6
+ title 'Receive UDS+ Related Person Data'
7
+ description %(
8
+ Test takes from the user either: the http location of related person data
9
+ or the raw JSON of the data itself.
10
+ It attempts to GET the data stored at the given location if a link is provided,
11
+ then validates whether a FHIR resource can be generated from the input data.
12
+ )
13
+
14
+ input :related_person_data,
15
+ title: 'Related Person Data',
16
+ optional: true,
17
+ description: %q(
18
+ User can input the data as:
19
+ a URL link to the location of the data (ex: http://www.example.com/related_person_data.json)
20
+ OR a JSON string that composes the data. Leaving this blank will skip the test.
21
+ )
22
+
23
+ def data_scratch
24
+ scratch[:data_resources] ||= {}
25
+ end
26
+
27
+ def data_to_test
28
+ data_scratch['RelatedPerson'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !related_person_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if related_person_data.strip[0] != '{'
36
+ assert_valid_http_uri(related_person_data, "Location provided is not a valid http uri.")
37
+ get related_person_data
38
+ assert_response_status(200)
39
+ assert_valid_json(request.response_body, "Data received from request is not a valid JSON")
40
+ data = request.response_body
41
+ else
42
+ assert_valid_json(related_person_data, "JSON inputted was not in a valid format")
43
+ data = related_person_data
44
+ end
45
+
46
+ resource = FHIR::Json.from_json(data)
47
+ assert resource.is_a?(FHIR::Model), "Could not generate a valid resource from the input provided"
48
+
49
+ if resource.is_a?(FHIR::Model)
50
+ data_to_test << resource
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadServiceRequestTest < Inferno::Test
5
+ id :uds_plus_read_service_request_test
6
+ title 'Receive UDS+ Service Request Data'
7
+ description %(
8
+ Test takes from the user either: the http location of service request data
9
+ or the raw JSON of the data itself.
10
+ It attempts to GET the data stored at the given location if a link is provided,
11
+ then validates whether a FHIR resource can be generated from the input data.
12
+ )
13
+
14
+ input :service_request_data,
15
+ title: 'Service Request Data',
16
+ optional: true,
17
+ description: %q(
18
+ User can input the data as:
19
+ a URL link to the location of the data (ex: http://www.example.com/service_request_data.json)
20
+ OR a JSON string that composes the data. Leaving this blank will skip the test.
21
+ )
22
+
23
+ def data_scratch
24
+ scratch[:data_resources] ||= {}
25
+ end
26
+
27
+ def data_to_test
28
+ data_scratch['ServiceRequest'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !service_request_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if service_request_data.strip[0] != '{'
36
+ assert_valid_http_uri(service_request_data, "Location provided is not a valid http uri.")
37
+ get service_request_data
38
+ assert_response_status(200)
39
+ assert_valid_json(request.response_body, "Data received from request is not a valid JSON")
40
+ data = request.response_body
41
+ else
42
+ assert_valid_json(service_request_data, "JSON inputted was not in a valid format")
43
+ data = service_request_data
44
+ end
45
+
46
+ resource = FHIR::Json.from_json(data)
47
+ assert resource.is_a?(FHIR::Model), "Could not generate a valid resource from the input provided"
48
+
49
+ if resource.is_a?(FHIR::Model)
50
+ data_to_test << resource
51
+ end
52
+ end
53
+ end
54
+ end
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadSpecialObservationTest < Inferno::Test
5
+ id :uds_plus_read_special_observation_test
6
+ title 'Receive UDS+ Special Observation Data'
7
+ description %(
8
+ Test takes from the user either: the http location of special observation data
9
+ (such as uds-special-population-observation) or the raw JSON of the data itself.
10
+ It attempts to GET the data stored at the given location if a link is provided,
11
+ then validates whether a FHIR resource can be generated from the input data.
12
+ )
13
+
14
+ input :special_observation_data,
15
+ title: 'Special Observation Data',
16
+ optional: true,
17
+ description: %q(
18
+ User can input the data as:
19
+ a URL link to the location of the data (ex: http://www.example.com/special_observation_data.json)
20
+ OR a JSON string that composes the data. Leaving this blank will skip the test.
21
+ )
22
+
23
+ def data_scratch
24
+ scratch[:data_resources] ||= {}
25
+ end
26
+
27
+ def data_to_test
28
+ data_scratch['Observation'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !special_observation_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if special_observation_data.strip[0] != '{'
36
+ assert_valid_http_uri(special_observation_data, "Location provided is not a valid http uri.")
37
+ get special_observation_data
38
+ assert_response_status(200)
39
+ assert_valid_json(request.response_body, "Data received from request is not a valid JSON")
40
+ data = request.response_body
41
+ else
42
+ assert_valid_json(special_observation_data, "JSON inputted was not in a valid format")
43
+ data = special_observation_data
44
+ end
45
+
46
+ resource = FHIR::Json.from_json(data)
47
+ assert resource.is_a?(FHIR::Model), "Could not generate a valid resource from the input provided"
48
+
49
+ if resource.is_a?(FHIR::Model)
50
+ data_to_test << resource
51
+ end
52
+ end
53
+ end
54
+ end