uds_plus_test_kit 1.0.7 → 1.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/lib/uds_plus_test_kit/examples/adverse_event.ndjson +1 -0
  3. data/lib/uds_plus_test_kit/examples/allergy_intollerance.ndjson +1 -0
  4. data/lib/uds_plus_test_kit/examples/condition.ndjson +1 -1
  5. data/lib/uds_plus_test_kit/examples/coverage.ndjson +1 -0
  6. data/lib/uds_plus_test_kit/examples/data_urls.ndjson +1 -0
  7. data/lib/uds_plus_test_kit/examples/encounter.ndjson +1 -1
  8. data/lib/uds_plus_test_kit/examples/immunization.ndjson +1 -0
  9. data/lib/uds_plus_test_kit/examples/location.ndjson +1 -0
  10. data/lib/uds_plus_test_kit/examples/manifest.json +204 -0
  11. data/lib/uds_plus_test_kit/examples/medication_request.ndjson +1 -0
  12. data/lib/uds_plus_test_kit/examples/medication_statement.ndjson +1 -0
  13. data/lib/uds_plus_test_kit/examples/observation.ndjson +6 -4
  14. data/lib/uds_plus_test_kit/examples/patient.ndjson +3 -2
  15. data/lib/uds_plus_test_kit/examples/procedure.ndjson +1 -0
  16. data/lib/uds_plus_test_kit/examples/related_person.ndjson +1 -0
  17. data/lib/uds_plus_test_kit/examples/reporting_parameters.ndjson +1 -0
  18. data/lib/uds_plus_test_kit/examples/service_request.ndjson +1 -0
  19. data/lib/uds_plus_test_kit/input_resource_tests/read_observation_test.rb +54 -0
  20. data/lib/uds_plus_test_kit/input_resource_tests/resource_group.rb +4 -0
  21. data/lib/uds_plus_test_kit/manifest_tests/read_data_test.rb +14 -3
  22. data/lib/uds_plus_test_kit/manifest_tests/uds_plus_test_group.rb +2 -0
  23. data/lib/uds_plus_test_kit/post_tests/post_group.rb +2 -0
  24. data/lib/uds_plus_test_kit/uds_plus_test_suite.rb +55 -5
  25. data/lib/uds_plus_test_kit/validate_clinical_result_test.rb +1 -1
  26. data/lib/uds_plus_test_kit/validate_income_test.rb +1 -1
  27. data/lib/uds_plus_test_kit/validate_lab_test.rb +3 -3
  28. data/lib/uds_plus_test_kit/validate_observation_test.rb +65 -0
  29. data/lib/uds_plus_test_kit/validate_sexual_orientation_test.rb +1 -1
  30. data/lib/uds_plus_test_kit/validate_special_observation_test.rb +2 -2
  31. data/lib/uds_plus_test_kit/version.rb +2 -2
  32. metadata +18 -4
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a763cedfcbf10aee7e2b2986219ef4e71ae434f280e1927e47cad9e6540fdc27
4
- data.tar.gz: 97a822e549a1a295a82710873733967a1721bf0842c2a3ee826e70c9bc3dacc1
3
+ metadata.gz: ed7d6bf53a6a42927099680142517bfebe46c40a114f75511234aa120cc3b5a8
4
+ data.tar.gz: 50202697842a73535127a3163ca2fe6d1984eb0b8bc676cfca60a12fcd94fa16
5
5
  SHA512:
