plan_executor 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +44 -0
- data/.simplecov +16 -0
- data/.travis.yml +13 -0
- data/Gemfile +26 -0
- data/Gemfile.lock +197 -0
- data/LICENSE +201 -0
- data/README.md +126 -0
- data/Rakefile +25 -0
- data/fixtures/daf/conformance-daf-query-responder.xml +1471 -0
- data/fixtures/diagnostic_order/do-100.xml +64 -0
- data/fixtures/diagnostic_order/do-200.xml +121 -0
- data/fixtures/diagnostic_order/do-300.xml +91 -0
- data/fixtures/diagnostic_order/do-400.xml +88 -0
- data/fixtures/diagnostic_report/dr-100.xml +96 -0
- data/fixtures/diagnostic_report/dr-200.xml +125 -0
- data/fixtures/diagnostic_report/dr-300.xml +132 -0
- data/fixtures/diagnostic_report/dr-400.xml +121 -0
- data/fixtures/financial/claim-example-average.xml +168 -0
- data/fixtures/financial/claim-example-simple.xml +67 -0
- data/fixtures/observation/obs-100.xml +58 -0
- data/fixtures/observation/obs-101.xml +58 -0
- data/fixtures/observation/obs-200.xml +125 -0
- data/fixtures/observation/obs-300.xml +106 -0
- data/fixtures/observation/obs-301.xml +106 -0
- data/fixtures/observation/obs-302.xml +106 -0
- data/fixtures/observation/obs-303.xml +106 -0
- data/fixtures/observation/obs-304.xml +106 -0
- data/fixtures/observation/obs-400.xml +87 -0
- data/fixtures/observation/obs-401.xml +95 -0
- data/fixtures/observation/obs-402.xml +95 -0
- data/fixtures/observation/obs-403.xml +84 -0
- data/fixtures/observation/obs-404.xml +84 -0
- data/fixtures/observation/obs-405.xml +83 -0
- data/fixtures/observation/obs-406.xml +83 -0
- data/fixtures/observation/obs-407.xml +70 -0
- data/fixtures/observation/obs-408.xml +84 -0
- data/fixtures/observation/obs-uslab-example5.xml +102 -0
- data/fixtures/order/order-100.xml +61 -0
- data/fixtures/order/order-200.xml +61 -0
- data/fixtures/order/order-300.xml +61 -0
- data/fixtures/order/order-400.xml +61 -0
- data/fixtures/order_response/ordresp-100.xml +79 -0
- data/fixtures/order_response/ordresp-110.xml +79 -0
- data/fixtures/order_response/ordresp-200.xml +79 -0
- data/fixtures/order_response/ordresp-210.xml +79 -0
- data/fixtures/order_response/ordresp-300.xml +79 -0
- data/fixtures/order_response/ordresp-310.xml +79 -0
- data/fixtures/order_response/ordresp-400.xml +79 -0
- data/fixtures/order_response/ordresp-410.xml +79 -0
- data/fixtures/organization/org-uslab-example3.xml +49 -0
- data/fixtures/patient/patient-example-updated.xml +140 -0
- data/fixtures/patient/patient-example-us-extensions(us01).xml +81 -0
- data/fixtures/patient/patient-example.xml +132 -0
- data/fixtures/patient/patient-format-example.xml +101 -0
- data/fixtures/patient/patient-minimal.xml +9 -0
- data/fixtures/patient/patient-uslab-example1.xml +44 -0
- data/fixtures/practitioner/pract-uslab-example1.xml +18 -0
- data/fixtures/practitioner/pract-uslab-example3.xml +36 -0
- data/fixtures/record/condition-example-f201-fever.xml +63 -0
- data/fixtures/record/condition-example-f205-infection.xml +20 -0
- data/fixtures/record/diagnosticreport-example-f201-brainct.xml +18 -0
- data/fixtures/record/encounter-example-f201-20130404.xml +17 -0
- data/fixtures/record/encounter-example-f202-20130128.xml +17 -0
- data/fixtures/record/observation-example-f202-temperature.xml +60 -0
- data/fixtures/record/organization-example-f201-aumc.xml +5 -0
- data/fixtures/record/organization-example-f203-bumc.xml +5 -0
- data/fixtures/record/patient-example-f201-roel.xml +16 -0
- data/fixtures/record/practitioner-example-f201-ab.xml +14 -0
- data/fixtures/record/procedure-example-f201-tpf.xml +23 -0
- data/fixtures/scheduling/appointment-simple.xml +24 -0
- data/fixtures/scheduling/appointmentresponse-patient-simple.xml +12 -0
- data/fixtures/scheduling/appointmentresponse-practitioner-simple.xml +12 -0
- data/fixtures/scheduling/practitioner-simple.xml +10 -0
- data/fixtures/scheduling/schedule-simple.xml +12 -0
- data/fixtures/scheduling/slot-simple.xml +10 -0
- data/fixtures/specimen/spec-100.xml +65 -0
- data/fixtures/specimen/spec-400.xml +70 -0
- data/fixtures/specimen/spec-uslab-example1.xml +82 -0
- data/fixtures/validation/observation.profile.xml +2045 -0
- data/fixtures/validation/observations/observation-example(example).xml +50 -0
- data/lib/FHIR_structure.json +529 -0
- data/lib/daf_resource_generator.rb +94 -0
- data/lib/data/fhir_structure.rb +8 -0
- data/lib/data/resources.rb +138 -0
- data/lib/executor.rb +56 -0
- data/lib/ext/client.rb +27 -0
- data/lib/ext/client_reply.rb +19 -0
- data/lib/plan_executor.rb +31 -0
- data/lib/resource_generator.rb +656 -0
- data/lib/tasks/tasks.rake +329 -0
- data/lib/tasks/templates/summary.html.erb +163 -0
- data/lib/test_result.rb +69 -0
- data/lib/tests/assertions.rb +261 -0
- data/lib/tests/base_test.rb +117 -0
- data/lib/tests/suites/argonaut_resprint_1_test.rb +260 -0
- data/lib/tests/suites/argonaut_resprint_2_test.rb +369 -0
- data/lib/tests/suites/argonaut_resprint_3_test.rb +309 -0
- data/lib/tests/suites/argonaut_sprint_1_test.rb +187 -0
- data/lib/tests/suites/argonaut_sprint_2_test.rb +115 -0
- data/lib/tests/suites/argonaut_sprint_3_test.rb +208 -0
- data/lib/tests/suites/argonaut_sprint_4_test.rb +335 -0
- data/lib/tests/suites/argonaut_sprint_5_test.rb +196 -0
- data/lib/tests/suites/argonaut_sprint_6_test.rb +243 -0
- data/lib/tests/suites/argonaut_sprint_7_test.rb +161 -0
- data/lib/tests/suites/base_suite.rb +116 -0
- data/lib/tests/suites/connectathon_audit_track.rb +354 -0
- data/lib/tests/suites/connectathon_fetch_patient_record.rb +443 -0
- data/lib/tests/suites/connectathon_financial_track.rb +380 -0
- data/lib/tests/suites/connectathon_lab_order_track.rb +239 -0
- data/lib/tests/suites/connectathon_patient_track.rb +364 -0
- data/lib/tests/suites/connectathon_profile_validation.rb +101 -0
- data/lib/tests/suites/connectathon_scheduling_track.rb +266 -0
- data/lib/tests/suites/connectathon_terminology_track.rb +242 -0
- data/lib/tests/suites/daf_profiles_test.rb +431 -0
- data/lib/tests/suites/format_test.rb +453 -0
- data/lib/tests/suites/history_test.rb +311 -0
- data/lib/tests/suites/read_test.rb +104 -0
- data/lib/tests/suites/resource_test.rb +553 -0
- data/lib/tests/suites/search_test.rb +219 -0
- data/lib/tests/suites/search_test_robust.rb +172 -0
- data/lib/tests/suites/sprinkler_search_test.rb +660 -0
- data/lib/tests/suites/suite_engine.rb +114 -0
- data/lib/tests/suites/transaction_test.rb +571 -0
- data/lib/tests/testscripts/base_testscript.rb +480 -0
- data/lib/tests/testscripts/testscript_engine.rb +81 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-base-client-id-json.xml +348 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-base-client-id-xml.xml +348 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-bonus-client-id-json.xml +420 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-bonus-client-id-xml.xml +420 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/README.html +68 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-base-server-id-json.xml +352 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-base-server-id-xml.xml +352 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-bonus-server-id-json.xml +421 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-bonus-server-id-xml.xml +421 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/conformance/PatientConformance.xml +34 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-PeterChalmers-min.json +45 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-PeterChalmers-min.xml +26 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-PeterChalmers.json +100 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-PeterChalmers.xml +102 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-bonus-PeterChalmers-min.json +53 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-bonus-PeterChalmers-min.xml +30 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-bonus-PeterChalmers.json +108 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-create-bonus-PeterChalmers.xml +108 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-PeterChalmers-min.json +45 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-PeterChalmers-min.xml +26 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-PeterChalmers.json +100 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-PeterChalmers.xml +102 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus1-PeterChalmers-min.json +53 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus1-PeterChalmers-min.xml +30 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus1-PeterChalmers.json +108 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus1-PeterChalmers.xml +107 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus2-PeterChalmers-min.json +53 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus2-PeterChalmers-min.xml +31 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus2-PeterChalmers.json +108 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/_reference/resources/patient-update-bonus2-PeterChalmers.xml +106 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/C-CDA_R2-1_CCD-ussg.xml +3414 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A1-empty-on-instance.xml +9 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A2-empty-by-ref.xml +15 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A3-empty-by-identifier.xml +13 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A4-empty-by-contained.xml +15 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B1-CCDA-on-instance.xml +15 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B2-CCDA-by-ref.xml +21 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B3-CCDA-by-identifier.xml +19 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B4-CCDA-by-contained.xml +21 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaire-sdc-profile-example-ussg-fht.xml +3905 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaireresponse-expected-ussg-fht-CCDA.xml +190 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaireresponse-expected-ussg-fht-empty.xml +177 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/track11-sdc-prepop-xml.xml +142 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Client Assigned Id/track2-ts-suite1-expand-client-id.xml +925 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Client Assigned Id/track2-ts-suite2-expand-filter-client-id.xml +930 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Server Assigned Id/track2-ts-suite1-expand-server-id.xml +953 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Server Assigned Id/track2-ts-suite2-expand-filter-server-id.xml +958 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Lookup/track2-ts-suite5-loinc-lookup-xml.xml +224 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Lookup/track2-ts-suite5-snomed-lookup-xml.xml +224 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/README.html +85 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Translate/track2-ts-suite6-translate-xml.xml +224 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Client Assigned Id/track2-ts-suite3-validate-code-client-id.xml +1807 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Client Assigned Id/track2-ts-suite4-validate-code-client-id.xml +714 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Server Assigned Id/track2-ts-suite3-validate-code-server-id.xml +1835 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Server Assigned Id/track2-ts-suite4-validate-code-server-id.xml +742 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ConceptMapSuite6Conformance.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite1Conformance.xml +17 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite2Conformance.xml +17 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite3Conformance.xml +14 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite4Conformance.xml +14 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite5Conformance.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-2-a.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-2-b.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-3-a.xml +13 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-3-b.xml +13 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-4-a.xml +15 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-4-b.xml +15 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-loinc-input-5-2.xml +10 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-loinc-input-5-3.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-snomed-input-5-2.xml +10 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-snomed-input-5-3.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/translate-conceptmap-input-6-2.xml +14 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/translate-conceptmap-input-6-3.xml +15 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-1-expand-min.xml +47 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-1-filter-min.xml +23 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-2-expand-min.xml +132 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-2-filter-min.xml +38 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-3-expand-min.xml +252 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-3-filter-min.xml +58 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-4-expand-min.xml +57 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-4-filter-min.xml +28 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-1-expand-min.xml +347 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-1-filter-min.xml +33 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-2-expand-min.xml +637 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-2-filter-min.xml +33 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-3-filter-min.xml +58 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/lookup-loinc-min.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/lookup-snomed-min.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite3-invalid-min.xml +10 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite3-valid-min.xml +7 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite4-invalid-min.xml +10 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite4-valid-min.xml +7 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/translate-conceptmap-min.xml +17 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-1.xml +55 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-2.xml +122 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-3.xml +222 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-4.xml +65 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-1.xml +31 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-2.xml +31 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-3.xml +31 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/translate-conceptmap-case-1.xml +145 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/conformance/DecisionSupportServiceModule-Evaluate.xml +17 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-request-payload.xml +26 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-response-min-payload.xml +7 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-response-payload.xml +332 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-request-payload.xml +28 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-response-min-payload.xml +7 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-response-payload.xml +20 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-request-payload.xml +28 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-response-min-payload.xml +7 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-response-payload.xml +332 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-request-payload.xml +28 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-response-min-payload.xml +7 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-response-payload.xml +8 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-request-payload.xml +176 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-response-payload-min.xml +32 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-response-payload.xml +80 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/track3-cds-evaluate-cdc-immunization.xml +290 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/track3-cds-evaluate-gao-profile.xml +110 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/Client_Assigned_Id/TestScript_FHIR-Genomics.xml +170 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/_reference/resources/sequence-example-1.xml +31 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/_reference/resources/sequence-example-2.xml +31 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Actors.png +0 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder100-xml.xml +590 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder200-xml.xml +587 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder300-xml.xml +612 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder400-xml.xml +635 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Peer-to-Peer/track7-laborder100-peer2peer-xml.xml +752 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Thumbs.db +0 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/conformance/LabOrderLabReport-CreateDeleteReadUpdate.xml +187 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/conformance/html.xslt +45 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-100-update.xml +64 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-100.xml +64 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-200-update.xml +121 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-200.xml +121 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-300-update.xml +91 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-300.xml +91 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-400-update.xml +88 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-400.xml +88 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-100.xml +96 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-200.xml +125 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-300.xml +132 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-400.xml +121 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-100.xml +58 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-101.xml +58 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-200.xml +125 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-300.xml +106 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-301.xml +106 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-302.xml +106 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-303.xml +106 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-304.xml +106 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-400.xml +87 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-401.xml +95 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-402.xml +95 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-403.xml +84 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-404.xml +84 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-405.xml +83 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-406.xml +83 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-407.xml +70 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-408.xml +84 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-uslab-example5.xml +102 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-100.xml +61 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-200.xml +61 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-300.xml +61 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-400.xml +61 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-100.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-110.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-200.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-210.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-300.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-310.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-400.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-410.xml +79 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Organization/org-uslab-example3.xml +49 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Patient/patient-uslab-example1.xml +44 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Practitioner/pract-uslab-example1.xml +18 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Practitioner/pract-uslab-example3.xml +36 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/Thumbs.db +0 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-100.xml +65 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-400.xml +70 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-uslab-example1.xml +82 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 1 Document.txt +122 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 2 Document.txt +103 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 3 Document.txt +201 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 4 Document.txt +310 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/conformance/MedicationStatementCreate.xml +11 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/conformance/PatientSearchType.xml +15 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/resources/medicationstatement-create.json +39 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/resources/medicationstatement-patch.json +3 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-medicationstatement-json-if-match.xml +321 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-medicationstatement-json.xml +303 -0
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-peer2peer-patient-json.xml +235 -0
- data/plan_executor.gemspec +14 -0
- data/test/fixtures/diagnostic_bundle.xml +51 -0
- data/test/fixtures/lab_results_bundle.xml +49 -0
- data/test/fixtures/observation_bundle.json +61 -0
- data/test/fixtures/testscript-example.xml +202 -0
- data/test/fixtures/testscript-history.xml +143 -0
- data/test/fixtures/testscript-readtest.xml +272 -0
- data/test/fixtures/testscript-search.xml +282 -0
- data/test/fixtures/testscript-update.xml +147 -0
- data/test/fixtures/vital_signs_bundle.xml +117 -0
- data/test/test_helper.rb +8 -0
- data/test/unit/argonaut_sprint6_test.rb +31 -0
- data/test/unit/argonaut_sprint7_test.rb +21 -0
- data/test/unit/basic_test.rb +27 -0
- data/test/unit/fetch_patient_record_test.rb +357 -0
- data/test/unit/financial_test.rb +41 -0
- data/test/unit/fixtures_test.rb +45 -0
- data/test/unit/metadata_test.rb +33 -0
- metadata +394 -0
@@ -0,0 +1,369 @@
|
|
1
|
+
module Crucible
|
2
|
+
module Tests
|
3
|
+
class ArgonautResprint2Test < BaseSuite
|
4
|
+
attr_accessor :rc
|
5
|
+
attr_accessor :conformance
|
6
|
+
attr_accessor :patient_id
|
7
|
+
|
8
|
+
def id
|
9
|
+
'ArgonautResprint2Test'
|
10
|
+
end
|
11
|
+
|
12
|
+
def description
|
13
|
+
'In Re-Sprint 2, we\'ll get up to speed on Argonaut\'s updated implementation guidance for Vital Signs and Laboratory Results, while also introducing the Smoking Status Observation and CareTeam resources.'
|
14
|
+
end
|
15
|
+
|
16
|
+
def details
|
17
|
+
{
|
18
|
+
'Overview' => 'Since the Argonaut Implementation Program began in 2015, we\'ve come a long way. We\'ve gained early implementation experience working with FHIR DSTU2 and the Data Access Framework profiles — and we\'ve produced updated guidance based on this experience. We\'re running a series of "Re-Sprints" with three goals: ensure we have a chance to battle-test our latest "best practices" in time for MU3; help existing Argonaut implementers come up to speed; and provide an easy on-ramp for new Argonaut implementers.',
|
19
|
+
'Instructions' => 'If you\'re working on a server, please complete the "servers" tab of the Sprints Spreadsheet. You\'ll need to update the status flag to indicate whether you\'ve begun work (or completed work), so clients will know when to start testing. You\'ll also share details about how a developer can obtain OAuth client credentials (client_id for public apps, or a client_id and client_secret for confidential apps) as well as user login credentials. You might consider simply sharing a set of fixed credentials in this spreadsheet, or else directing users to a web page where they can complete self-service registration. If absolutely necessary, you can ask developers to e-mail you directly. If you\'re working on a client, please complete the "clients" tab of the Sprints Spreadsheet. You\'ll also need to update the status flag to indicate whether you\'ve begun work (or completed work).',
|
20
|
+
'FHIR API Calls' => 'For this sprint, EHRs should focus on the following FHIR Resources: Observation, DiagnosticReport, and CareTeam.'
|
21
|
+
}
|
22
|
+
end
|
23
|
+
|
24
|
+
def initialize(client1, client2=nil)
|
25
|
+
super(client1, client2)
|
26
|
+
@rc = FHIR::Patient
|
27
|
+
@tags.append('argonaut')
|
28
|
+
@category = {id: 'argonaut', title: 'Argonaut'}
|
29
|
+
@loinc_codes = ['8716-3', '9279-1', '8867-4', '59408-5', '8310-5', '8302-2', '8306-3', '8287-5', '29463-7', '39156-5', '55284-4', '8480-6', '8462-4']
|
30
|
+
@loinc_code_units = {'8716-3' => nil, '9279-1' => '/min', '8867-4' => '/min', '59408-5' => '%', '8310-5' => 'Cel', '8302-2' => 'cm', '8306-3' => 'cm', '8287-5' => 'cm', '29463-7' => 'g, kg', '39156-5' => 'kg/m2', '55284-4' => nil, '8480-6' => 'mm[Hg]', '8462-4' => 'mm[Hg]'}
|
31
|
+
@smoking_codes = ['449868002', '428041000124106', '8517006', '266919005', '77176002', '266927001', '428071000124103', '428061000124105']
|
32
|
+
end
|
33
|
+
|
34
|
+
def setup
|
35
|
+
if !@client.client.try(:params).nil? && @client.client.params['patient']
|
36
|
+
@patient_id = @client.client.params['patient']
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
test 'ARS201', 'Get patient by ID' do
|
41
|
+
metadata {
|
42
|
+
links "#{REST_SPEC_LINK}#read"
|
43
|
+
requires resource: "Patient", methods: ["read", "search"]
|
44
|
+
validates resource: "Patient", methods: ["read", "search"]
|
45
|
+
}
|
46
|
+
|
47
|
+
begin
|
48
|
+
options = {
|
49
|
+
:search => {
|
50
|
+
:flag => true,
|
51
|
+
:compartment => nil,
|
52
|
+
:parameters => {
|
53
|
+
_count: 1
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
@patient_id ||= @client.search(@rc, options).resource.entry.first.resource.xmlId
|
58
|
+
rescue NoMethodError
|
59
|
+
@patient_id = nil
|
60
|
+
end
|
61
|
+
|
62
|
+
skip if !@patient_id
|
63
|
+
|
64
|
+
reply = @client.read(FHIR::Patient, @patient_id)
|
65
|
+
assert_response_ok(reply)
|
66
|
+
assert_equal @patient_id, reply.id, 'Server returned wrong patient.'
|
67
|
+
@patient = reply.resource
|
68
|
+
assert @patient, "could not get patient by id: #{@patient_id}"
|
69
|
+
warning { assert_valid_resource_content_type_present(reply) }
|
70
|
+
warning { assert_last_modified_present(reply) }
|
71
|
+
end
|
72
|
+
|
73
|
+
test 'ARS202', 'GET vital-sign Observations with Patient ID' do
|
74
|
+
metadata {
|
75
|
+
links "#{REST_SPEC_LINK}#search"
|
76
|
+
requires resource: "Observation", methods: ["read", "search"]
|
77
|
+
validates resource: "Observation", methods: ["read", "search"]
|
78
|
+
}
|
79
|
+
|
80
|
+
skip if !@patient_id
|
81
|
+
|
82
|
+
options = {
|
83
|
+
search: {
|
84
|
+
flag: false,
|
85
|
+
compartment: nil,
|
86
|
+
parameters: {
|
87
|
+
patient: @patient_id,
|
88
|
+
category: 'vital-signs'
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
|
93
|
+
reply = @client.search(FHIR::Observation, options)
|
94
|
+
|
95
|
+
validate_vitalsign_reply(reply)
|
96
|
+
end
|
97
|
+
|
98
|
+
test 'ARS203', 'GET coded Observation with Patient ID' do
|
99
|
+
metadata {
|
100
|
+
links "#{REST_SPEC_LINK}#search"
|
101
|
+
requires resource: "Observation", methods: ["read", "search"]
|
102
|
+
validates resource: "Observation", methods: ["read", "search"]
|
103
|
+
}
|
104
|
+
|
105
|
+
skip if !@patient_id
|
106
|
+
|
107
|
+
options = {
|
108
|
+
search: {
|
109
|
+
flag: false,
|
110
|
+
compartment: nil,
|
111
|
+
parameters: {
|
112
|
+
patient: @patient_id,
|
113
|
+
code: @loinc_codes.join(',')
|
114
|
+
}
|
115
|
+
}
|
116
|
+
}
|
117
|
+
|
118
|
+
reply = @client.search(FHIR::Observation, options)
|
119
|
+
|
120
|
+
validate_vitalsign_reply(reply)
|
121
|
+
end
|
122
|
+
|
123
|
+
test 'ARS204', 'GET coded Observation with Patient ID' do
|
124
|
+
metadata {
|
125
|
+
links "#{REST_SPEC_LINK}#search"
|
126
|
+
requires resource: "Observation", methods: ["read", "search"]
|
127
|
+
validates resource: "Observation", methods: ["read", "search"]
|
128
|
+
}
|
129
|
+
|
130
|
+
skip if !@patient_id
|
131
|
+
|
132
|
+
options = {
|
133
|
+
search: {
|
134
|
+
flag: false,
|
135
|
+
compartment: nil,
|
136
|
+
parameters: {
|
137
|
+
patient: patient_id,
|
138
|
+
category: 'laboratory'
|
139
|
+
}
|
140
|
+
}
|
141
|
+
}
|
142
|
+
|
143
|
+
reply = @client.search(FHIR::Observation, options)
|
144
|
+
|
145
|
+
validate_lab_reply(reply)
|
146
|
+
end
|
147
|
+
|
148
|
+
test 'ARS205', 'GET DiagnosticReport with Patient ID' do
|
149
|
+
metadata {
|
150
|
+
links "#{REST_SPEC_LINK}#search"
|
151
|
+
requires resource: "DiagnosticReport", methods: ["read", "search"]
|
152
|
+
validates resource: "DiagnosticReport", methods: ["read", "search"]
|
153
|
+
}
|
154
|
+
|
155
|
+
skip if !@patient_id
|
156
|
+
|
157
|
+
options = {
|
158
|
+
search: {
|
159
|
+
flag: false,
|
160
|
+
compartment: nil,
|
161
|
+
parameters: {
|
162
|
+
patient: patient_id,
|
163
|
+
category: 'LAB'
|
164
|
+
}
|
165
|
+
}
|
166
|
+
}
|
167
|
+
|
168
|
+
reply = @client.search(FHIR::DiagnosticReport, options)
|
169
|
+
|
170
|
+
validate_diagnostic_report_reply(reply)
|
171
|
+
end
|
172
|
+
|
173
|
+
test 'ARS206', 'GET Smoking Status Observation with patient ID' do
|
174
|
+
metadata {
|
175
|
+
links "#{REST_SPEC_LINK}#search"
|
176
|
+
requires resource: 'Observation', methods: ['read', 'search']
|
177
|
+
validates resource: 'Observation', methods: ['read', 'search']
|
178
|
+
}
|
179
|
+
|
180
|
+
skip if !@patient_id
|
181
|
+
|
182
|
+
options = {
|
183
|
+
search: {
|
184
|
+
flag: false,
|
185
|
+
compartment: nil,
|
186
|
+
parameters: {
|
187
|
+
patient: @patient_id,
|
188
|
+
code: '72166-2'
|
189
|
+
}
|
190
|
+
}
|
191
|
+
}
|
192
|
+
|
193
|
+
reply = @client.search(FHIR::Observation, options)
|
194
|
+
|
195
|
+
validate_smoking_status_reply(reply)
|
196
|
+
end
|
197
|
+
|
198
|
+
test 'ARS207', 'GET CarePlan with patient ID' do
|
199
|
+
metadata {
|
200
|
+
links "#{REST_SPEC_LINK}#search"
|
201
|
+
requires resource: 'CarePlan', methods: ['read', 'search']
|
202
|
+
validates resource: 'CarePlan', methods: ['read', 'search']
|
203
|
+
}
|
204
|
+
|
205
|
+
skip if !@patient_id
|
206
|
+
|
207
|
+
options = {
|
208
|
+
search: {
|
209
|
+
flag: false,
|
210
|
+
compartment: nil,
|
211
|
+
parameters: {
|
212
|
+
patient: @patient_id,
|
213
|
+
category: 'careteam',
|
214
|
+
status: 'active'
|
215
|
+
}
|
216
|
+
}
|
217
|
+
}
|
218
|
+
|
219
|
+
reply = @client.search(FHIR::CarePlan, options)
|
220
|
+
|
221
|
+
validate_care_plan_reply(reply)
|
222
|
+
end
|
223
|
+
|
224
|
+
private
|
225
|
+
|
226
|
+
def validate_care_plan_reply(reply)
|
227
|
+
assert_response_ok(reply)
|
228
|
+
|
229
|
+
valid_care_plans_count = 0
|
230
|
+
|
231
|
+
reply.resource.entry.each do |entry|
|
232
|
+
careplan = entry.resource
|
233
|
+
if careplan.category.to_a.find { |cat| cat.coding.to_a.find { |c| c.system == "http://argonaut.hl7.org/ValueSet/extension-codes" && c.code == 'careteam' } }
|
234
|
+
valid_care_plans_count += 1
|
235
|
+
assert careplan.subject
|
236
|
+
assert_equal careplan.subject.reference, "Patient/#{@patient_id}", "Expected patient #{@patient_id} did not match CarePlan Subject #{careplan.subject.reference}"
|
237
|
+
careplan.participant.each do |participant|
|
238
|
+
assert participant.role, "Participant '#{participant.id}' does not have a role"
|
239
|
+
assert participant.member.display, "Participant '#{participant.id}' does not have a complete name in Participant.member.display"
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|
243
|
+
|
244
|
+
warning { assert valid_care_plans_count > 0, "No care team CarePlans were found for this patient" }
|
245
|
+
skip unless valid_care_plans_count > 0
|
246
|
+
|
247
|
+
end
|
248
|
+
|
249
|
+
def validate_smoking_status_reply(reply)
|
250
|
+
assert_response_ok(reply)
|
251
|
+
|
252
|
+
valid_smoking_status_count = 0
|
253
|
+
|
254
|
+
reply.resource.entry.each do |entry|
|
255
|
+
observation = entry.resource
|
256
|
+
if observation.code.coding.to_a.find { |c| c.system == 'http://loinc.org' && c.code == '72166-2' }
|
257
|
+
valid_smoking_status_count += 1
|
258
|
+
assert !observation.status.empty?
|
259
|
+
assert observation.subject
|
260
|
+
assert_equal observation.subject.reference, "Patient/#{@patient_id}"
|
261
|
+
assert observation.issued, "No instant available in observation '#{observation.xmlId}'s' 'issued' field"
|
262
|
+
assert observation.valueCodeableConcept "No codeableConcept specified for Observation '#{observation.xmlId}''"
|
263
|
+
assert observation.valueCodeableConcept.coding.to_a.find{|c|@smoking_codes.include?(c.code)}, "Observation valueCodeableConcept #{observation.valueCodeableConcept.to_fhir_json} isn't part of DAF Smoking Status Value Set"
|
264
|
+
end
|
265
|
+
end
|
266
|
+
|
267
|
+
warning { assert valid_smoking_status_count > 0, "No smoking status Observations were found for this patient" }
|
268
|
+
skip unless valid_smoking_status_count > 0
|
269
|
+
end
|
270
|
+
|
271
|
+
def validate_vitalsign_reply(reply)
|
272
|
+
assert_response_ok(reply)
|
273
|
+
|
274
|
+
valid_observation_count = 0
|
275
|
+
|
276
|
+
reply.resource.entry.each do |entry|
|
277
|
+
observation = entry.resource
|
278
|
+
if observation.category.nil?
|
279
|
+
warning { assert observation.category, "An observation did not have a category"}
|
280
|
+
next
|
281
|
+
end
|
282
|
+
if observation.category.coding.to_a.find { |c| c.code == "vital-signs" }
|
283
|
+
valid_observation_count += 1
|
284
|
+
assert !observation.status.empty?
|
285
|
+
assert observation.category
|
286
|
+
assert observation.category.coding.to_a.find { |c| c.system == "http://hl7.org/fhir/observation-category" }, "Wrong category codeSystem used, expected FHIR ObservationCategory"
|
287
|
+
assert observation.subject
|
288
|
+
assert get_value(observation) || observation.dataAbsentReason || !observation.component.blank?
|
289
|
+
coding = observation.code.coding.first
|
290
|
+
assert coding.system == "http://loinc.org", "The observation is coded using the wrong code system, is #{coding.system}, should be LOINC"
|
291
|
+
warning { assert @loinc_codes.index(coding.code), "The code included in an Observation doesn't match any in the code lists provided by the Argonaut project" }
|
292
|
+
if @loinc_code_units[coding.code] && get_value(observation)
|
293
|
+
value = get_value(observation)
|
294
|
+
if value.respond_to? :unit
|
295
|
+
assert_equal @loinc_code_units[coding.code], value.unit, "The unit of the observation is not correct."
|
296
|
+
end
|
297
|
+
end
|
298
|
+
# systolic and diastolic in components
|
299
|
+
if coding.code == '55284-4'
|
300
|
+
assert observation.component.length >= 2, "expected at least 2 components for combined blood pressure grouping structure"
|
301
|
+
systolic = observation.component.to_a.find {|component| component.code.coding.first.code == '8480-6'}
|
302
|
+
diastolic = observation.component.to_a.find {|component| component.code.coding.first.code == '8462-4'}
|
303
|
+
assert !systolic.blank?, "could not find a systolic blood pressure on a bp grouping vital sign observation"
|
304
|
+
assert !diastolic.blank?, "could not find a diastolic blood pressure on a bp grouping vital sign observation"
|
305
|
+
assert get_value(systolic), "systolic blood pressure did not have a value"
|
306
|
+
assert_equal 'mmHg', get_value(systolic).unit, "The unit of the systolic blood pressure is not correct."
|
307
|
+
assert get_value(diastolic), "systolic blood pressure did not have a value"
|
308
|
+
assert_equal 'mmHg', get_value(diastolic).unit, "The unit of the systolic blood pressure is not correct."
|
309
|
+
end
|
310
|
+
|
311
|
+
end
|
312
|
+
end
|
313
|
+
warning { assert valid_observation_count > 0, "No vital signs Observations were found for this patient" }
|
314
|
+
skip unless valid_observation_count > 0
|
315
|
+
end
|
316
|
+
|
317
|
+
def validate_diagnostic_report_reply(reply)
|
318
|
+
assert_response_ok(reply)
|
319
|
+
|
320
|
+
reply.resource.entry.each do |entry|
|
321
|
+
report = entry.resource
|
322
|
+
|
323
|
+
assert report.category, "DiagnosticReport has no category"
|
324
|
+
assert report.category.coding.each do |c|
|
325
|
+
assert c.code=='LAB',"Category code should be 'LAB'"
|
326
|
+
end
|
327
|
+
assert report.status, "No status for DiagnosticReport"
|
328
|
+
assert report.code, "DiagnosticReport has no code"
|
329
|
+
assert report.subject, "DiagnosticReport has no subject"
|
330
|
+
assert report.effectivePeriod? || report.effectiveDateTime?, "DiagnosticReport has no effective date/time"
|
331
|
+
assert report.issued, "DiagnosticReport has no issued"
|
332
|
+
assert report.performer, "DiagnosticReport has no performer"
|
333
|
+
assert report.result, "DiagnosticReport has no results"
|
334
|
+
end
|
335
|
+
end
|
336
|
+
|
337
|
+
def validate_lab_reply(reply)
|
338
|
+
assert_response_ok(reply)
|
339
|
+
|
340
|
+
valid_observation_count = 0
|
341
|
+
|
342
|
+
reply.resource.entry.each do |entry|
|
343
|
+
observation = entry.resource
|
344
|
+
if observation.category.nil?
|
345
|
+
warning { assert observation.category, "An observation did not have a category"}
|
346
|
+
next
|
347
|
+
end
|
348
|
+
if observation.category.coding.to_a.find { |c| c.code == "laboratory" }
|
349
|
+
valid_observation_count += 1
|
350
|
+
assert !observation.status.empty?
|
351
|
+
assert observation.category
|
352
|
+
assert observation.category.coding.to_a.find{ |c| c.system == "http://hl7.org/fhir/observation-category" }, "Wrong category codeSystem used, expected FHIR ObservationCategory"
|
353
|
+
assert observation.subject
|
354
|
+
assert get_value(observation) || observation.dataAbsentReason
|
355
|
+
coding = observation.code.coding.first
|
356
|
+
assert coding.system == "http://loinc.org", "The observation is coded using the wrong code system, is #{coding.system}, should be LOINC"
|
357
|
+
end
|
358
|
+
end
|
359
|
+
warning { assert valid_observation_count > 0, "No laboratory Observations were found for this patient" }
|
360
|
+
skip unless valid_observation_count > 0
|
361
|
+
end
|
362
|
+
|
363
|
+
def get_value(observation)
|
364
|
+
observation.valueQuantity || observation.valueCodeableConcept || observation.valueString || observation.valueRange || observation.valueRatio || observation.valueSampledData || observation.valueAttachment || observation.valueTime || observation.valueDateTime || observation.valuePeriod
|
365
|
+
end
|
366
|
+
|
367
|
+
end
|
368
|
+
end
|
369
|
+
end
|
@@ -0,0 +1,309 @@
|
|
1
|
+
module Crucible
|
2
|
+
module Tests
|
3
|
+
class ArgonautResprint3Test < BaseSuite
|
4
|
+
attr_accessor :rc
|
5
|
+
attr_accessor :conformance
|
6
|
+
attr_accessor :searchParams
|
7
|
+
attr_reader :canSearchById
|
8
|
+
attr_accessor :patient_id
|
9
|
+
|
10
|
+
def id
|
11
|
+
'ArgonautResprint3Test'
|
12
|
+
end
|
13
|
+
|
14
|
+
def description
|
15
|
+
'In Re-Sprint 3, we\'ll get up to speed on Argonaut\'s updated implementation guidance for: Medications, Immunizations, Goals, and UDI.'
|
16
|
+
end
|
17
|
+
|
18
|
+
def details
|
19
|
+
{
|
20
|
+
'Overview' => 'Since the Argonaut Implementation Program began in 2015, we\'ve come a long way. We\'ve gained early implementation experience working with FHIR DSTU2 and the Data Access Framework profiles — and we\'ve produced updated guidance based on this experience. We\'re running a series of "Re-Sprints" with three goals: ensure we have a chance to battle-test our latest "best practices" in time for MU3; help existing Argonaut implementers come up to speed; and provide an easy on-ramp for new Argonaut implementers.',
|
21
|
+
'Instructions' => 'If you\'re working on a server, please complete the "servers" tab of the Sprints Spreadsheet. You\'ll need to update the status flag to indicate whether you\'ve begun work (or completed work), so clients will know when to start testing. You\'ll also share details about how a developer can obtain OAuth client credentials (client_id for public apps, or a client_id and client_secret for confidential apps) as well as user login credentials. You might consider simply sharing a set of fixed credentials in this spreadsheet, or else directing users to a web page where they can complete self-service registration. If absolutely necessary, you can ask developers to e-mail you directly. If you\'re working on a client, please complete the "clients" tab of the Sprints Spreadsheet. You\'ll also need to update the status flag to indicate whether you\'ve begun work (or completed work).',
|
22
|
+
'FHIR API Calls' => 'For this sprint, EHRs should focus on the following FHIR Resources: MedicationStatement, MedicationOrder, Immunization, Goal, and Device'
|
23
|
+
}
|
24
|
+
end
|
25
|
+
|
26
|
+
def initialize(client1, client2=nil)
|
27
|
+
super(client1, client2)
|
28
|
+
@rc = FHIR::Patient
|
29
|
+
@tags.append('argonaut')
|
30
|
+
@category = {id: 'argonaut', title: 'Argonaut'}
|
31
|
+
@status_codes = ['active', 'unconfirmed', 'confirmed', 'inactive', 'resolved', 'refuted', 'entered-in-error']
|
32
|
+
end
|
33
|
+
|
34
|
+
def setup
|
35
|
+
if !@client.client.try(:params).nil? && @client.client.params['patient']
|
36
|
+
@patient_id = @client.client.params['patient']
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
40
|
+
test 'ARS301', 'Get patient by ID' do
|
41
|
+
metadata {
|
42
|
+
links "#{REST_SPEC_LINK}#read"
|
43
|
+
requires resource: "Patient", methods: ["read", "search"]
|
44
|
+
validates resource: "Patient", methods: ["read", "search"]
|
45
|
+
}
|
46
|
+
|
47
|
+
begin
|
48
|
+
options = {
|
49
|
+
:search => {
|
50
|
+
:flag => true,
|
51
|
+
:compartment => nil,
|
52
|
+
:parameters => {
|
53
|
+
_count: 1
|
54
|
+
}
|
55
|
+
}
|
56
|
+
}
|
57
|
+
@patient_id ||= @client.search(@rc, options).resource.entry.first.resource.xmlId
|
58
|
+
rescue NoMethodError
|
59
|
+
@patient = nil
|
60
|
+
end
|
61
|
+
|
62
|
+
skip unless @patient_id
|
63
|
+
|
64
|
+
reply = @client.read(FHIR::Patient, @patient_id)
|
65
|
+
assert_response_ok(reply)
|
66
|
+
assert_equal @patient_id.to_s, reply.id.to_s, 'Server returned wrong patient.'
|
67
|
+
@patient = reply.resource
|
68
|
+
assert @patient, "could not get patient by id: #{@patient_id}"
|
69
|
+
warning { assert_valid_resource_content_type_present(reply) }
|
70
|
+
warning { assert_last_modified_present(reply) }
|
71
|
+
end
|
72
|
+
|
73
|
+
test 'ARS302', 'GET MedicationOrder with Patient ID' do
|
74
|
+
metadata {
|
75
|
+
links "#{REST_SPEC_LINK}#search"
|
76
|
+
requires resource: "MedicationOrder", methods: ["read", "search"]
|
77
|
+
validates resource: "MedicationOrder", methods: ["read", "search"]
|
78
|
+
}
|
79
|
+
|
80
|
+
skip if !@patient_id
|
81
|
+
|
82
|
+
options = {
|
83
|
+
search: {
|
84
|
+
flag: false,
|
85
|
+
compartment: nil,
|
86
|
+
parameters: {
|
87
|
+
patient: @patient_id
|
88
|
+
}
|
89
|
+
}
|
90
|
+
}
|
91
|
+
|
92
|
+
reply = @client.search(FHIR::MedicationOrder, options)
|
93
|
+
|
94
|
+
assert_response_ok(reply)
|
95
|
+
|
96
|
+
valid_entries = 0
|
97
|
+
|
98
|
+
reply.resource.entry.each do |entry|
|
99
|
+
med = entry.resource
|
100
|
+
assert med.dateWritten, "MedicationOrder '#{med.xmlId}' does not have a dateWritten"
|
101
|
+
assert med.medicationCodeableConcept || med.medicationReference, "MedicationOrder '#{med.xmlId}' does not have an embedded Medication"
|
102
|
+
assert med.status && !med.status.empty?, "MedicationOrder '#{med.xmlId}' must have a non-blank status"
|
103
|
+
assert med.patient.reference == "Patient/#{@patient_id}", "MedicationOrder '#{med.xmlId}' patient (#{med.patient.reference}) doesn't match the specified patient (Patient/#{@patient_id}})"
|
104
|
+
assert med.prescriber, "MedicationOrder '#{med.xmlId}' does not have a prescriber"
|
105
|
+
valid_entries += 1
|
106
|
+
end
|
107
|
+
|
108
|
+
warning { assert valid_entries > 0, "No MedicationOrders were found for patient #{@patient_id}" }
|
109
|
+
skip unless valid_entries > 0
|
110
|
+
end
|
111
|
+
|
112
|
+
test 'ARS303', 'GET MedicationStatement with Patient ID' do
|
113
|
+
metadata {
|
114
|
+
links "#{REST_SPEC_LINK}#search"
|
115
|
+
requires resource: "MedicationStatement", methods: ["read", "search"]
|
116
|
+
validates resource: "MedicationStatement", methods: ["read", "search"]
|
117
|
+
}
|
118
|
+
|
119
|
+
skip if !@patient_id
|
120
|
+
|
121
|
+
options = {
|
122
|
+
search: {
|
123
|
+
flag: false,
|
124
|
+
compartment: nil,
|
125
|
+
parameters: {
|
126
|
+
patient: @patient_id
|
127
|
+
}
|
128
|
+
}
|
129
|
+
}
|
130
|
+
|
131
|
+
reply = @client.search(FHIR::MedicationStatement, options)
|
132
|
+
|
133
|
+
assert_response_ok(reply)
|
134
|
+
|
135
|
+
valid_entries = 0
|
136
|
+
|
137
|
+
reply.resource.entry.each do |entry|
|
138
|
+
# Note: haven't been able to find a server that supports MedicationStatement and has a patient with it.
|
139
|
+
med = entry.resource
|
140
|
+
assert med.effectiveDateTime || med.effectivePeriod, "MedicationStatement '#{med.xmlId} 'does not have an effective date or period"
|
141
|
+
assert med.medicationCodeableConcept || med.medicationReference, "MedicationStatement '#{med.xmlId}' does not have an embedded Medication"
|
142
|
+
assert med.status && !med.status.empty?, "MedicationStatement '#{med.xmlId}' must have a non-blank status"
|
143
|
+
assert med.patient.reference == "Patient/#{@patient_id}", "MedicationStatement '#{med.xmlId}' patient (#{med.patient.reference}) doesn't match the specified patient (Patient/#{@patient_id}})"
|
144
|
+
valid_entries += 1
|
145
|
+
end
|
146
|
+
|
147
|
+
warning { assert valid_entries > 0, "No MedicationStatements were found for patient #{@patient_id}" }
|
148
|
+
skip unless valid_entries > 0
|
149
|
+
end
|
150
|
+
|
151
|
+
test 'ARS304', 'GET Immunization with Patient ID' do
|
152
|
+
metadata {
|
153
|
+
links "#{REST_SPEC_LINK}#search"
|
154
|
+
requires resource: "Immunization", methods: ["read", "search"]
|
155
|
+
validates resource: "Immunization", methods: ["read", "search"]
|
156
|
+
}
|
157
|
+
|
158
|
+
skip if !@patient_id
|
159
|
+
|
160
|
+
options = {
|
161
|
+
search: {
|
162
|
+
flag: false,
|
163
|
+
compartment: nil,
|
164
|
+
parameters: {
|
165
|
+
patient: @patient_id
|
166
|
+
}
|
167
|
+
}
|
168
|
+
}
|
169
|
+
|
170
|
+
reply = @client.search(FHIR::Immunization, options)
|
171
|
+
|
172
|
+
assert_response_ok(reply)
|
173
|
+
|
174
|
+
valid_entries = 0
|
175
|
+
|
176
|
+
reply.resource.entry.each do |entry|
|
177
|
+
imm = entry.resource
|
178
|
+
assert imm.date, "Immunization '#{imm.xmlId}' does not have an administration date"
|
179
|
+
assert imm.status && !imm.status.empty?, "Immunization '#{imm.xmlId}' must have a non-blank status"
|
180
|
+
assert imm.patient.reference == "Patient/#{@patient_id}", "Immunization '#{imm.xmlId}' patient (#{imm.patient.reference}) doesn't match the specified patient (Patient/#{@patient_id})"
|
181
|
+
assert imm.wasNotGiven != nil, "Immunization '#{imm.xmlId}' does not have a boolean value in 'wasNotGiven'"
|
182
|
+
assert imm.reported != nil, "Immunization '#{imm.xmlId}' does not have a boolean value in 'reported'"
|
183
|
+
assert imm.vaccineCode, "Immunization '#{imm.xmlId}' does not have a code value in vaccineCode"
|
184
|
+
#can't check whether vaccineCode is in the DAF CVX valueSet, because that valueSet has no codes in it.
|
185
|
+
valid_entries += 1
|
186
|
+
end
|
187
|
+
|
188
|
+
warning { assert valid_entries > 0, "No Immunizations were found for patient #{@patient_id}" }
|
189
|
+
skip unless valid_entries > 0
|
190
|
+
end
|
191
|
+
|
192
|
+
test 'ARS305', 'GET Goals with Patient ID' do
|
193
|
+
metadata {
|
194
|
+
links "#{REST_SPEC_LINK}#search"
|
195
|
+
requires resource: "Goal", methods: ["read", "search"]
|
196
|
+
validates resource: "Goal", methods: ["read", "search"]
|
197
|
+
}
|
198
|
+
|
199
|
+
skip if !@patient_id
|
200
|
+
|
201
|
+
options = {
|
202
|
+
search: {
|
203
|
+
flag: false,
|
204
|
+
compartment: nil,
|
205
|
+
parameters: {
|
206
|
+
patient: @patient_id
|
207
|
+
}
|
208
|
+
}
|
209
|
+
}
|
210
|
+
|
211
|
+
reply = @client.search(FHIR::Goal, options)
|
212
|
+
|
213
|
+
assert_response_ok(reply)
|
214
|
+
|
215
|
+
valid_entries = 0
|
216
|
+
|
217
|
+
reply.resource.entry.each do |entry|
|
218
|
+
med = entry.resource
|
219
|
+
assert med.status && !med.status.empty?, "Goal '#{med.xmlId}' must have a non-blank status"
|
220
|
+
# array is composed of GoalStatus ValueSet codes: http://hl7.org/fhir/DSTU2/valueset-Goal-status.html
|
221
|
+
assert %w{proposed planned accepted rejected in-progress achieved sustaining on-hold cancelled}.include?(med.status), "Goal '#{med.xmlId}' must have a status from the GoalStatus Value set at http://hl7.org/fhir/DSTU2/valueset-Goal-status.html"
|
222
|
+
assert med.description && !med.description.empty?, "Goal '#{med.xmlId}' must have a non-blank description"
|
223
|
+
assert med.subject.reference == "Patient/#{@patient_id}", "Goal '#{med.xmlId}' patient (#{med.subject.reference}) doesn't match the specified patient (Patient/#{@patient_id})"
|
224
|
+
valid_entries += 1
|
225
|
+
end
|
226
|
+
|
227
|
+
warning { assert valid_entries > 0, "No Goals were found for patient #{@patient_id}" }
|
228
|
+
skip unless valid_entries > 0
|
229
|
+
end
|
230
|
+
|
231
|
+
test 'ARS306', 'GET Goals with Patient ID and Date' do
|
232
|
+
metadata {
|
233
|
+
links "#{REST_SPEC_LINK}#search"
|
234
|
+
requires resource: "Goal", methods: ["read", "search"]
|
235
|
+
validates resource: "Goal", methods: ["read", "search"]
|
236
|
+
}
|
237
|
+
|
238
|
+
skip if !@patient_id
|
239
|
+
|
240
|
+
options = {
|
241
|
+
search: {
|
242
|
+
flag: false,
|
243
|
+
compartment: nil,
|
244
|
+
parameters: {
|
245
|
+
patient: @patient_id,
|
246
|
+
targetdate: 'ge2000-01-01'
|
247
|
+
}
|
248
|
+
}
|
249
|
+
}
|
250
|
+
|
251
|
+
reply = @client.search(FHIR::Goal, options)
|
252
|
+
|
253
|
+
assert_response_ok(reply)
|
254
|
+
|
255
|
+
valid_entries = 0
|
256
|
+
|
257
|
+
reply.resource.entry.each do |entry|
|
258
|
+
med = entry.resource
|
259
|
+
assert med.status && !med.status.empty?, "Goal '#{med.xmlId}' must have a non-blank status"
|
260
|
+
# array is composed of GoalStatus ValueSet codes: http://hl7.org/fhir/DSTU2/valueset-Goal-status.html
|
261
|
+
assert %w{proposed planned accepted rejected in-progress achieved sustaining on-hold cancelled}.include?(med.status), "Goal '#{med.xmlId}' must have a status from the GoalStatus Value set at http://hl7.org/fhir/DSTU2/valueset-Goal-status.html"
|
262
|
+
assert med.description && !med.description.empty?, "Goal '#{med.xmlId}' must have a non-blank description"
|
263
|
+
assert med.subject.reference == "Patient/#{@patient_id}", "Goal '#{med.xmlId}' patient (#{med.subject.reference}) doesn't match the specified patient (Patient/#{@patient_id})"
|
264
|
+
valid_entries += 1
|
265
|
+
end
|
266
|
+
|
267
|
+
warning { assert valid_entries > 0, "No Goals were found for patient #{@patient_id} after Jan 1, 2000" }
|
268
|
+
skip unless valid_entries > 0
|
269
|
+
end
|
270
|
+
|
271
|
+
test 'ARS307', 'GET Devices with Patient ID' do
|
272
|
+
metadata {
|
273
|
+
links "#{REST_SPEC_LINK}#search"
|
274
|
+
requires resource: "Device", methods: ["read", "search"]
|
275
|
+
validates resource: "Device", methods: ["read", "search"]
|
276
|
+
}
|
277
|
+
|
278
|
+
skip if !@patient_id
|
279
|
+
|
280
|
+
options = {
|
281
|
+
search: {
|
282
|
+
flag: false,
|
283
|
+
compartment: nil,
|
284
|
+
parameters: {
|
285
|
+
patient: @patient_id
|
286
|
+
}
|
287
|
+
}
|
288
|
+
}
|
289
|
+
|
290
|
+
reply = @client.search(FHIR::Device, options)
|
291
|
+
|
292
|
+
assert_response_ok(reply)
|
293
|
+
|
294
|
+
valid_entries = 0
|
295
|
+
|
296
|
+
reply.resource.entry.each do |entry|
|
297
|
+
med = entry.resource
|
298
|
+
assert med.fhirType && !med.fhirType.coding.empty?, "Device '#{med.xmlId}' must have a non-blank status"
|
299
|
+
assert med.udi && !med.udi.empty?, "Device '#{med.xmlId}' must have a non-blank UDI string"
|
300
|
+
assert med.patient.reference == "Patient/#{@patient_id}", "Device '#{med.xmlId}' patient (#{med.patient.reference}) doesn't match the specified patient (Patient/#{@patient_id})"
|
301
|
+
valid_entries += 1
|
302
|
+
end
|
303
|
+
|
304
|
+
warning { assert valid_entries > 0, "No Devices were found for patient #{@patient_id}" }
|
305
|
+
skip unless valid_entries > 0
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
309
|
+
end
|