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,266 @@
|
|
1
|
+
module Crucible
|
2
|
+
module Tests
|
3
|
+
class ConnectathonSchedulingTrackTest < BaseSuite
|
4
|
+
|
5
|
+
def id
|
6
|
+
'ConnectathonSchedulingTrackTest'
|
7
|
+
end
|
8
|
+
|
9
|
+
def description
|
10
|
+
'Connectathon Scheduling Track Test focuses on creating/cancelling Appointments and retreiving Schedules.'
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize(client1, client2=nil)
|
14
|
+
super(client1, client2)
|
15
|
+
@category = {id: 'connectathon', title: 'Connectathon'}
|
16
|
+
end
|
17
|
+
|
18
|
+
def setup
|
19
|
+
@resources = Crucible::Generator::Resources.new
|
20
|
+
|
21
|
+
# Create a patient
|
22
|
+
@patient = @resources.minimal_patient
|
23
|
+
@patient.xmlId = nil # clear the identifier, in case the server checks for duplicates
|
24
|
+
reply = @client.create(@patient)
|
25
|
+
assert_response_ok(reply)
|
26
|
+
@patient.xmlId = reply.id
|
27
|
+
|
28
|
+
# Create a practitioner
|
29
|
+
@practitioner = @resources.scheduling_practitioner
|
30
|
+
@practitioner.xmlId = nil # clear the identifier, in case the server checks for duplicates
|
31
|
+
reply = @client.create(@practitioner)
|
32
|
+
assert_response_ok(reply)
|
33
|
+
@practitioner.xmlId = reply.id
|
34
|
+
|
35
|
+
# Create a schedule
|
36
|
+
@schedule = @resources.scheduling_schedule
|
37
|
+
@schedule.xmlId = nil # clear the identifier, in case the server checks for duplicates
|
38
|
+
@schedule.actor.reference = "Practitioner/#{@practitioner.xmlId}"
|
39
|
+
reply = @client.create(@schedule)
|
40
|
+
assert_response_ok(reply)
|
41
|
+
@schedule.xmlId = reply.id
|
42
|
+
|
43
|
+
# Create a slot
|
44
|
+
@slot = @resources.scheduling_slot
|
45
|
+
@slot.xmlId = nil # clear the identifier, in case the server checks for duplicates
|
46
|
+
@slot.schedule.reference = "Schedule/#{@schedule.xmlId}"
|
47
|
+
reply = @client.create(@slot)
|
48
|
+
assert_response_ok(reply)
|
49
|
+
@slot.xmlId = reply.id
|
50
|
+
end
|
51
|
+
|
52
|
+
def teardown
|
53
|
+
@client.destroy(FHIR::Patient, @patient.xmlId) if !@patient.xmlId.nil?
|
54
|
+
@client.destroy(FHIR::Practitioner, @practitioner.xmlId) if !@practitioner.xmlId.nil?
|
55
|
+
@client.destroy(FHIR::Schedule, @schedule.xmlId) if !@schedule.xmlId.nil?
|
56
|
+
@client.destroy(FHIR::Slot, @slot.xmlId) if !@slot.xmlId.nil?
|
57
|
+
@client.destroy(FHIR::Appointment, @appointment.xmlId) if @appointment && !@appointment.xmlId.nil?
|
58
|
+
@client.destroy(FHIR::AppointmentResponse, @appointment_response_patient.xmlId) if @appointment_response_patient && !@appointment_response_patient.xmlId.nil?
|
59
|
+
@client.destroy(FHIR::AppointmentResponse, @appointment_response_practitioner.xmlId) if @appointment_response_practitioner && !@appointment_response_practitioner.xmlId.nil?
|
60
|
+
end
|
61
|
+
|
62
|
+
# Find Practitioner's schedule
|
63
|
+
test 'CST01','Find Practitioner\'s Schedule' do
|
64
|
+
metadata {
|
65
|
+
links "#{REST_SPEC_LINK}#search"
|
66
|
+
links "#{BASE_SPEC_LINK}/schedule.html"
|
67
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
68
|
+
requires resource: 'Schedule', methods: ['search']
|
69
|
+
validates resource: 'Schedule', methods: ['search']
|
70
|
+
}
|
71
|
+
|
72
|
+
options = {
|
73
|
+
:search => {
|
74
|
+
:flag => false,
|
75
|
+
:compartment => nil,
|
76
|
+
:parameters => {
|
77
|
+
'actor' => "Practitioner/#{@practitioner.xmlId}"
|
78
|
+
}
|
79
|
+
}
|
80
|
+
}
|
81
|
+
reply = @client.search(FHIR::Schedule, options)
|
82
|
+
assert_response_ok(reply)
|
83
|
+
assert_bundle_response(reply)
|
84
|
+
assert_equal(1, reply.resource.entry.size, 'There should only be one Schedule for the test Practitioner currently in the system.', reply.body)
|
85
|
+
assert_equal(@schedule.xmlId, reply.resource.entry[0].try(:resource).try(:xmlId), 'The correct Schedule was not returned.', reply.body)
|
86
|
+
end
|
87
|
+
|
88
|
+
# Find Slot in Practitioner's schedule
|
89
|
+
test 'CST02','Find Slot in Practitioner\'s Schedule' do
|
90
|
+
metadata {
|
91
|
+
links "#{REST_SPEC_LINK}#search"
|
92
|
+
links "#{BASE_SPEC_LINK}/slot.html"
|
93
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
94
|
+
requires resource: 'Slot', methods: ['search']
|
95
|
+
validates resource: 'Slot', methods: ['search']
|
96
|
+
}
|
97
|
+
|
98
|
+
options = {
|
99
|
+
:search => {
|
100
|
+
:flag => false,
|
101
|
+
:compartment => nil,
|
102
|
+
:parameters => {
|
103
|
+
'schedule' => "Schedule/#{@schedule.xmlId}"
|
104
|
+
}
|
105
|
+
}
|
106
|
+
}
|
107
|
+
reply = @client.search(FHIR::Slot, options)
|
108
|
+
assert_response_ok(reply)
|
109
|
+
assert_bundle_response(reply)
|
110
|
+
assert_equal(1, reply.resource.entry.size, 'There should only be one Slot for the test Practitioner\'s Schedule currently in the system.', reply.body)
|
111
|
+
assert_equal(@slot.xmlId, reply.resource.entry[0].try(:resource).try(:xmlId), 'The correct Slot was not returned.', reply.body)
|
112
|
+
end
|
113
|
+
|
114
|
+
# Create appointment in slot (proposed)
|
115
|
+
test 'CST03','Create Proposed Appointment in Slot' do
|
116
|
+
metadata {
|
117
|
+
links "#{REST_SPEC_LINK}#create"
|
118
|
+
links "#{BASE_SPEC_LINK}/appointment.html"
|
119
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
120
|
+
requires resource: 'Appointment', methods: ['create']
|
121
|
+
validates resource: 'Appointment', methods: ['create']
|
122
|
+
}
|
123
|
+
@appointment = @resources.scheduling_appointment
|
124
|
+
@appointment.xmlId = nil # clear the identifier
|
125
|
+
@appointment.participant[0].actor.reference = "Patient/#{@patient.xmlId}"
|
126
|
+
@appointment.participant[1].actor.reference = "Practitioner/#{@practitioner.xmlId}"
|
127
|
+
reply = @client.create(@appointment)
|
128
|
+
assert_response_ok(reply)
|
129
|
+
@appointment.xmlId = reply.id
|
130
|
+
end
|
131
|
+
|
132
|
+
# Update slot status (busy-tentative)
|
133
|
+
test 'CST04','Update Slot status to busy-tentative' do
|
134
|
+
metadata {
|
135
|
+
links "#{REST_SPEC_LINK}#update"
|
136
|
+
links "#{BASE_SPEC_LINK}/slot.html"
|
137
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
138
|
+
requires resource: 'Slot', methods: ['update']
|
139
|
+
validates resource: 'Slot', methods: ['update']
|
140
|
+
}
|
141
|
+
@slot.freeBusyType = 'busy-tentative'
|
142
|
+
reply = @client.update(@slot,@slot.xmlId)
|
143
|
+
assert_response_ok(reply)
|
144
|
+
end
|
145
|
+
|
146
|
+
# Create appointment response for patient (accepted)
|
147
|
+
test 'CST05','Create AppointmentResponse for Patient (accepted)' do
|
148
|
+
metadata {
|
149
|
+
links "#{REST_SPEC_LINK}#create"
|
150
|
+
links "#{BASE_SPEC_LINK}/appointmentresponse.html"
|
151
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
152
|
+
requires resource: 'AppointmentResponse', methods: ['create']
|
153
|
+
validates resource: 'AppointmentResponse', methods: ['create']
|
154
|
+
}
|
155
|
+
@appointment_response_patient = @resources.scheduling_response_patient
|
156
|
+
@appointment_response_patient.xmlId = nil # clear the identifier
|
157
|
+
@appointment_response_patient.appointment.reference = "Appointment/#{@appointment.xmlId}"
|
158
|
+
reply = @client.create(@appointment_response_patient)
|
159
|
+
assert_response_ok(reply)
|
160
|
+
@appointment_response_patient.xmlId = reply.id
|
161
|
+
end
|
162
|
+
|
163
|
+
# Update appointment.participant.status for patient (accepted)
|
164
|
+
test 'CST06','Update Appointment.participant.status for Patient (accepted)' do
|
165
|
+
metadata {
|
166
|
+
links "#{REST_SPEC_LINK}#update"
|
167
|
+
links "#{BASE_SPEC_LINK}/appointment.html"
|
168
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
169
|
+
requires resource: 'Appointment', methods: ['update']
|
170
|
+
validates resource: 'Appointment', methods: ['update']
|
171
|
+
}
|
172
|
+
@appointment.participant[0].status = 'accepted'
|
173
|
+
reply = @client.update(@appointment,@appointment.xmlId)
|
174
|
+
assert_response_ok(reply)
|
175
|
+
end
|
176
|
+
|
177
|
+
# Create appointment response for practitioner
|
178
|
+
test 'CST07','Create AppointmentResponse for Practitioner (accepted)' do
|
179
|
+
metadata {
|
180
|
+
links "#{REST_SPEC_LINK}#create"
|
181
|
+
links "#{BASE_SPEC_LINK}/appointmentresponse.html"
|
182
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
183
|
+
requires resource: 'AppointmentResponse', methods: ['create']
|
184
|
+
validates resource: 'AppointmentResponse', methods: ['create']
|
185
|
+
}
|
186
|
+
@appointment_response_practitioner = @resources.scheduling_response_practitioner
|
187
|
+
@appointment_response_practitioner.xmlId = nil # clear the identifier
|
188
|
+
@appointment_response_practitioner.appointment.reference = "Appointment/#{@appointment.xmlId}"
|
189
|
+
reply = @client.create(@appointment_response_practitioner)
|
190
|
+
assert_response_ok(reply)
|
191
|
+
@appointment_response_practitioner.xmlId = reply.id
|
192
|
+
end
|
193
|
+
|
194
|
+
# Update appointment.participant.status for Practitioner (accepted)
|
195
|
+
test 'CST08','Update Appointment.participant.status for Practitioner (accepted)' do
|
196
|
+
metadata {
|
197
|
+
links "#{REST_SPEC_LINK}#update"
|
198
|
+
links "#{BASE_SPEC_LINK}/appointment.html"
|
199
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
200
|
+
requires resource: 'Appointment', methods: ['update']
|
201
|
+
validates resource: 'Appointment', methods: ['update']
|
202
|
+
}
|
203
|
+
@appointment.participant[1].status = 'accepted'
|
204
|
+
reply = @client.update(@appointment,@appointment.xmlId)
|
205
|
+
assert_response_ok(reply)
|
206
|
+
end
|
207
|
+
|
208
|
+
# Update slot status (busy)
|
209
|
+
test 'CST09','Update Slot status (busy)' do
|
210
|
+
metadata {
|
211
|
+
links "#{REST_SPEC_LINK}#update"
|
212
|
+
links "#{BASE_SPEC_LINK}/slot.html"
|
213
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
214
|
+
requires resource: 'Slot', methods: ['update']
|
215
|
+
validates resource: 'Slot', methods: ['update']
|
216
|
+
}
|
217
|
+
@slot.freeBusyType = 'busy'
|
218
|
+
reply = @client.update(@slot,@slot.xmlId)
|
219
|
+
assert_response_ok(reply)
|
220
|
+
end
|
221
|
+
|
222
|
+
# Update appointment status (booked)
|
223
|
+
test 'CST10','Update Appointment status (booked)' do
|
224
|
+
metadata {
|
225
|
+
links "#{REST_SPEC_LINK}#update"
|
226
|
+
links "#{BASE_SPEC_LINK}/appointment.html"
|
227
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
228
|
+
requires resource: 'Appointment', methods: ['update']
|
229
|
+
validates resource: 'Appointment', methods: ['update']
|
230
|
+
}
|
231
|
+
@appointment.status = 'booked'
|
232
|
+
reply = @client.update(@appointment,@appointment.xmlId)
|
233
|
+
assert_response_ok(reply)
|
234
|
+
end
|
235
|
+
|
236
|
+
# Update appointment status (cancelled)
|
237
|
+
test 'CST11','Update Appointment status (cancelled)' do
|
238
|
+
metadata {
|
239
|
+
links "#{REST_SPEC_LINK}#update"
|
240
|
+
links "#{BASE_SPEC_LINK}/appointment.html"
|
241
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
242
|
+
requires resource: 'Appointment', methods: ['update']
|
243
|
+
validates resource: 'Appointment', methods: ['update']
|
244
|
+
}
|
245
|
+
@appointment.status = 'cancelled'
|
246
|
+
reply = @client.update(@appointment,@appointment.xmlId)
|
247
|
+
assert_response_ok(reply)
|
248
|
+
end
|
249
|
+
|
250
|
+
# Update slot status (free)
|
251
|
+
test 'CST12','Update Slot status (free)' do
|
252
|
+
metadata {
|
253
|
+
links "#{REST_SPEC_LINK}#update"
|
254
|
+
links "#{BASE_SPEC_LINK}/slot.html"
|
255
|
+
links 'http://wiki.hl7.org/index.php?title=FHIR_Connectathon_10#Track_6_-_Scheduling'
|
256
|
+
requires resource: 'Slot', methods: ['update']
|
257
|
+
validates resource: 'Slot', methods: ['update']
|
258
|
+
}
|
259
|
+
@slot.freeBusyType = 'free'
|
260
|
+
reply = @client.update(@slot,@slot.xmlId)
|
261
|
+
assert_response_ok(reply)
|
262
|
+
end
|
263
|
+
|
264
|
+
end
|
265
|
+
end
|
266
|
+
end
|
@@ -0,0 +1,242 @@
|
|
1
|
+
module Crucible
|
2
|
+
module Tests
|
3
|
+
class ConnectathonTerminologyTrackTest < BaseSuite
|
4
|
+
|
5
|
+
def id
|
6
|
+
'ConnectathonTerminologyTrackTest'
|
7
|
+
end
|
8
|
+
|
9
|
+
def description
|
10
|
+
'Connectathon Terminology Track focuses on the $expand, $validate-code, $lookup, and $translate operations.'
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize(client1, client2=nil)
|
14
|
+
super(client1, client2)
|
15
|
+
@category = {id: 'connectathon', title: 'Connectathon'}
|
16
|
+
end
|
17
|
+
|
18
|
+
def setup
|
19
|
+
# find FHIRDefinedType valueset
|
20
|
+
options = {
|
21
|
+
:search => {
|
22
|
+
:flag => false,
|
23
|
+
:compartment => nil,
|
24
|
+
:parameters => {
|
25
|
+
'name' => 'FHIRDefinedType'
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
29
|
+
@valueset = nil
|
30
|
+
reply = @client.search(FHIR::ValueSet, options)
|
31
|
+
if reply.code==200 && !reply.resource.nil?
|
32
|
+
bundle = reply.resource
|
33
|
+
@valueset = bundle.entry[0].resource if bundle.entry.size > 0
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
def teardown
|
38
|
+
# not required
|
39
|
+
end
|
40
|
+
|
41
|
+
['GET','POST'].each do |how|
|
42
|
+
|
43
|
+
test "CT01#{how[0]}", "Expand a specific ValueSet (#{how})" do
|
44
|
+
metadata {
|
45
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
46
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#expand"
|
47
|
+
validates resource: 'ValueSet', methods: ['$expand']
|
48
|
+
}
|
49
|
+
skip if @valueset.nil?
|
50
|
+
options = {
|
51
|
+
:id => @valueset.xmlId,
|
52
|
+
:operation => {
|
53
|
+
:method => how
|
54
|
+
}
|
55
|
+
}
|
56
|
+
reply = @client.value_set_expansion(options)
|
57
|
+
assert_response_ok(reply)
|
58
|
+
assert_resource_type(reply, FHIR::ValueSet)
|
59
|
+
check_expansion_for_concepts(reply.resource)
|
60
|
+
end
|
61
|
+
|
62
|
+
test "CT02#{how[0]}", "Expand a ValueSet by context (#{how})" do
|
63
|
+
metadata {
|
64
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
65
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#expand"
|
66
|
+
validates resource: 'ValueSet', methods: ['$expand']
|
67
|
+
}
|
68
|
+
options = {
|
69
|
+
:operation => {
|
70
|
+
:method => how,
|
71
|
+
:parameters => {
|
72
|
+
'context' => { type: 'Uri', value: 'http://hl7.org/fhir/StructureDefinition/StructureDefinition#StructureDefinition.constrainedType' }
|
73
|
+
}
|
74
|
+
}
|
75
|
+
}
|
76
|
+
reply = @client.value_set_expansion(options)
|
77
|
+
assert_response_ok(reply)
|
78
|
+
assert_resource_type(reply, FHIR::ValueSet)
|
79
|
+
check_expansion_for_concepts(reply.resource)
|
80
|
+
end
|
81
|
+
|
82
|
+
test "CT03#{how[0]}", "Validate a code using identifier (#{how})" do
|
83
|
+
metadata {
|
84
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
85
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#validate-code"
|
86
|
+
validates resource: 'ValueSet', methods: ['$validate-code']
|
87
|
+
}
|
88
|
+
options = {
|
89
|
+
:operation => {
|
90
|
+
:method => how,
|
91
|
+
:parameters => {
|
92
|
+
'code' => { type: 'Code', value: 'female' },
|
93
|
+
'identifier' => { type: 'Uri', value: 'http://hl7.org/fhir/ValueSet/administrative-gender' }
|
94
|
+
}
|
95
|
+
}
|
96
|
+
}
|
97
|
+
reply = @client.value_set_code_validation(options)
|
98
|
+
assert_response_ok(reply)
|
99
|
+
check_response_params(reply.body,'result','valueBoolean','true')
|
100
|
+
end
|
101
|
+
|
102
|
+
# validate v2 code
|
103
|
+
test "CT04#{how[0]}", "Validate a v2 code using identifier (#{how})" do
|
104
|
+
metadata {
|
105
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
106
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#validate-code"
|
107
|
+
validates resource: 'ValueSet', methods: ['$validate-code']
|
108
|
+
}
|
109
|
+
options = {
|
110
|
+
:operation => {
|
111
|
+
:method => how,
|
112
|
+
:parameters => {
|
113
|
+
'code' => { type: 'Code', value: 'BRN' },
|
114
|
+
'identifier' => { type: 'Uri', value: 'http://hl7.org/fhir/ValueSet/v2-0487' }
|
115
|
+
}
|
116
|
+
}
|
117
|
+
}
|
118
|
+
reply = @client.value_set_code_validation(options)
|
119
|
+
assert_response_ok(reply)
|
120
|
+
check_response_params(reply.body,'result','valueBoolean','true')
|
121
|
+
end
|
122
|
+
|
123
|
+
# lookup a v2 code
|
124
|
+
test "CT05#{how[0]}", "Lookup a v2 code using identifier (#{how})" do
|
125
|
+
metadata {
|
126
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
127
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#validate-code"
|
128
|
+
validates resource: 'ValueSet', methods: ['$lookup']
|
129
|
+
}
|
130
|
+
options = {
|
131
|
+
:operation => {
|
132
|
+
:method => how,
|
133
|
+
:parameters => {
|
134
|
+
'code' => { type: 'Code', value: 'BRN' },
|
135
|
+
'identifier' => { type: 'Uri', value: 'http://hl7.org/fhir/ValueSet/v2-0487' }
|
136
|
+
}
|
137
|
+
}
|
138
|
+
}
|
139
|
+
reply = @client.value_set_code_lookup(options)
|
140
|
+
assert_response_ok(reply)
|
141
|
+
check_response_params(reply.body,'display','valueString','Burn')
|
142
|
+
end
|
143
|
+
|
144
|
+
test "CT06#{how[0]}", "Validate a code by system (#{how})" do
|
145
|
+
metadata {
|
146
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
147
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#validate-code"
|
148
|
+
validates resource: 'ValueSet', methods: ['$validate-code']
|
149
|
+
}
|
150
|
+
options = {
|
151
|
+
:operation => {
|
152
|
+
:method => how,
|
153
|
+
:parameters => {
|
154
|
+
'code' => { type: 'Code', value: 'female' },
|
155
|
+
'system' => { type: 'Uri', value: 'http://hl7.org/fhir/administrative-gender' }
|
156
|
+
}
|
157
|
+
}
|
158
|
+
}
|
159
|
+
reply = @client.value_set_code_validation(options)
|
160
|
+
assert_response_ok(reply)
|
161
|
+
check_response_params(reply.body,'result','valueBoolean','true')
|
162
|
+
end
|
163
|
+
|
164
|
+
# validate v2 code
|
165
|
+
test "CT07#{how[0]}", "Validate a v2 code by system (#{how})" do
|
166
|
+
metadata {
|
167
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
168
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#validate-code"
|
169
|
+
validates resource: 'ValueSet', methods: ['$validate-code']
|
170
|
+
}
|
171
|
+
options = {
|
172
|
+
:operation => {
|
173
|
+
:method => how,
|
174
|
+
:parameters => {
|
175
|
+
'code' => { type: 'Code', value: 'BRN' },
|
176
|
+
'system' => { type: 'Uri', value: 'http://hl7.org/fhir/v2/0487' }
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
reply = @client.value_set_code_validation(options)
|
181
|
+
assert_response_ok(reply)
|
182
|
+
check_response_params(reply.body,'result','valueBoolean','true')
|
183
|
+
end
|
184
|
+
|
185
|
+
# lookup a v2 code
|
186
|
+
test "CT08#{how[0]}", "Lookup a v2 code by system (#{how})" do
|
187
|
+
metadata {
|
188
|
+
links "#{BASE_SPEC_LINK}/operations.html#executing"
|
189
|
+
links "#{BASE_SPEC_LINK}/valueset-operations.html#validate-code"
|
190
|
+
validates resource: 'ValueSet', methods: ['$lookup']
|
191
|
+
}
|
192
|
+
options = {
|
193
|
+
:operation => {
|
194
|
+
:method => how,
|
195
|
+
:parameters => {
|
196
|
+
'code' => { type: 'Code', value: 'BRN' },
|
197
|
+
'system' => { type: 'Uri', value: 'http://hl7.org/fhir/v2/0487' }
|
198
|
+
}
|
199
|
+
}
|
200
|
+
}
|
201
|
+
reply = @client.value_set_code_lookup(options)
|
202
|
+
assert_response_ok(reply)
|
203
|
+
check_response_params(reply.body,'display','valueString','Burn')
|
204
|
+
end
|
205
|
+
|
206
|
+
end # ['GET','POST'].each
|
207
|
+
|
208
|
+
def check_expansion_for_concepts(vs)
|
209
|
+
assert(vs.expansion,'ValueSet should contain expansion.')
|
210
|
+
assert(vs.expansion.contains,'ValueSet.expansion.contains elements are missing.')
|
211
|
+
|
212
|
+
concepts = vs.expansion.contains.map{|c|c.code}
|
213
|
+
|
214
|
+
expansion_missing = FHIR::ElementDefinition::TypeRefComponent::VALID_CODES[:code] - concepts
|
215
|
+
expansion_added = concepts - FHIR::ElementDefinition::TypeRefComponent::VALID_CODES[:code]
|
216
|
+
|
217
|
+
assert(expansion_missing.empty?,"ValueSet expansion is missing the following concepts: #{expansion_missing}")
|
218
|
+
assert(expansion_added.empty?,"ValueSet expansion contained some unexpected concepts: #{expansion_added}")
|
219
|
+
end
|
220
|
+
|
221
|
+
def check_response_params(contents,name,attribute,value)
|
222
|
+
begin
|
223
|
+
doc = Nokogiri::XML(contents)
|
224
|
+
if doc.errors.empty?
|
225
|
+
doc.root.add_namespace_definition('fhir', 'http://hl7.org/fhir')
|
226
|
+
doc.root.add_namespace_definition('xhtml', 'http://www.w3.org/1999/xhtml')
|
227
|
+
e = doc.root.xpath("./fhir:parameter[fhir:name[@value=\"#{name}\"]]/fhir:#{attribute}").first
|
228
|
+
assert(e[:value]==value,"Output parameters do not contain #{name}=#{value}")
|
229
|
+
else
|
230
|
+
hash = JSON.parse(contents)
|
231
|
+
params = hash['parameter']
|
232
|
+
p = params.select{|p|p['name']==name}.first
|
233
|
+
assert(p[attribute]==value,"Output parameters do not contain #{name}=#{value}")
|
234
|
+
end
|
235
|
+
rescue Exception => e
|
236
|
+
raise AssertionException.new 'Unable to parse response parameters', e.message
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
240
|
+
end
|
241
|
+
end
|
242
|
+
end
|