6
- metadata.gz: 149acbe1dcf091821dcc1af804b2a0e33c2b6aac9bb2474790b4865e21d5d9945e078d64cb38d06a18e63f6e8c6a6dc21acabf0f196cd734b741b2245f2ca0b8
7
- data.tar.gz: 466aa6cff410120418604d6780ab900e2ed11da4ac93ae5dbefff9e43f8e3b1fcb9458f210b072123a8ec83b216e8f449fb4372c7965bd5c193b56b250a6de6d
6
+ metadata.gz: 223ba819e78e68c3f68fadb3db5bcaf39f094f976ca1c3d4a91f49ae34d9032019f13170101c5b48de1483a5fa7f68ced256101cf319801ca02ceb1985a57a2f
7
+ data.tar.gz: 52a79a18d25ff80def8d233db7354c6d75ed1420ed0062a56df11acab4fa48f34774a0cdabef89f3480a0eb1a484c828b8afc89c86421eee121e607a6cb77c9d
@@ -0,0 +1 @@
1
+ {"resourceType":"AdverseEvent","id":"de-identified-example","meta":{"lastUpdated":"2017-05-26T11:56:57.250-04:00","profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-adverseevent"]},"actuality":"actual","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/adverse-event-category","code":"medication-mishap","display":"Medication Mishap"}],"text":"Medication Mishap - Wrong Dose"}],"event":{"coding":[{"system":"http://snomed.info/sct","code":"140004","display":"Chronic Pharyngitis"}],"text":"Chronic Pharyngitis"},"subject":{"reference":"Patient/de-identified-example"},"date":"2015","recordedDate":"2017"}
@@ -0,0 +1 @@
1
+ {"resourceType":"AllergyIntolerance","id":"de-identified-example","meta":{"lastUpdated":"2017-05-26T11:56:57.250-04:00","profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-allergyintolerance"]},"clinicalStatus":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/allergyintolerance-clinical","code":"active"}]},"verificationStatus":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/allergyintolerance-verification","code":"confirmed"}]},"category":["medication"],"criticality":"high","code":{"coding":[{"system":"http://snomed.info/sct","code":"387406002","display":"Sulfonamide (substance)"}],"text":"sulfonamide antibacterial"},"patient":{"reference":"Patient/de-identified-example"},"onsetDateTime":"2015","recordedDate":"2017","reaction":[{"manifestation":[{"coding":[{"system":"http://snomed.info/sct","code":"271807003","display":"skin rash"}],"text":"skin rash"}],"severity":"mild"}]}
@@ -1 +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://fhir.org/guides/hrsa/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"}
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://fhir.org/guides/hrsa/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": "Coverage", "id": "de-identified-example", "meta": { "profile": [ "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-coverage" ] }, "extension": [ { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-capitated-member-months-extension", "valueQuantity": { "value": 36, "unit": "yr", "system": "http://unitsofmeasure.org", "code": "a" } }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-feeforservice-member-months-extension", "valueQuantity": { "value": 36, "unit": "yr", "system": "http://unitsofmeasure.org", "code": "a" } } ], "status": "active", "type": { "coding": [ { "system": "http://fhir.org/guides/hrsa/uds-plus/CodeSystem/uds-plus-insurance-codes", "code": "private-insurance", "display": "Private Insurance" } ] }, "beneficiary": { "reference": "Patient/de-identified-example" }, "period": { "start": "2019", "end": "2023" }, "payor": [ { "reference": "Organization/acme-payer" } ]}
@@ -0,0 +1 @@
1
+ { "resourceType": "Parameters", "id": "de-identify-data-operation-urls-example", "meta": { "profile": [ "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-deidentify-operation-data-urls-parameter" ] }, "parameter": [ { "name": "format", "valueCode": "fhir+ndjson" }, { "name": "udsData", "part": [ { "name": "resourceType", "valueCode": "Patient" }, { "name": "resourceUrl", "valueUrl": "http://example.com/Patient.ndjson" } ] } ]}
@@ -1 +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://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-encounter" ] }, "extension": [ { "url": "http://fhir.org/guides/hrsa/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": "99202" } ] } ], "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" } } ]}
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://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-encounter"]},"extension":[{"url":"http://fhir.org/guides/hrsa/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":"99202"}]}],"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":"Immunization","id":"de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-immunization"]},"status":"completed","statusReason":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/condition-category","code":"encounter-diagnosis","display":"Encounter Diagnosis"}]},"vaccineCode":{"coding":[{"system":"http://hl7.org/fhir/sid/cvx","code":"197","display":"influenza, high-dose, quadrivalent"}]},"patient":{"reference":"Patient/de-identified-example"},"occurrenceDateTime":"2023","recorded":"2023","primarySource":true}
@@ -0,0 +1 @@
1
+ { "resourceType": "Location", "id": "hospital", "meta": { "profile": [ "http://hl7.org/fhir/us/core/StructureDefinition/us-core-location", "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-location" ] }, "text": { "status": "extensions", "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\"><p><b> Location</b><a name=\"Holy Family hospital\"> </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 Location &quot;hospital&quot; </p><p style=\"margin-bottom: 0px\"></p></div><p><b>status</b>: active</p><p><b>name</b>: Holy Family Hospital</p><p><b>telecom</b>: ph: 9786870156</p><p><b>address</b>: 70 EAST STREET METHUEN MA 01844 US </p><p><b>managingOrganization</b>: <a href=\"Organization-holy-healthcare.html\">Organization/holy-healthcare: Holy Healthcare</a> &quot;Holy Healthcare&quot;</p></div>" }, "status": "active", "name": "Holy Family Hospital", "telecom": [ { "system": "phone", "value": "9786870156" } ], "address": { "line": [ "70 EAST STREET" ], "city": "METHUEN", "state": "MA", "postalCode": "01844", "country": "US" }, "managingOrganization": { "reference": "Organization/holy-healthcare", "display": "Holy Healthcare" }}
@@ -133,6 +133,176 @@
133
133
  }
134
134
  ]
135
135
  },
136
+ {
137
+ "name": "udsData",
138
+ "part": [
139
+ {
140
+ "name": "type",
141
+ "valueCode": "AdverseEvent"
142
+ },
143
+ {
144
+ "name": "url",
145
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/adverse_event"
146
+ },
147
+ {
148
+ "name": "expirationTime",
149
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
150
+ }
151
+ ]
152
+ },
153
+ {
154
+ "name": "udsData",
155
+ "part": [
156
+ {
157
+ "name": "type",
158
+ "valueCode": "AllergyIntolerance"
159
+ },
160
+ {
161
+ "name": "url",
162
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/allergy_intollerance"
163
+ },
164
+ {
165
+ "name": "expirationTime",
166
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
167
+ }
168
+ ]
169
+ },
170
+ {
171
+ "name": "udsData",
172
+ "part": [
173
+ {
174
+ "name": "type",
175
+ "valueCode": "Coverage"
176
+ },
177
+ {
178
+ "name": "url",
179
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/coverage"
180
+ },
181
+ {
182
+ "name": "expirationTime",
183
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
184
+ }
185
+ ]
186
+ },
187
+ {
188
+ "name": "udsData",
189
+ "part": [
190
+ {
191
+ "name": "type",
192
+ "valueCode": "Immunization"
193
+ },
194
+ {
195
+ "name": "url",
196
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/immunization"
197
+ },
198
+ {
199
+ "name": "expirationTime",
200
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
201
+ }
202
+ ]
203
+ },
204
+ {
205
+ "name": "udsData",
206
+ "part": [
207
+ {
208
+ "name": "type",
209
+ "valueCode": "MedicationRequest"
210
+ },
211
+ {
212
+ "name": "url",
213
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/medication_request"
214
+ },
215
+ {
216
+ "name": "expirationTime",
217
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
218
+ }
219
+ ]
220
+ },
221
+ {
222
+ "name": "udsData",
223
+ "part": [
224
+ {
225
+ "name": "type",
226
+ "valueCode": "MedicationStatement"
227
+ },
228
+ {
229
+ "name": "url",
230
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/medication_statement"
231
+ },
232
+ {
233
+ "name": "expirationTime",
234
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
235
+ }
236
+ ]
237
+ },
238
+ {
239
+ "name": "udsData",
240
+ "part": [
241
+ {
242
+ "name": "type",
243
+ "valueCode": "Procedure"
244
+ },
245
+ {
246
+ "name": "url",
247
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/procedure"
248
+ },
249
+ {
250
+ "name": "expirationTime",
251
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
252
+ }
253
+ ]
254
+ },
255
+ {
256
+ "name": "udsData",
257
+ "part": [
258
+ {
259
+ "name": "type",
260
+ "valueCode": "RelatedPerson"
261
+ },
262
+ {
263
+ "name": "url",
264
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/related_person"
265
+ },
266
+ {
267
+ "name": "expirationTime",
268
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
269
+ }
270
+ ]
271
+ },
272
+ {
273
+ "name": "udsData",
274
+ "part": [
275
+ {
276
+ "name": "type",
277
+ "valueCode": "Parameters"
278
+ },
279
+ {
280
+ "name": "url",
281
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/reporting_parameters"
282
+ },
283
+ {
284
+ "name": "expirationTime",
285
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
286
+ }
287
+ ]
288
+ },
289
+ {
290
+ "name": "udsData",
291
+ "part": [
292
+ {
293
+ "name": "type",
294
+ "valueCode": "ServiceRequest"
295
+ },
296
+ {
297
+ "name": "url",
298
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/service_request"
299
+ },
300
+ {
301
+ "name": "expirationTime",
302
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
303
+ }
304
+ ]
305
+ },
136
306
  {
137
307
  "name": "udsData",
138
308
  "part": [
@@ -149,6 +319,40 @@
149
319
  "valueDateTime": "2022-12-14T07:15:07-08:00"
150
320
  }
151
321
  ]
