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,311 @@
|
|
1
|
+
module Crucible
|
2
|
+
module Tests
|
3
|
+
class HistoryTest < BaseSuite
|
4
|
+
|
5
|
+
def id
|
6
|
+
'History001'
|
7
|
+
end
|
8
|
+
|
9
|
+
def description
|
10
|
+
'Initial Sprinkler tests (HI01,HI02,HI03,HI04,HI05,HI06,HI07,HI08,HI09,HI10,HI11) for testing resource history requests.'
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize(client1, client2=nil)
|
14
|
+
super(client1, client2)
|
15
|
+
@category = {id: 'core_functionality', title: 'Core Functionality'}
|
16
|
+
end
|
17
|
+
|
18
|
+
def setup
|
19
|
+
@resources = Crucible::Generator::Resources.new
|
20
|
+
@patient = @resources.minimal_patient
|
21
|
+
|
22
|
+
@create_date = Time.now.utc
|
23
|
+
|
24
|
+
@version = []
|
25
|
+
result = @client.create(@patient)
|
26
|
+
assert_response_ok(result)
|
27
|
+
@id = result.id
|
28
|
+
@version << result.version
|
29
|
+
|
30
|
+
@patient.xmlId = @id
|
31
|
+
@patient.telecom << FHIR::ContactPoint.new(system: 'email', value: 'foo@example.com')
|
32
|
+
|
33
|
+
update_result = @client.update(@patient, @id)
|
34
|
+
assert_response_ok(update_result)
|
35
|
+
@version << update_result.version
|
36
|
+
del_result = @client.destroy(FHIR::Patient, @id)
|
37
|
+
assert_response_code(del_result,204)
|
38
|
+
|
39
|
+
@entry_count = @version.length
|
40
|
+
# add one for deletion
|
41
|
+
@version_count = @entry_count + 1
|
42
|
+
end
|
43
|
+
|
44
|
+
test 'HI01','History for specific resource' do
|
45
|
+
metadata {
|
46
|
+
links "#{REST_SPEC_LINK}#history"
|
47
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
48
|
+
validates resource: "Patient", methods: ["history"]
|
49
|
+
}
|
50
|
+
|
51
|
+
result = @client.resource_instance_history(FHIR::Patient,@id)
|
52
|
+
assert_response_ok result
|
53
|
+
bundle = result.resource
|
54
|
+
|
55
|
+
assert_equal "history", bundle.fhirType, "The bundle type is not correct"
|
56
|
+
assert_equal @version_count, bundle.total, "the number of returned versions is not correct"
|
57
|
+
check_sort_order(bundle.entry)
|
58
|
+
end
|
59
|
+
|
60
|
+
test 'HI01.1','History request entries' do
|
61
|
+
metadata {
|
62
|
+
links "#{REST_SPEC_LINK}#history"
|
63
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
64
|
+
validates resource: "Patient", methods: ["history"]
|
65
|
+
}
|
66
|
+
result = @client.resource_instance_history(FHIR::Patient,@id)
|
67
|
+
assert_response_ok result
|
68
|
+
bundle = result.resource
|
69
|
+
entries = bundle.entry
|
70
|
+
|
71
|
+
assert_equal 1, entries.select{|entry| entry.request.try(:method) == 'DELETE' }.size, 'Wrong number of DELETE transactions in the history bundle'
|
72
|
+
assert_equal 1, entries.select{|entry| entry.request.try(:method) == 'PUT' }.size, 'Wrong number of PUT transactions in the history bundle'
|
73
|
+
assert_equal 1, entries.select{|entry| entry.request.try(:method) == 'POST' }.size, 'Wrong number of POST transactions in the history bundle'
|
74
|
+
|
75
|
+
end
|
76
|
+
|
77
|
+
test "HI02", "full history of a resource by id with since" do
|
78
|
+
metadata {
|
79
|
+
links "#{REST_SPEC_LINK}#history"
|
80
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
81
|
+
validates resource: "Patient", methods: ["history"]
|
82
|
+
}
|
83
|
+
|
84
|
+
before = @create_date - 1.minute
|
85
|
+
after = before + 1.hour
|
86
|
+
|
87
|
+
all_history = @client.resource_instance_history(FHIR::Patient,@id)
|
88
|
+
|
89
|
+
result = @client.resource_instance_history_as_of(FHIR::Patient,@id,before)
|
90
|
+
assert_response_ok result
|
91
|
+
bundle = result.resource
|
92
|
+
|
93
|
+
assert_equal @version_count, bundle.total, "the number of returned versions since the creation date is not correct"
|
94
|
+
|
95
|
+
entry_ids_are_present(bundle.entry)
|
96
|
+
check_sort_order(bundle.entry)
|
97
|
+
|
98
|
+
result = @client.resource_instance_history_as_of(FHIR::Patient,@id,after)
|
99
|
+
assert_response_ok result
|
100
|
+
assert_equal 0, result.resource.total, "there should not be any history one hour after the creation date"
|
101
|
+
end
|
102
|
+
|
103
|
+
test "HI03", "individual history versions" do
|
104
|
+
metadata {
|
105
|
+
links "#{REST_SPEC_LINK}#history"
|
106
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
107
|
+
validates resource: "Patient", methods: ["vread", "history"]
|
108
|
+
}
|
109
|
+
|
110
|
+
result = @client.resource_instance_history(FHIR::Patient,@id)
|
111
|
+
assert_response_ok result
|
112
|
+
|
113
|
+
bundle = result.resource
|
114
|
+
|
115
|
+
active_entries(bundle.entry).each do |entry|
|
116
|
+
pulled = @client.vread(FHIR::Patient, entry.resource.xmlId, entry.resource.meta.versionId)
|
117
|
+
assert_response_ok pulled
|
118
|
+
assert !pulled.nil?, "Cannot find version that was present in history"
|
119
|
+
end
|
120
|
+
|
121
|
+
deleted_entries(bundle.entry).each do |entry|
|
122
|
+
# FIXME: Should we parse the request URL or drop this assertion?
|
123
|
+
if entry.resource
|
124
|
+
pulled = @client.vread(FHIR::Patient, entry.resource.xmlId, entry.resource.meta.versionId)
|
125
|
+
assert pulled.resource.nil?, "resource should not be found since it was deleted"
|
126
|
+
assert_response_gone pulled
|
127
|
+
end
|
128
|
+
end
|
129
|
+
end
|
130
|
+
|
131
|
+
test "HI04", "history for missing resource" do
|
132
|
+
metadata {
|
133
|
+
links "#{REST_SPEC_LINK}#history"
|
134
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
135
|
+
validates resource: "Patient", methods: ["history"]
|
136
|
+
}
|
137
|
+
|
138
|
+
result = @client.resource_instance_history(FHIR::Patient,'3141592unlikely')
|
139
|
+
assert_response_not_found result
|
140
|
+
assert result.resource.nil?, 'bad history request should not return a resource'
|
141
|
+
end
|
142
|
+
|
143
|
+
test "HI06", "all history for resource with since" do
|
144
|
+
metadata {
|
145
|
+
links "#{REST_SPEC_LINK}#history"
|
146
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
147
|
+
validates resource: "Patient", methods: ["history-type"]
|
148
|
+
}
|
149
|
+
|
150
|
+
before = @create_date - 1.minute
|
151
|
+
after = Time.now.utc + 1.hour
|
152
|
+
|
153
|
+
result = @client.resource_history_as_of(FHIR::Patient,before)
|
154
|
+
assert_response_ok result
|
155
|
+
bundle = result.resource
|
156
|
+
|
157
|
+
entry_ids_are_present(bundle.entry)
|
158
|
+
check_sort_order(bundle.entry)
|
159
|
+
|
160
|
+
|
161
|
+
result = @client.resource_history_as_of(FHIR::Patient,after)
|
162
|
+
assert_response_ok result
|
163
|
+
assert_equal 0, result.resource.total, "Setting since to a future moment still returns history"
|
164
|
+
|
165
|
+
end
|
166
|
+
|
167
|
+
test "HI08", "all history whole system with since" do
|
168
|
+
metadata {
|
169
|
+
links "#{REST_SPEC_LINK}#history"
|
170
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
171
|
+
validates resource: nil, methods: ["history-system"]
|
172
|
+
}
|
173
|
+
|
174
|
+
before = @create_date - 1.minute
|
175
|
+
after = Time.now.utc + 1.hour
|
176
|
+
|
177
|
+
result = @client.all_history_as_of(before)
|
178
|
+
assert_response_ok result
|
179
|
+
bundle = result.resource
|
180
|
+
entry_ids_are_present(bundle.entry)
|
181
|
+
check_sort_order(bundle.entry)
|
182
|
+
|
183
|
+
warning { assert_navigation_links(bundle) }
|
184
|
+
|
185
|
+
result = @client.resource_history_as_of(FHIR::Patient,after)
|
186
|
+
assert_response_ok result
|
187
|
+
assert_equal 0, result.resource.total, "Setting since to a future moment still returns history"
|
188
|
+
|
189
|
+
end
|
190
|
+
|
191
|
+
|
192
|
+
test "HI09", "resource history page forward" do
|
193
|
+
metadata {
|
194
|
+
links "#{REST_SPEC_LINK}#history"
|
195
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
196
|
+
validates resource: "Patient", methods: ["history-type"]
|
197
|
+
}
|
198
|
+
|
199
|
+
page_size = 2
|
200
|
+
page = @client.history(resource: FHIR::Patient, history: {since: (Time.now.utc - 1.hour), count: page_size})
|
201
|
+
|
202
|
+
forward_count = 0
|
203
|
+
# browse forwards
|
204
|
+
while page != nil
|
205
|
+
assert !page.resource.nil?, "Unable to page forward through results. A bundle was not returned from the page forward request."
|
206
|
+
warning { entry_ids_are_present(page.resource.entry) }
|
207
|
+
assert page.resource.entry.size <= page_size, "Server returned a page with more entries than set by _count"
|
208
|
+
forward_count += page.resource.entry.size
|
209
|
+
page = @client.next_page(page)
|
210
|
+
end
|
211
|
+
|
212
|
+
assert forward_count > 2, "there should be at least 2 history entries"
|
213
|
+
end
|
214
|
+
|
215
|
+
test "HI10", "resource history page backwards" do
|
216
|
+
metadata {
|
217
|
+
links "#{REST_SPEC_LINK}#history"
|
218
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
219
|
+
validates resource: "Patient", methods: ["history-type"]
|
220
|
+
}
|
221
|
+
|
222
|
+
page_size = 2
|
223
|
+
page = @client.history(resource: FHIR::Patient, history: {since: (Time.now.utc - 1.hour), count: page_size})
|
224
|
+
|
225
|
+
forward_count = 0
|
226
|
+
last_page = page
|
227
|
+
# browse forwards
|
228
|
+
while page != nil
|
229
|
+
assert !page.resource.nil?, "Unable to page forward through results. A bundle was not returned from the page forward request."
|
230
|
+
forward_count += page.resource.entry.size
|
231
|
+
page = @client.next_page(page)
|
232
|
+
last_page = page if page
|
233
|
+
end
|
234
|
+
|
235
|
+
backward_count = 0
|
236
|
+
page = last_page
|
237
|
+
# browse backwards
|
238
|
+
while page != nil
|
239
|
+
warning { entry_ids_are_present(page.resource.entry) }
|
240
|
+
assert page.resource.entry.size <= page_size, "Server returned a page with more entries than set by _count"
|
241
|
+
backward_count += page.resource.entry.size
|
242
|
+
page = @client.next_page(page, FHIR::Sections::Feed::BACKWARD)
|
243
|
+
end
|
244
|
+
|
245
|
+
assert_equal forward_count, backward_count, "entry numbers were different moving forwards and backwards"
|
246
|
+
|
247
|
+
end
|
248
|
+
|
249
|
+
test "HI11", "first page full history" do
|
250
|
+
metadata {
|
251
|
+
links "#{REST_SPEC_LINK}#history"
|
252
|
+
requires resource: "Patient", methods: ["create", "update", "delete"]
|
253
|
+
validates resource: nil, methods: ["history-system"]
|
254
|
+
}
|
255
|
+
|
256
|
+
history = @client.all_history
|
257
|
+
assert !history.resource.nil?, "A bundle was not returned from the history request."
|
258
|
+
assert history.resource.entry.size >= 3, "there should be at least 3 history entries"
|
259
|
+
end
|
260
|
+
|
261
|
+
###
|
262
|
+
### Test first and last pages
|
263
|
+
###
|
264
|
+
|
265
|
+
|
266
|
+
####
|
267
|
+
#### Check sice with timezones?????
|
268
|
+
####
|
269
|
+
|
270
|
+
def deleted_entries(entries)
|
271
|
+
entries.select do |entry|
|
272
|
+
assert !entry.request.nil?, "history bundle entries do not have request elements, deleted entries cannot be distinguished"
|
273
|
+
entry.request.try(:method) == "DELETE"
|
274
|
+
end
|
275
|
+
end
|
276
|
+
|
277
|
+
def active_entries(entries)
|
278
|
+
entries - deleted_entries(entries)
|
279
|
+
end
|
280
|
+
|
281
|
+
|
282
|
+
def entry_ids_are_present(entries)
|
283
|
+
relevant_entries = entries.select{|x|x.request.try(:method)!='DELETE'}
|
284
|
+
ids = relevant_entries.map(&:resource).map(&:xmlId).compact rescue assert(false, 'Unable to find IDs for resources returned by the bundle')
|
285
|
+
|
286
|
+
# check that we have ids and self links
|
287
|
+
assert_equal relevant_entries.length, ids.size, 'All PUT and POST entries must have an ID'
|
288
|
+
end
|
289
|
+
|
290
|
+
def url?(v)
|
291
|
+
v =~ /\A#{URI::regexp}\z/
|
292
|
+
end
|
293
|
+
|
294
|
+
def check_sort_order(entries)
|
295
|
+
relevant_entries = entries.select{|x|x.request.try(:method)!='DELETE'}
|
296
|
+
relevant_entries.map!(&:resource).map!(&:meta).compact rescue assert(false, 'Unable to find meta for resources returned by the bundle')
|
297
|
+
|
298
|
+
relevant_entries.each_cons(2) do |left, right|
|
299
|
+
if !left.versionId.nil? && !right.versionId.nil?
|
300
|
+
assert (left.versionId > right.versionId), 'Result contains entries in the wrong order.'
|
301
|
+
elsif !left.lastUpdated.nil? && !right.lastUpdated.nil?
|
302
|
+
assert (left.lastUpdated >= right.lastUpdated), 'Result contains entries in the wrong order.'
|
303
|
+
else
|
304
|
+
raise AssertionException.new 'Unable to determine if entries are in the correct order -- no meta.versionId or meta.lastUpdated'
|
305
|
+
end
|
306
|
+
end
|
307
|
+
end
|
308
|
+
|
309
|
+
end
|
310
|
+
end
|
311
|
+
end
|
@@ -0,0 +1,104 @@
|
|
1
|
+
module Crucible
|
2
|
+
module Tests
|
3
|
+
class ReadTest < BaseSuite
|
4
|
+
|
5
|
+
def id
|
6
|
+
'ReadTest'
|
7
|
+
end
|
8
|
+
|
9
|
+
def description
|
10
|
+
'Initial Sprinkler tests (R001, R002, R003, R004) for testing basic READ requests.'
|
11
|
+
end
|
12
|
+
|
13
|
+
def initialize(client1, client2=nil)
|
14
|
+
super(client1, client2)
|
15
|
+
@category = {id: 'core_functionality', title: 'Core Functionality'}
|
16
|
+
end
|
17
|
+
|
18
|
+
def setup
|
19
|
+
@patient = ReadTest.createPatient('Emerald', 'Caro')
|
20
|
+
reply = @client.create(@patient)
|
21
|
+
@id = reply.id
|
22
|
+
@body = reply.body
|
23
|
+
end
|
24
|
+
|
25
|
+
def teardown
|
26
|
+
@client.destroy(FHIR::Patient, @id)
|
27
|
+
end
|
28
|
+
|
29
|
+
def self.createPatient(family, given)
|
30
|
+
patient = FHIR::Patient.new(name: [FHIR::HumanName.new(family: [family], given: [given])])
|
31
|
+
end
|
32
|
+
|
33
|
+
# [SprinklerTest("R001", "Result headers on normal read")]
|
34
|
+
test 'R001', 'Result headers on normal read.' do
|
35
|
+
metadata {
|
36
|
+
links "#{REST_SPEC_LINK}#read"
|
37
|
+
requires resource: "Patient", methods: ["create", "read", "delete"]
|
38
|
+
validates resource: "Patient", methods: ["read"]
|
39
|
+
}
|
40
|
+
|
41
|
+
assert(@id, 'Setup was unable to create a patient.',@body)
|
42
|
+
reply = @client.read(FHIR::Patient, @id)
|
43
|
+
assert_response_ok(reply)
|
44
|
+
assert_equal @id, reply.id, 'Server returned wrong patient.'
|
45
|
+
warning { assert_valid_resource_content_type_present(reply) }
|
46
|
+
warning { assert_etag_present(reply) }
|
47
|
+
warning { assert_last_modified_present(reply) }
|
48
|
+
end
|
49
|
+
|
50
|
+
# [SprinklerTest("R002", "Read unknown resource type")]
|
51
|
+
test 'R002', 'Read unknown resource type.' do
|
52
|
+
metadata {
|
53
|
+
links "#{REST_SPEC_LINK}#read"
|
54
|
+
links "#{REST_SPEC_LINK}#update"
|
55
|
+
}
|
56
|
+
|
57
|
+
reply = @client.read(Crucible::Tests::ReadTest, @id)
|
58
|
+
assert_response_not_found(reply)
|
59
|
+
end
|
60
|
+
|
61
|
+
# [SprinklerTest("R003", "Read non-existing resource id")]
|
62
|
+
test 'R003', 'Read non-existing resource id.' do
|
63
|
+
metadata {
|
64
|
+
links "#{REST_SPEC_LINK}#read"
|
65
|
+
requires resource: "Patient", methods: ["create", "read", "delete"]
|
66
|
+
validates resource: "Patient", methods: ["read"]
|
67
|
+
}
|
68
|
+
|
69
|
+
reply = @client.read(FHIR::Patient, 'Supercalifragilisticexpialidocious')
|
70
|
+
assert_response_not_found(reply)
|
71
|
+
end
|
72
|
+
|
73
|
+
# [SprinklerTest("R004", "Read bad formatted resource id")]
|
74
|
+
test 'R004', 'Read invalid format resource id' do
|
75
|
+
metadata {
|
76
|
+
links "#{REST_SPEC_LINK}#read"
|
77
|
+
links "#{BASE_SPEC_LINK}/datatypes.html#id"
|
78
|
+
links "#{BASE_SPEC_LINK}/resource.html#id"
|
79
|
+
requires resource: "Patient", methods: ["create", "read", "delete"]
|
80
|
+
validates resource: "Patient", methods: ["read"]
|
81
|
+
}
|
82
|
+
|
83
|
+
reply = @client.read(FHIR::Patient, 'Invalid-ID-Because_Of_!@$Special_Characters_and_Length_Over_Sixty_Four_Characters')
|
84
|
+
assert_response_bad(reply)
|
85
|
+
end
|
86
|
+
|
87
|
+
test 'R005', 'Read _summary=text' do
|
88
|
+
metadata {
|
89
|
+
links "#{REST_SPEC_LINK}#read"
|
90
|
+
links "#{BASE_SPEC_LINK}/datatypes.html#id"
|
91
|
+
links "#{BASE_SPEC_LINK}/resource.html#id"
|
92
|
+
requires resource: "Patient", methods: ["create", "read", "delete"]
|
93
|
+
validates resource: "Patient", methods: ["read"]
|
94
|
+
}
|
95
|
+
|
96
|
+
assert(@id, 'Setup was unable to create a patient.', @body)
|
97
|
+
reply = @client.read(FHIR::Patient, @id, @client.default_format, 'text')
|
98
|
+
assert_response_ok(reply)
|
99
|
+
assert(reply.try(:resource).try(:text), 'Requested summary narrative was not provided.', reply.body)
|
100
|
+
end
|
101
|
+
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|