uds_plus_test_kit 1.0.4 → 1.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: fc8a90d49751a9e2af4c9c4d5df0cf86f953ef0753751e1a49fa3a110e8c0508
4
- data.tar.gz: 386594bb67cba437ade8694f0ca9f91cf8fac2b4939680aa7633a76c0ba50536
3
+ metadata.gz: 60848e4e718f24f6d9160cbb3bc9389bf3e2ffa1d0a2d980f251cfcb2a51e55a
4
+ data.tar.gz: 8476b8ae557232bd4de034068f9871e19aa52168e336d397485202c31b1ec57c
5
5
  SHA512:
6
- metadata.gz: dd607758776abef43ef2360650381b445da7bb845abf15e89f6e448827f12e389808ea2b9d546096fa7792e318fa86c5827f6c5d1c5806a0a45a37236686239d
7
- data.tar.gz: 30340f6684aac5f01472e2104d6ca32596a3a9e605ee67709728bccf1067f0216f3b1e4b169fae89dea9e5c2fbc3f5f34f51438888654dd01ad701996a3e3163
6
+ metadata.gz: d8b05e2ca35b3bbd6147941f84947b95fc2ef52c1c347eaf6d66125fc44723515df3f36442e0639467bb88602ca008aa1a502970c244dfe2fedf0fd289075144
7
+ data.tar.gz: e91f06bf652b32497441f6781c9edfdceb5e594e1da2822b03a617ebec2d1359b712423636f6e8c413672f9a8a7c79cdfca2640e6a252f5250989ac1ad5e77c0
@@ -1 +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" } } ] }
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" } } ] }
@@ -1,2 +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" } } ] }
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" } } ]}
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadDataUrlsTest < Inferno::Test
5
+ id :uds_plus_read_data_urls_test
6
+ title 'Receive UDS+ Data Urls Data'
7
+ description %(
8
+ Test takes from the user either: the http location of the "data urls" 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 :data_urls_data,
15
+ title: 'Data Urls 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/data_urls_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['Parameters'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !data_urls_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if data_urls_data.strip[0] != '{'
36
+ assert_valid_http_uri(data_urls_data, "Location provided is not a valid http uri.")
37
+ get data_urls_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(data_urls_data, "JSON inputted was not in a valid format")
43
+ data = data_urls_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 ReadPatientReportingParametersTest < Inferno::Test
5
+ id :uds_plus_read_patient_reporting_parameters_test
6
+ title 'Receive UDS+ Patient Reporting Parameters Data'
7
+ description %(
8
+ Test takes from the user either: the http location of patient reporting parameters 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 :patient_reporting_parameters_data,
15
+ title: 'Patient Reporting Parameters 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/patient_reporting_parameters_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['Parameters'] ||= []
29
+ end
30
+
31
+ run do
32
+ omit_if !patient_reporting_parameters_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if patient_reporting_parameters_data.strip[0] != '{'
36
+ assert_valid_http_uri(patient_reporting_parameters_data, "Location provided is not a valid http uri.")
37
+ get patient_reporting_parameters_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(patient_reporting_parameters_data, "JSON inputted was not in a valid format")
43
+ data = patient_reporting_parameters_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
@@ -37,6 +37,10 @@ require_relative './read_adverse_event_test'
37
37
  require_relative '../validate_adverse_event_test'
38
38
  require_relative './read_clinical_result_test'
39
39
  require_relative '../validate_clinical_result_test'
40
+ require_relative './read_data_urls_test'
41
+ require_relative '../validate_data_urls_test'
42
+ require_relative './read_patient_reporting_parameters_test'
43
+ require_relative '../validate_patient_reporting_parameters_test'
40
44
 
41
45
  module UDSPlusTestKit
42
46
  class UDSPlusResourceTestGroup < Inferno::TestGroup
@@ -91,5 +95,9 @@ module UDSPlusTestKit
91
95
  test from: :uds_plus_validate_medication_statement_test
92
96
  test from: :uds_plus_read_service_request_test
93
97
  test from: :uds_plus_validate_service_request_test
98
+ test from: :uds_plus_read_data_urls_test
99
+ test from: :uds_plus_validate_data_urls_test
100
+ test from: :uds_plus_read_patient_reporting_parameters_test
101
+ test from: :uds_plus_validate_patient_reporting_parameters_test
94
102
  end
95
103
  end
@@ -21,7 +21,8 @@ module UDSPlusTestKit
21
21
  'RelatedPerson', 'Immunization',
22
22
  'ServiceRequest', 'MedicationRequest',
23
23
  'MedicationStatement', 'Location',
24
- 'AdverseEvent', 'AllergyIntolerance'
24
+ 'AdverseEvent', 'AllergyIntolerance',
25
+ 'Parameters'
25
26
  ]
26
27
  end
27
28
 
@@ -21,6 +21,8 @@ require_relative '../validate_location_test'
21
21
  require_relative '../validate_allergy_intolerance_test'
22
22
  require_relative '../validate_adverse_event_test'
23
23
  require_relative '../validate_clinical_result_test'
24
+ require_relative '../validate_data_urls_test'
25
+ require_relative '../validate_patient_reporting_parameters_test'
24
26
 
25
27
  module UDSPlusTestKit
26
28
  class UDSPlusTestGroup < Inferno::TestGroup
@@ -56,6 +58,8 @@ module UDSPlusTestKit
56
58
  test from: :uds_plus_validate_medication_request_test
57
59
  test from: :uds_plus_validate_medication_statement_test
58
60
  test from: :uds_plus_validate_service_request_test
61
+ test from: :uds_plus_validate_data_urls_test
62
+ test from: :uds_plus_validate_patient_reporting_parameters_test
59
63
  test from: :uds_plus_invalid_type_test
60
64
  end
61
65
  end
@@ -26,6 +26,8 @@ require_relative '../validate_location_test'
26
26
  require_relative '../validate_allergy_intolerance_test'
27
27
  require_relative '../validate_adverse_event_test'
28
28
  require_relative '../validate_clinical_result_test'
29
+ require_relative '../validate_data_urls_test'
30
+ require_relative '../validate_patient_reporting_parameters_test'
29
31
 
30
32
  module UDSPlusTestKit
31
33
  class UDSPlusPostGroup < Inferno::TestGroup
@@ -62,6 +64,8 @@ module UDSPlusTestKit
62
64
  test from: :uds_plus_validate_medication_request_test
63
65
  test from: :uds_plus_validate_medication_statement_test
64
66
  test from: :uds_plus_validate_service_request_test
67
+ test from: :uds_plus_validate_data_urls_test
68
+ test from: :uds_plus_validate_patient_reporting_parameters_test
65
69
  test from: :uds_plus_invalid_type_test
66
70
  end
67
71
  end
@@ -23,8 +23,11 @@ module UDSPlusTestKit
23
23
 
24
24
  # Messages will be excluded if the block evaluates to a truthy value
25
25
  exclude_message do |message|
26
- message.type == 'warning' &&
27
- message.message.match?(/Global Profile reference .* could not be resolved, so has not been checked/)
26
+ (message.type == 'warning' &&
27
+ message.message.match?(/Global Profile reference .* could not be resolved, so has not been checked/)) ||
28
+ (message.type == 'error' &&
29
+ Inferno::Application['base_url'].match?(/localhost:/) &&
30
+ message.message.match?(/Server Error: Code .* not found in CPT;/))
28
31
  end
29
32
  end
30
33
 
@@ -22,7 +22,7 @@ module UDSPlusTestKit
22
22
  run do
23
23
  omit_if data_to_test.empty?, "No data of this type was identified."
24
24
 
25
- profile_definition = 'http://hl7.org/fhir/us/uds-plus/StructureDefinition/de-identified-uds-plus-clinical-result-observation'
25
+ profile_definition = 'http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-clinical-result-observation'
26
26
  profile_with_version = "#{profile_definition}|#{UDS_PLUS_VERSION}"
27
27
 
28
28
  no_resource_of_this_type = true
@@ -34,7 +34,7 @@ module UDSPlusTestKit
34
34
  regardless of whether both tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
- # All these assertions are to differentaite Observation data between orientation types.
37
+ # All these assertions are to differentiate Observation data between orientation types.
38
38
  # A resource is skipped if it cannot be identified as an clinical result resource.
39
39
  type_identifier = resource.to_hash
40
40
  assert type_identifier['meta'].present?, identifier_fail_message
@@ -0,0 +1,65 @@
1
+ require 'json'
2
+ require_relative './version'
3
+
4
+ module UDSPlusTestKit
5
+ class ValidateDataUrlsTest < Inferno::Test
6
+ id :uds_plus_validate_data_urls_test
7
+ title 'Validate UDS+ Data Urls Data'
8
+ description %(
9
+ Test takes the Data Urls resources identified
10
+ by the import manifest, and validates whether they conform
11
+ to their UDS+ Structure Definitions.
12
+ )
13
+
14
+ def data_scratch
15
+ scratch[:data_resources] ||= {}
16
+ end
17
+
18
+ def data_to_test
19
+ data_scratch['Parameters'] ||= []
20
+ end
21
+
22
+ run do
23
+ omit_if data_to_test.empty?, "No data of this type was identified."
24
+
25
+ profile_definition = 'http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-deidentify-operation-data-urls-parameter'
26
+ profile_with_version = "#{profile_definition}|#{UDS_PLUS_VERSION}"
27
+
28
+ no_resource_of_this_type = true
29
+ identifier_fail_message = %(Resource.meta.profile should contain the HTTP location of the
30
+ resource's Structure Definition. Resource.meta.profile either does
31
+ not exist in this resource, or its contents do not point to a valid
32
+ location for type Parameters. **NOTE:**
33
+ If this error occurs, it can trigger a fail for all parameters-type tests,
34
+ regardless of whether both tests were meant to run.)
35
+
36
+ data_to_test.each do |resource|
37
+ # All these assertions are to differentiate Parameters data between orientation types.
38
+ # A resource is skipped if it cannot be identified as an data_urls resource.
39
+ type_identifier = resource.to_hash
40
+ assert type_identifier['meta'].present?, identifier_fail_message
41
+
42
+ type_identifier = type_identifier['meta']
43
+ assert type_identifier.is_a?(Hash), identifier_fail_message
44
+ assert type_identifier['profile'].present?, identifier_fail_message
45
+
46
+ type_identifier = type_identifier['profile']
47
+ assert type_identifier.is_a?(Array), identifier_fail_message
48
+ assert !type_identifier.empty?, identifier_fail_message
49
+
50
+
51
+ type_identifier = type_identifier.first
52
+ assert type_identifier.is_a?(String), identifier_fail_message
53
+ if !type_identifier.include?("-data-urls-")
54
+ next
55
+ end
56
+
57
+ no_resource_of_this_type = false
58
+
59
+ assert_valid_resource(resource: resource, profile_url: profile_with_version)
60
+ end
61
+
62
+ omit_if no_resource_of_this_type, "No data of this type was identified."
63
+ end
64
+ end
65
+ end
@@ -34,7 +34,7 @@ module UDSPlusTestKit
34
34
  regardless of whether both tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
- # All these assertions are to differentaite Observation data between orientation types.
37
+ # All these assertions are to differentiate Observation data between orientation types.
38
38
  # A resource is skipped if it cannot be identified as an income resource.
39
39
  type_identifier = resource.to_hash
40
40
  assert type_identifier['meta'].present?, identifier_fail_message
@@ -34,7 +34,7 @@ module UDSPlusTestKit
34
34
  regardless of whether both tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
- # All these assertions are to differentaite Observation data between Income Data and Sexual Orientation data.
37
+ # All these assertions are to differentiate Observation data between Income Data and Sexual Orientation data.
38
38
  # A resource is skipped if it is a sexual orientation resource and fails if it cannot be identified as an income resource.
39
39
  type_identifier = resource.to_hash
40
40
  assert type_identifier['meta'].present?, identifier_fail_message
@@ -0,0 +1,65 @@
1
+ require 'json'
2
+ require_relative './version'
3
+
4
+ module UDSPlusTestKit
5
+ class ValidatePatientReportingParametersTest < Inferno::Test
6
+ id :uds_plus_validate_patient_reporting_parameters_test
7
+ title 'Validate UDS+ Patient Reporting Parameters Data'
8
+ description %(
9
+ Test takes the Patient Reporting Parameters resources identified
10
+ by the import manifest, and validates whether they conform
11
+ to their UDS+ Structure Definitions.
12
+ )
13
+
14
+ def data_scratch
15
+ scratch[:data_resources] ||= {}
16
+ end
17
+
18
+ def data_to_test
19
+ data_scratch['Parameters'] ||= []
20
+ end
21
+
22
+ run do
23
+ omit_if data_to_test.empty?, "No data of this type was identified."
24
+
25
+ profile_definition = 'http://hl7.org/fhir/us/uds-plus/StructureDefinition/uds-plus-patient-reporting-parameters'
26
+ profile_with_version = "#{profile_definition}|#{UDS_PLUS_VERSION}"
27
+
28
+ no_resource_of_this_type = true
29
+ identifier_fail_message = %(Resource.meta.profile should contain the HTTP location of the
30
+ resource's Structure Definition. Resource.meta.profile either does
31
+ not exist in this resource, or its contents do not point to a valid
32
+ location for type Parameters. **NOTE:**
33
+ If this error occurs, it can trigger a fail for all parameters-type tests,
34
+ regardless of whether both tests were meant to run.)
35
+
36
+ data_to_test.each do |resource|
37
+ # All these assertions are to differentiate Parameters data between orientation types.
38
+ # A resource is skipped if it cannot be identified as a patient reporting parameters resource.
39
+ type_identifier = resource.to_hash
40
+ assert type_identifier['meta'].present?, identifier_fail_message
41
+
42
+ type_identifier = type_identifier['meta']
43
+ assert type_identifier.is_a?(Hash), identifier_fail_message
44
+ assert type_identifier['profile'].present?, identifier_fail_message
45
+
46
+ type_identifier = type_identifier['profile']
47
+ assert type_identifier.is_a?(Array), identifier_fail_message
48
+ assert !type_identifier.empty?, identifier_fail_message
49
+
50
+
51
+ type_identifier = type_identifier.first
52
+ assert type_identifier.is_a?(String), identifier_fail_message
53
+ if !type_identifier.include?("patient-reporting")
54
+ next
55
+ end
56
+
57
+ no_resource_of_this_type = false
58
+
59
+ assert_valid_resource(resource: resource, profile_url: profile_with_version)
60
+ end
61
+
62
+ omit_if no_resource_of_this_type, "No data of this type was identified."
63
+ end
64
+ end
65
+ end
@@ -34,7 +34,7 @@ module UDSPlusTestKit
34
34
  regardless of whether both tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
- # All these assertions are to differentaite Observation data between orientation types.
37
+ # All these assertions are to differentiate Observation data between orientation types.
38
38
  # A resource is skipped if it cannot be identified as a sexual orientation resource.
39
39
  type_identifier = resource.to_hash
40
40
  assert type_identifier['meta'].present?, identifier_fail_message
@@ -32,7 +32,7 @@ module UDSPlusTestKit
32
32
  regardless of whether both tests were meant to run.)
33
33
 
34
34
  data_to_test.each do |resource|
35
- # All these assertions are to differentaite Observation data between orientation types.
35
+ # All these assertions are to differentiate Observation data between orientation types.
36
36
  # A resource is skipped if it is one of the observation types with their own tests.
37
37
  type_identifier = resource.to_hash
38
38
  assert type_identifier['meta'].present?, identifier_fail_message
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UDSPlusTestKit
4
- VERSION = '1.0.4'
4
+ VERSION = '1.0.6'
5
5
  UDS_PLUS_VERSION = '1.0.0'
6
6
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: uds_plus_test_kit
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leap Orbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-08 00:00:00.000000000 Z
11
+ date: 2023-12-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core
@@ -101,6 +101,7 @@ files:
101
101
  - lib/uds_plus_test_kit/input_resource_tests/read_allergy_intolerance_test.rb
102
102
  - lib/uds_plus_test_kit/input_resource_tests/read_clinical_result_test.rb
103
103
  - lib/uds_plus_test_kit/input_resource_tests/read_coverage_test.rb
104
+ - lib/uds_plus_test_kit/input_resource_tests/read_data_urls_test.rb
104
105
  - lib/uds_plus_test_kit/input_resource_tests/read_diagnosis_test.rb
105
106
  - lib/uds_plus_test_kit/input_resource_tests/read_encounter_test.rb
106
107
  - lib/uds_plus_test_kit/input_resource_tests/read_immunization_test.rb
@@ -110,6 +111,7 @@ files:
110
111
  - lib/uds_plus_test_kit/input_resource_tests/read_manifest_ind_test.rb
111
112
  - lib/uds_plus_test_kit/input_resource_tests/read_med_request_test.rb
112
113
  - lib/uds_plus_test_kit/input_resource_tests/read_med_statement_test.rb
114
+ - lib/uds_plus_test_kit/input_resource_tests/read_patient_reporting_parameters_test.rb
113
115
  - lib/uds_plus_test_kit/input_resource_tests/read_patient_test.rb
114
116
  - lib/uds_plus_test_kit/input_resource_tests/read_procedure_test.rb
115
117
  - lib/uds_plus_test_kit/input_resource_tests/read_related_person_test.rb
@@ -130,6 +132,7 @@ files:
130
132
  - lib/uds_plus_test_kit/validate_allergy_intolerance_test.rb
131
133
  - lib/uds_plus_test_kit/validate_clinical_result_test.rb
132
134
  - lib/uds_plus_test_kit/validate_coverage_test.rb
135
+ - lib/uds_plus_test_kit/validate_data_urls_test.rb
133
136
  - lib/uds_plus_test_kit/validate_diagnosis_test.rb
134
137
  - lib/uds_plus_test_kit/validate_encounter_test.rb
135
138
  - lib/uds_plus_test_kit/validate_immunization_test.rb
@@ -138,6 +141,7 @@ files:
138
141
  - lib/uds_plus_test_kit/validate_location_test.rb
139
142
  - lib/uds_plus_test_kit/validate_med_request_test.rb
140
143
  - lib/uds_plus_test_kit/validate_med_statement_test.rb
144
+ - lib/uds_plus_test_kit/validate_patient_reporting_parameters_test.rb
141
145
  - lib/uds_plus_test_kit/validate_patient_test.rb
142
146
  - lib/uds_plus_test_kit/validate_procedure_test.rb
143
147
  - lib/uds_plus_test_kit/validate_related_person_test.rb