322
+ },
323
+ {
324
+ "name": "udsData",
325
+ "part": [
326
+ {
327
+ "name": "type",
328
+ "valueCode": "Parameters"
329
+ },
330
+ {
331
+ "name": "url",
332
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/data_urls"
333
+ },
334
+ {
335
+ "name": "expirationTime",
336
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
337
+ }
338
+ ]
339
+ },
340
+ {
341
+ "name": "udsData",
342
+ "part": [
343
+ {
344
+ "name": "type",
345
+ "valueCode": "Location"
346
+ },
347
+ {
348
+ "name": "url",
349
+ "valueUrl": "http://localhost:4567/custom/uds_plus/examples/location"
350
+ },
351
+ {
352
+ "name": "expirationTime",
353
+ "valueDateTime": "2022-12-14T07:15:07-08:00"
354
+ }
355
+ ]
152
356
  }
153
357
  ]
154
358
  }
@@ -0,0 +1 @@
1
+ {"resourceType":"MedicationRequest","id":"de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-medicationrequest"]},"status":"active","intent":"order","medicationCodeableConcept":{"coding":[{"system":"http://www.nlm.nih.gov/research/umls/rxnorm","code":"476872","display":"Nizatidine 15 MG/ML Oral Solution"}]},"subject":{"reference":"Patient/de-identified-example"},"encounter":{"reference":"Encounter/de-identified-example"},"authoredOn":"2008","requester":{"reference":"Practitioner/example"},"dosageInstruction":[{"text":"10 mL bid","timing":{"repeat":{"boundsPeriod":{"start":"2008-04-05"},"frequency":2,"period":1,"periodUnit":"d"}},"doseAndRate":[{"doseQuantity":{"value":10,"unit":"ml","system":"http://unitsofmeasure.org","code":"mL"}}]}]}
@@ -0,0 +1 @@
1
+ {"resourceType":"MedicationStatement","id":"de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-medicationstatement"]},"status":"active","medicationCodeableConcept":{"coding":[{"system":"http://www.nlm.nih.gov/research/umls/rxnorm","code":"476872","display":"Nizatidine 15 MG/ML Oral Solution"}]},"subject":{"reference":"Patient/de-identified-example"},"effectiveDateTime":"2008","dateAsserted":"2008","dosage":[{"text":"10 mL bid","timing":{"repeat":{"boundsPeriod":{"start":"2008-04-05"},"frequency":2,"period":1,"periodUnit":"d"}},"doseAndRate":[{"doseQuantity":{"value":10,"unit":"ml","system":"http://unitsofmeasure.org","code":"mL"}}]}]}
@@ -1,4 +1,6 @@
1
- { "resourceType": "Observation", "id": "de-identified-example", "meta": { "profile": [ "http://fhir.org/guides/hrsa/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-with-quantity-example", "meta": { "profile": [ "http://fhir.org/guides/hrsa/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": "2018", "valueQuantity": { "value": 200, "unit": "percent", "system": "http://unitsofmeasure.org", "code": "%", "comparator": ">" }}
3
- { "resourceType": "Observation", "id": "de-identified-income-example", "meta": { "profile": [ "http://fhir.org/guides/hrsa/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", "valueRange": { "low": { "value": 101 }, "high": { "value": 150 } }}
4
- { "resourceType": "Observation", "id": "de-identified-sexual-orientation-example", "meta": { "profile": [ "http://fhir.org/guides/hrsa/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://terminology.hl7.org/CodeSystem/v3-NullFlavor", "code": "NASK", "display": "not asked" } ] }}
1
+ {"resourceType":"Observation","id":"de-identified-income-example","meta":{"profile":["http://fhir.org/guides/hrsa/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","valueRange":{"low":{"value":101},"high":{"value":150}}}
2
+ {"resourceType":"Observation","id":"de-identified-income-with-quantity-example","meta":{"profile":["http://fhir.org/guides/hrsa/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":"2018","valueQuantity":{"value":200,"comparator":">","unit":"percent","system":"http://unitsofmeasure.org","code":"%"}}
3
+ {"resourceType":"Observation","id":"de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-lab-observation"]},"extension":[{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-deidentified-instant-extension","valueDateTime":"2005"}],"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","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"}]}}
4
+ {"resourceType":"Observation","id":"de-identified-sexual-orientation-example","meta":{"profile":["http://fhir.org/guides/hrsa/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://terminology.hl7.org/CodeSystem/v3-NullFlavor","code":"NASK","display":"not asked"}]}}
5
+ {"resourceType":"Observation","id":"clinical-result-de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-clinical-result-observation"]},"extension":[{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-deidentified-instant-extension","valueDateTime":"2005"}],"status":"final","category":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/observation-category","code":"imaging","display":"Imaging"}]}],"code":{"coding":[{"system":"http://loinc.org","code":"80940-0","display":"DXA Femur-L Z-score BMD"}]},"subject":{"reference":"Patient/de-identified-example"},"encounter":{"reference":"Encounter/de-identified-example"},"effectivePeriod":{"end":"2005"},"performer":[{"reference":"Practitioner/example"}],"valueQuantity":{"value":0.05,"unit":"Z-Score","system":"http://unitsofmeasure.org","code":"{Z-Score}"}}
6
+ { "resourceType": "Observation", "id": "generic-observation-de-identified-example", "meta": { "profile": [ "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-observation" ] }, "extension": [ { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-deidentified-instant-extension", "valueDateTime": "2005" } ], "status": "final", "category": [ { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/observation-category", "code": "social-history", "display": "Social History" } ] } ], "code": { "coding": [ { "system": "http://snomed.info/sct", "code": "160695008", "display": "Transport too expensive" } ] }, "subject": { "reference": "Patient/de-identified-example" }, "effectiveDateTime": "2021", "valueBoolean": true}
@@ -1,2 +1,3 @@
1
- { "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://fhir.org/guides/hrsa/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" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2108-9", "display" : "European" } }, { "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" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2184-0", "display" : "Dominican" } }, { "url": "text", "valueString": "Hispanic or Latino" } ], "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-birthsex-extension", "valueCode": "F" }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-age-extension", "valueQuantity": { "value" : 36, "unit" : "yr", "system" : "http://unitsofmeasure.org", "code" : "a" } }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-gender-identity-extension", "valueCodeableConcept": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor", "code": "NASK", "display": "Not Asked" } ], "text": "Not Asked" } } ], "active": true, "gender": "female", "address": [ { "postalCode": "00000", "_postalCode": { "extension" : [ { "url" : "http://hl7.org/fhir/StructureDefinition/data-absent-reason", "valueCode" : "masked" }] } } ]}
2
- { "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://fhir.org/guides/hrsa/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" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2108-9", "display" : "European" } }, { "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" : "detailed", "valueCoding" : { "system" : "urn:oid:2.16.840.1.113883.6.238", "code" : "2184-0", "display" : "Dominican" } }, { "url": "text", "valueString": "Hispanic or Latino" } ], "url": "http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity" }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-birthsex-extension", "valueCode": "F" }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-age-extension", "valueQuantity": { "value" : 36, "unit" : "yr", "system" : "http://unitsofmeasure.org", "code" : "a" } }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-gender-identity-extension", "valueCodeableConcept": { "coding": [ { "system": "http://terminology.hl7.org/CodeSystem/v3-NullFlavor", "code": "ASKU", "display": "asked but unknown" } ], "text": "asked but unknown" } }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/udsplus-agriculture-worker-status", "valueCode": "migratory" }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-housing-status-extension", "valueCode": "permanent-supportive-housing" }, { "url": "http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-veteran-status-extension", "valueBoolean": false } ], "active": true, "gender": "female", "address": [ { "postalCode": "03600" } ]}
1
+ {"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://fhir.org/guides/hrsa/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":"detailed","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2108-9","display":"European"}},{"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":"detailed","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2184-0","display":"Dominican"}},{"url":"text","valueString":"Hispanic or Latino"}],"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-birthsex-extension","valueCode":"F"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-age-extension","valueQuantity":{"value":90,"comparator":">=","unit":"yr","system":"http://unitsofmeasure.org","code":"a"}},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-gender-identity-extension","valueCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","code":"NASK","display":"Not Asked"}],"text":"Not Asked"}}],"active":true,"gender":"female","address":[{"postalCode":"00000","_postalCode":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/data-absent-reason","valueCode":"masked"}]}}]}
2
+ {"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://fhir.org/guides/hrsa/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":"detailed","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2108-9","display":"European"}},{"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":"detailed","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2184-0","display":"Dominican"}},{"url":"text","valueString":"Hispanic or Latino"}],"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-birthsex-extension","valueCode":"F"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-age-extension","valueQuantity":{"value":70,"unit":"yr","system":"http://unitsofmeasure.org","code":"a"}},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-gender-identity-extension","valueCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","code":"ASKU","display":"asked but unknown"}],"text":"asked but unknown"}},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/udsplus-agriculture-worker-status","valueCode":"migratory"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-housing-status-extension","valueCode":"permanent-supportive-housing"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-veteran-status-extension","valueBoolean":false}],"active":true,"gender":"female","address":[{"postalCode":"03600"}]}
3
+ {"resourceType":"Patient","id":"de-identified-age89-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://fhir.org/guides/hrsa/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":"detailed","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2108-9","display":"European"}},{"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":"detailed","valueCoding":{"system":"urn:oid:2.16.840.1.113883.6.238","code":"2184-0","display":"Dominican"}},{"url":"text","valueString":"Hispanic or Latino"}],"url":"http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-birthsex-extension","valueCode":"F"},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-age-extension","valueQuantity":{"value":90,"comparator":">=","unit":"yr","system":"http://unitsofmeasure.org","code":"a"}},{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-gender-identity-extension","valueCodeableConcept":{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-NullFlavor","code":"NASK","display":"Not Asked"}],"text":"Not Asked"}}],"active":true,"gender":"female","address":[{"postalCode":"00000","_postalCode":{"extension":[{"url":"http://hl7.org/fhir/StructureDefinition/data-absent-reason","valueCode":"masked"}]}}]}
@@ -0,0 +1 @@
1
+ {"resourceType":"Procedure","id":"de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-procedure"]},"extension":[{"url":"http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-recordedDate-extension","valueDateTime":"2005"}],"status":"completed","code":{"coding":[{"system":"http://snomed.info/sct","code":"48387007","display":"Tracheotomy"}]},"subject":{"reference":"Patient/de-identified-example"},"encounter":{"reference":"Encounter/de-identified-example"},"performedDateTime":"2005","performer":[{"actor":{"reference":"Practitioner/example"}}],"bodySite":[{"coding":[{"system":"http://snomed.info/sct","code":"44567001","display":"Tracheal structure"}]}]}
@@ -0,0 +1 @@
1
+ {"resourceType":"RelatedPerson","id":"de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/de-identified-uds-plus-relatedperson"]},"patient":{"reference":"Patient/de-identified-example"},"relationship":[{"coding":[{"system":"http://terminology.hl7.org/CodeSystem/v3-RoleCode","code":"FAMMEMB","display":"family member"}]}]}
@@ -0,0 +1 @@
1
+ {"resourceType":"Parameters","id":"reporting-parameters-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-patient-reporting-parameters"]},"parameter":[{"name":"patientReference","valueReference":{"reference":"Patient/de-identified-example"}},{"name":"combinedFundingStreams","valueString":"CHC,MHC"},{"name":"reportNames","part":[{"name":"patientsByZip","valueBoolean":true},{"name":"table3A","valueBoolean":true},{"name":"table3B","valueBoolean":true},{"name":"table4","valueBoolean":true},{"name":"table6A","valueBoolean":true},{"name":"table6B-Line1-6-Age-Of-Prenatal-Care-Patients","valueBoolean":false},{"name":"table6B-Line7-9-Early-Entry-Into-Prenatal-Care","valueBoolean":true},{"name":"table6B-Line10-Childhood-Immunization-Status-CMS117","valueBoolean":true},{"name":"table6B-Line11-Cervical-Cancer-Screening-CMS124","valueBoolean":true},{"name":"table6B-Line11a-Breast-Cancer-Screening-CMS125","valueBoolean":true},{"name":"table6B-Line12-Weight-Assessment-And-Counselling-CMS155","valueBoolean":true},{"name":"table6B-Line13-Preventive-Care-And-Screening-BMI-CMS69","valueBoolean":true},{"name":"table6B-Line14a-Preventive-Care-And-Screening-Tobacco-Use-CMS138","valueBoolean":true},{"name":"table6B-Line17a-Statin-Therapy-CMS347","valueBoolean":true},{"name":"table6B-Line18-Ischmic-Vascular-Disease-CMS164","valueBoolean":true},{"name":"table6B-Line19-Colorectal-Cancer-Screening-CMS130","valueBoolean":true},{"name":"table6B-Line20-HIV-Linkage-To-Care","valueBoolean":true},{"name":"table6B-Line20a-HIV-Screening-CMS349","valueBoolean":true},{"name":"table6B-Line21-Preventive-Care-And-Screening-For-Depression-CMS2","valueBoolean":true},{"name":"table6B-Line21a-Depression-Remission-At-Twelve-Months-CMS159","valueBoolean":true},{"name":"table6B-Line22-Dental-Sealants-For-Children-CMS277","valueBoolean":true},{"name":"table7-Line0-HIV-Positive-Pregnant-Patients","valueBoolean":true},{"name":"table7-Line2-Deliveries-Performed-By-Health-Center","valueBoolean":true},{"name":"table7-Line1a-d-Prenatal-Care-Patient-Deliveries","valueBoolean":true},{"name":"table7-Line2a-c-Controlling-High-Blood-Pressure-CMS165","valueBoolean":true},{"name":"table7-Line3a-f-HbA1c-Poor-Control-CMS122","valueBoolean":true}]}]}
@@ -0,0 +1 @@
1
+ {"resourceType":"ServiceRequest","id":"de-identified-example","meta":{"profile":["http://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-servicerequest"]},"status":"completed","intent":"order","doNotPerform":false,"code":{"coding":[{"system":"http://snomed.info/sct","code":"76164006","display":"Biopsy of colon (procedure)"}]},"subject":{"reference":"Patient/de-identified-example"},"encounter":{"reference":"Encounter/de-identified-example"},"authoredOn":"2017","requester":{"reference":"Practitioner/example"},"bodySite":[{"coding":[{"system":"http://snomed.info/sct","code":"485005","display":"Transverse colon structure"}]}]}
@@ -0,0 +1,54 @@
1
+ require 'json'
2
+
3
+ module UDSPlusTestKit
4
+ class ReadObservationTest < Inferno::Test
5
+ id :uds_plus_read_observation_test
6
+ title 'Receive UDS+ Observation Data'
7
+ description %(
8
+ Test takes from the user either: the http location of observation data
9
+ (not including UDS+ specialized observation resources) 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 :observation_data,
15
+ title: 'UDS+ 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/observation.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 !observation_data.present?, "No data provided; skipping test."
33
+
34
+ # if the input is a url, else it is a json
35
+ if observation_data.strip[0] != '{'
36
+ assert_valid_http_uri(observation_data, "Location provided is not a valid http uri.")
37
+ get 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(observation_data, "JSON inputted was not in a valid format")
43
+ data = 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
@@ -15,6 +15,8 @@ require_relative '../validate_procedure_test'
15
15
  require_relative '../validate_sexual_orientation_test'
16
16
  require_relative './read_manifest_ind_test'
17
17
  require_relative '../manifest_tests/validate_manifest_test'
18
+ require_relative './read_observation_test'
19
+ require_relative '../validate_observation_test'
18
20
  require_relative './read_special_observation_test'
19
21
  require_relative '../validate_special_observation_test'
20
22
  require_relative './read_related_person_test'
@@ -87,6 +89,8 @@ module UDSPlusTestKit
87
89
  test from: :uds_plus_validate_lab_test
88
90
  test from: :uds_plus_read_clinical_result_test
89
91
  test from: :uds_plus_validate_clinical_result_test
92
+ test from: :uds_plus_read_observation_test
93
+ test from: :uds_plus_validate_observation_test
90
94
  test from: :uds_plus_read_special_observation_test
91
95
  test from: :uds_plus_validate_special_observation_test
92
96
  test from: :uds_plus_read_medication_request_test
@@ -37,12 +37,16 @@ module UDSPlusTestKit
37
37
 
38
38
  profile_name = "NO NAME"
39
39
  profile_url = "NO URL"
40
+ bearer_token = "NO BEARER"
41
+
40
42
  source['part'].each do |container|
41
43
  case container['name']
42
44
  when 'type'
43
45
  profile_name = container['valueCode']
44
46
  when 'url'
45
47
  profile_url = container['valueUrl']
48
+ when 'bearer'
49
+ bearer_token = container['valueString']
46
50
  end
47
51
  end
48
52
 
@@ -55,8 +59,15 @@ module UDSPlusTestKit
55
59
 
56
60
  invalid_uri_message = "Invalid URL provided for type #{profile_name}"
57
61
  assert_valid_http_uri(profile_url, invalid_uri_message)
58
-
59
- get profile_url
62
+
63
+ oauth2_headers={}
64
+ if bearer_token != "NO BEARER"
65
+ oauth2_headers={
66
+ 'Authorization' => "Bearer #{bearer_token}"
67
+ }
68
+ end
69
+
70
+ get(profile_url, headers: oauth2_headers)
60
71
  assert_response_status(200)
61
72
 
62
73
  request.response_body.each_line do |json_body|
@@ -72,4 +83,4 @@ module UDSPlusTestKit
72
83
  end
73
84
  end
74
85
  end
75
- end
86
+ end
@@ -10,6 +10,7 @@ require_relative './validate_manifest_test'
10
10
  require_relative '../validate_patient_test'
11
11
  require_relative '../validate_procedure_test'
12
12
  require_relative '../validate_sexual_orientation_test'
13
+ require_relative '../validate_observation_test'
13
14
  require_relative '../validate_special_observation_test'
14
15
  require_relative '../validate_related_person_test'
15
16
  require_relative '../validate_immunization_test'
@@ -54,6 +55,7 @@ module UDSPlusTestKit
54
55
  test from: :uds_plus_validate_sexual_orientation_test
55
56
  test from: :uds_plus_validate_lab_test
56
57
  test from: :uds_plus_validate_clinical_result_test
58
+ test from: :uds_plus_validate_observation_test
57
59
  test from: :uds_plus_validate_special_observation_test
58
60
  test from: :uds_plus_validate_medication_request_test
59
61
  test from: :uds_plus_validate_medication_statement_test
@@ -15,6 +15,7 @@ require_relative '../validate_income_test'
15
15
  require_relative '../validate_patient_test'
16
16
  require_relative '../validate_procedure_test'
17
17
  require_relative '../validate_sexual_orientation_test'
18
+ require_relative '../validate_observation_test'
18
19
  require_relative '../validate_special_observation_test'
19
20
  require_relative '../validate_related_person_test'
20
21
  require_relative '../validate_immunization_test'
@@ -60,6 +61,7 @@ module UDSPlusTestKit
60
61
  test from: :uds_plus_validate_sexual_orientation_test
61
62
  test from: :uds_plus_validate_lab_test
62
63
  test from: :uds_plus_validate_clinical_result_test
64
+ test from: :uds_plus_validate_observation_test
63
65
  test from: :uds_plus_validate_special_observation_test
64
66
  test from: :uds_plus_validate_medication_request_test
65
67
  test from: :uds_plus_validate_medication_statement_test
@@ -9,7 +9,7 @@ module UDSPlusTestKit
9
9
  title 'UDS+ Test Kit'
10
10
  description %(
11
11
  The UDS+ Test Kit tests systems for their conformance to the [UDS+
12
- Implementation Guide v1.0.1](https://fhir.org/guides/hrsa/uds-plus/).
12
+ Implementation Guide v1.1.0](https://fhir.org/guides/hrsa/uds-plus/index.html).
13
13
  The included tests function as a rudimentary data receiver. This receiver will
14
14
  take a provided Import Manifest, either as an HTTP location or as a raw json,
15
15
  and validate its contents. This includes validating the structure of the manifest,
@@ -18,11 +18,13 @@ module UDSPlusTestKit
18
18
 
19
19
  version VERSION
20
20
 
21
- validator do
22
- url ENV.fetch('VALIDATOR_URL', 'http://validator_service:4567')
21
+ fhir_resource_validator do
22
+ # The home-lab-report contains validation tools for certain codes missing in the UDS+ package
23
+ igs('fhir.hrsa.uds-plus#1.1.0', 'hl7.fhir.us.home-lab-report#1.0.0')
23
24
 
24
25
  # Messages will be excluded if the block evaluates to a truthy value
25
26
  exclude_message do |message|
27
+ message.message.match?(/\A\S+: \S+: URL value '.*' does not resolve/) ||
26
28
  (message.type == 'warning' &&
27
29
  message.message.match?(/Global Profile reference .* could not be resolved, so has not been checked/)) ||
28
30
  (message.type == 'error' &&
@@ -66,6 +68,54 @@ module UDSPlusTestKit
66
68
  observation_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [observation_ex]] }
67
69
  route(:get, "/examples/observation", observation_ex_route_handler)
68
70
 
71
+ adverse_event_ex = File.read(File.join(__dir__, 'examples/adverse_event.ndjson'))
72
+ adverse_event_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [adverse_event_ex]] }
73
+ route(:get, "/examples/adverse_event", adverse_event_ex_route_handler)
74
+
75
+ allergy_intollerance_ex = File.read(File.join(__dir__, 'examples/allergy_intollerance.ndjson'))
76
+ allergy_intollerance_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [allergy_intollerance_ex]] }
77
+ route(:get, "/examples/allergy_intollerance", allergy_intollerance_ex_route_handler)
78
+
79
+ coverage_ex = File.read(File.join(__dir__, 'examples/coverage.ndjson'))
80
+ coverage_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [coverage_ex]] }
81
+ route(:get, "/examples/coverage", coverage_ex_route_handler)
82
+
83
+ immunization_ex = File.read(File.join(__dir__, 'examples/immunization.ndjson'))
84
+ immunization_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [immunization_ex]] }
85
+ route(:get, "/examples/immunization", immunization_ex_route_handler)
86
+
87
+ medication_request_ex = File.read(File.join(__dir__, 'examples/medication_request.ndjson'))
88
+ medication_request_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [medication_request_ex]] }
89
+ route(:get, "/examples/medication_request", medication_request_ex_route_handler)
90
+
91
+ medication_statement_ex = File.read(File.join(__dir__, 'examples/medication_statement.ndjson'))
92
+ medication_statement_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [medication_statement_ex]] }
93
+ route(:get, "/examples/medication_statement", medication_statement_ex_route_handler)
94
+
95
+ procedure_ex = File.read(File.join(__dir__, 'examples/procedure.ndjson'))
96
+ procedure_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [procedure_ex]] }
97
+ route(:get, "/examples/procedure", procedure_ex_route_handler)
98
+
99
+ related_person_ex = File.read(File.join(__dir__, 'examples/related_person.ndjson'))
100
+ related_person_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [related_person_ex]] }
101
+ route(:get, "/examples/related_person", related_person_ex_route_handler)
102
+
103
+ reporting_parameters_ex = File.read(File.join(__dir__, 'examples/reporting_parameters.ndjson'))
104
+ reporting_parameters_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [reporting_parameters_ex]] }
105
+ route(:get, "/examples/reporting_parameters", reporting_parameters_ex_route_handler)
106
+
107
+ service_request_ex = File.read(File.join(__dir__, 'examples/service_request.ndjson'))
108
+ service_request_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [service_request_ex]] }
109
+ route(:get, "/examples/service_request", service_request_ex_route_handler)
110
+
111
+ data_urls_ex = File.read(File.join(__dir__, 'examples/data_urls.ndjson'))
112
+ data_urls_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [data_urls_ex]] }
113
+ route(:get, "/examples/data_urls", data_urls_ex_route_handler)
114
+
115
+ location_ex = File.read(File.join(__dir__, 'examples/location.ndjson'))
116
+ location_ex_route_handler = proc { [200, { 'Content-Type' => 'application/ndjson' }, [location_ex]] }
117
+ route(:get, "/examples/location", location_ex_route_handler)
118
+
69
119
  # Receive Manifest via POST set-up
70
120
  resume_test_route :post, '/postHere' do |request|
71
121
  request.query_parameters["id"]
@@ -81,8 +131,8 @@ module UDSPlusTestKit
81
131
  url: 'https://github.com/inferno-framework/uds-plus-test-kit/'
82
132
  },
83
133
  {
84
- label: 'UDS+ Implementation Guide v1.0.1',
85
- url: 'https://fhir.org/guides/hrsa/uds-plus/'
134
+ label: 'UDS+ Implementation Guide v1.1.0',
135
+ url: 'https://fhir.org/guides/hrsa/uds-plus/index.html'
86
136
  }
87
137
  ]
88
138
 
@@ -31,7 +31,7 @@ module UDSPlusTestKit
31
31
  not exist in this resource, or its contents do not point to a valid
32
32
  location for type Observation. **NOTE:**
33
33
  If this error occurs, it can trigger a fail for all observation-type tests,
34
- regardless of whether both tests were meant to run.)
34
+ regardless of whether all such tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
37
  # All these assertions are to differentiate Observation data between orientation types.
@@ -31,7 +31,7 @@ module UDSPlusTestKit
31
31
  not exist in this resource, or its contents do not point to a valid
32
32
  location for type Observation. **NOTE:**
33
33
  If this error occurs, it can trigger a fail for all observation-type tests,
34
- regardless of whether both tests were meant to run.)
34
+ regardless of whether all such tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
37
  # All these assertions are to differentiate Observation data between orientation types.
@@ -31,11 +31,11 @@ module UDSPlusTestKit
31
31
  not exist in this resource, or its contents do not point to a valid
32
32
  location for type Observation. **NOTE:**
33
33
  If this error occurs, it can trigger a fail for all observation-type tests,
34
- regardless of whether both tests were meant to run.)
34
+ regardless of whether all such tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
- # All these assertions are to differentiate Observation data between Income Data and Sexual Orientation data.
38
- # A resource is skipped if it is a sexual orientation resource and fails if it cannot be identified as an income resource.
37
+ # All these assertions are to differentiate Observation data between orientation types.
38
+ # A resource is skipped if it cannot be identified as lab obsevation resource.
39
39
  type_identifier = resource.to_hash
40
40
  assert type_identifier['meta'].present?, identifier_fail_message
41
41
 
@@ -0,0 +1,65 @@
1
+ require 'json'
2
+ require_relative './version'
3
+
4
+ module UDSPlusTestKit
5
+ class ValidateObservationTest < Inferno::Test
6
+ id :uds_plus_validate_observation_test
7
+ title 'Validate UDS+ Observation Data'
8
+ description %(
9
+ Test takes the Observation resources identified
10
+ by the import manifest, and validates whether they conform
11
+ to their UDS+ Structure Definitions (not including UDS+ specialized observation resources).
12
+ )
13
+
14
+ def data_scratch
15
+ scratch[:data_resources] ||= {}
16
+ end
17
+
18
+ def data_to_test
19
+ data_scratch['Observation'] ||= []
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://fhir.org/guides/hrsa/uds-plus/StructureDefinition/uds-plus-observation'
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 Observation. **NOTE:**
33
+ If this error occurs, it can trigger a fail for all observation-type tests,
34
+ regardless of whether all such tests were meant to run.)
35
+
36
+ data_to_test.each do |resource|
37
+ # All these assertions are to differentiate Observation data between orientation types.
38
+ # A resource is skipped if it cannot be identified as a general observation 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?("uds-plus-observation")
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
@@ -31,7 +31,7 @@ module UDSPlusTestKit
31
31
  not exist in this resource, or its contents do not point to a valid
32
32
  location for type Observation. **NOTE:**
33
33
  If this error occurs, it can trigger a fail for all observation-type tests,
34
- regardless of whether both tests were meant to run.)
34
+ regardless of whether all such tests were meant to run.)
35
35
 
36
36
  data_to_test.each do |resource|
37
37
  # All these assertions are to differentiate Observation data between orientation types.
@@ -29,7 +29,7 @@ module UDSPlusTestKit
29
29
  not exist in this resource, or its contents do not point to a valid
30
30
  location for type Observation. **NOTE:**
31
31
  If this error occurs, it can trigger a fail for all observation-type tests,
32
- regardless of whether both tests were meant to run.)
32
+ regardless of whether all such tests were meant to run.)
33
33
 
34
34
  data_to_test.each do |resource|
35
35
  # All these assertions are to differentiate Observation data between orientation types.
@@ -49,7 +49,7 @@ module UDSPlusTestKit
49
49
  type_identifier = type_identifier.first
50
50
  assert type_identifier.is_a?(String), identifier_fail_message
51
51
 
52
- known_observations = ["income", "sexual-orientation", "-lab-", "clinical-result"]
52
+ known_observations = ["income", "sexual-orientation", "-lab-", "clinical-result", "uds-plus-observation"]
53
53
  is_known_observation = false
54
54
  known_observations.each do |cur|
55
55
  is_known_observation = (is_known_observation || type_identifier.include?(cur))
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module UDSPlusTestKit
4
- VERSION = '1.0.7'
5
- UDS_PLUS_VERSION = '1.0.1'
4
+ VERSION = '1.1.0'
5
+ UDS_PLUS_VERSION = '1.1.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.7
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Leap Orbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-01-10 00:00:00.000000000 Z
11
+ date: 2024-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: inferno_core
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 0.4.4
19
+ version: 0.4.37
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 0.4.4
26
+ version: 0.4.37
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: database_cleaner-sequel
29
29
  requirement: !ruby/object:Gem::Requirement
@@ -89,14 +89,26 @@ extra_rdoc_files: []
89
89
  files:
90
90
  - LICENSE
91
91
  - lib/uds_plus_test_kit.rb
92
+ - lib/uds_plus_test_kit/examples/adverse_event.ndjson
93
+ - lib/uds_plus_test_kit/examples/allergy_intollerance.ndjson
92
94
  - lib/uds_plus_test_kit/examples/condition.ndjson
95
+ - lib/uds_plus_test_kit/examples/coverage.ndjson
96
+ - lib/uds_plus_test_kit/examples/data_urls.ndjson
93
97
  - lib/uds_plus_test_kit/examples/encounter.ndjson
98
+ - lib/uds_plus_test_kit/examples/immunization.ndjson
94
99
  - lib/uds_plus_test_kit/examples/invalid_condition.ndjson
95
100
  - lib/uds_plus_test_kit/examples/invalid_encounter.ndjson
96
101
  - lib/uds_plus_test_kit/examples/invalid_patient.ndjson
102
+ - lib/uds_plus_test_kit/examples/location.ndjson
97
103
  - lib/uds_plus_test_kit/examples/manifest.json
104
+ - lib/uds_plus_test_kit/examples/medication_request.ndjson
105
+ - lib/uds_plus_test_kit/examples/medication_statement.ndjson
98
106
  - lib/uds_plus_test_kit/examples/observation.ndjson
99
107
  - lib/uds_plus_test_kit/examples/patient.ndjson
108
+ - lib/uds_plus_test_kit/examples/procedure.ndjson
109
+ - lib/uds_plus_test_kit/examples/related_person.ndjson
110
+ - lib/uds_plus_test_kit/examples/reporting_parameters.ndjson
111
+ - lib/uds_plus_test_kit/examples/service_request.ndjson
100
112
  - lib/uds_plus_test_kit/input_resource_tests/read_adverse_event_test.rb
101
113
  - lib/uds_plus_test_kit/input_resource_tests/read_allergy_intolerance_test.rb
102
114
  - lib/uds_plus_test_kit/input_resource_tests/read_clinical_result_test.rb
@@ -111,6 +123,7 @@ files:
111
123
  - lib/uds_plus_test_kit/input_resource_tests/read_manifest_ind_test.rb
112
124
  - lib/uds_plus_test_kit/input_resource_tests/read_med_request_test.rb
113
125
  - lib/uds_plus_test_kit/input_resource_tests/read_med_statement_test.rb
126
+ - lib/uds_plus_test_kit/input_resource_tests/read_observation_test.rb
114
127
  - lib/uds_plus_test_kit/input_resource_tests/read_patient_reporting_parameters_test.rb
115
128
  - lib/uds_plus_test_kit/input_resource_tests/read_patient_test.rb
116
129
  - lib/uds_plus_test_kit/input_resource_tests/read_procedure_test.rb
@@ -141,6 +154,7 @@ files:
141
154
  - lib/uds_plus_test_kit/validate_location_test.rb
142
155
  - lib/uds_plus_test_kit/validate_med_request_test.rb
143
156
  - lib/uds_plus_test_kit/validate_med_statement_test.rb
157
+ - lib/uds_plus_test_kit/validate_observation_test.rb
144
158
  - lib/uds_plus_test_kit/validate_patient_reporting_parameters_test.rb
145
159
  - lib/uds_plus_test_kit/validate_patient_test.rb
146
160
  - lib/uds_plus_test_kit/validate_procedure_test.rb