plan_executor 1.0.2 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +3 -2
- data/Gemfile +3 -6
- data/Gemfile.lock +52 -48
- data/README.md +2 -2
- data/fixtures/attachment/ccda_pdf.pdf +0 -0
- data/fixtures/attachment/ccda_pdf_base64.txt +2489 -0
- data/fixtures/attachment/ccda_structured.xml +1976 -0
- data/fixtures/attachment/ccda_unstructured.xml +2563 -0
- data/fixtures/daf/conformance-daf-query-responder.xml +2024 -193
- data/fixtures/diagnostic_report/diagnosticreport-familyhistory-create.xml +67 -0
- data/fixtures/diagnostic_report/diagnosticreport-hlatyping-create.xml +64 -0
- data/fixtures/diagnostic_report/diagnosticreport-pathologyreport-create.xml +312 -0
- data/fixtures/diagnostic_report/dr-100.xml +3 -3
- data/fixtures/diagnostic_report/dr-200.xml +5 -5
- data/fixtures/diagnostic_report/dr-300.xml +3 -3
- data/fixtures/diagnostic_report/dr-400.xml +3 -3
- data/fixtures/{diagnostic_order → diagnostic_request}/do-100.xml +57 -64
- data/fixtures/diagnostic_request/do-200.xml +73 -0
- data/fixtures/{diagnostic_order → diagnostic_request}/do-300.xml +73 -91
- data/{lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder → fixtures/diagnostic_request}/do-400.xml +74 -88
- data/fixtures/family_member_history/familymemberhistory-familyhistory-create.xml +27 -0
- data/fixtures/financial/claim-example-oral-average.xml +199 -0
- data/fixtures/financial/claim-example-oral-orthoplan.xml +298 -0
- data/fixtures/financial/claim-example.xml +98 -0
- data/fixtures/financial/eligibilityrequest-example.xml +40 -0
- data/fixtures/observation/obs-401.xml +7 -17
- data/fixtures/observation/obs-402.xml +7 -17
- data/fixtures/observation/obs-403.xml +4 -29
- data/fixtures/observation/obs-407.xml +4 -11
- data/fixtures/observation/observation-datawarehouse-create.xml +72 -0
- data/fixtures/observation/observation-familyhistory-create.xml +61 -0
- data/fixtures/observation/observation-germline-create.xml +72 -0
- data/fixtures/observation/observation-register-create.xml +72 -0
- data/fixtures/patch/medicationrequest-simple.xml +16 -0
- data/fixtures/patient/patient-example-updated.xml +1 -7
- data/fixtures/patient/patient-example-us-extensions.xml +119 -0
- data/fixtures/patient/patient-example.xml +46 -27
- data/fixtures/patient/patient-familyhistory-create.xml +45 -0
- data/fixtures/patient/patient-register-create.xml +47 -0
- data/fixtures/practitioner/practitioner-register-create.xml +32 -0
- data/fixtures/record/condition-example-f201-fever.xml +54 -49
- data/fixtures/record/condition-example-f205-infection.xml +16 -15
- data/fixtures/record/diagnosticreport-example-f201-brainct.xml +45 -18
- data/fixtures/record/encounter-example-f201-20130404.xml +42 -15
- data/fixtures/record/encounter-example-f202-20130128.xml +57 -15
- data/fixtures/record/observation-example-f202-temperature.xml +85 -60
- data/fixtures/record/organization-example-f201-aumc.xml +87 -4
- data/fixtures/record/organization-example-f203-bumc.xml +53 -4
- data/fixtures/record/patient-example-f201-roel.xml +108 -8
- data/fixtures/record/practitioner-example-f201-ab.xml +73 -14
- data/fixtures/record/procedure-example-f201-tpf.xml +39 -9
- data/fixtures/scheduling/slot-simple.xml +1 -1
- data/fixtures/sequence/sequence-register-create.xml +31 -0
- data/fixtures/specimen/spec-100.xml +8 -8
- data/fixtures/specimen/spec-400.xml +11 -11
- data/fixtures/specimen/spec-uslab-example1.xml +11 -11
- data/fixtures/specimen/specimen-familyhistory-create.xml +54 -0
- data/fixtures/specimen/specimen-register-create.xml +49 -0
- data/fixtures/terminology/codesystem-data-types.json +230 -0
- data/fixtures/terminology/codesystem-resource-types.json +482 -0
- data/fixtures/terminology/codesystem-simple.xml +129 -0
- data/fixtures/terminology/conceptmap-example.xml +141 -0
- data/fixtures/terminology/v2-codesystem.json +1297 -0
- data/fixtures/terminology/v2-valueset.json +16 -0
- data/fixtures/terminology/valueset-defined-types.json +25 -0
- data/fixtures/terminology/valueset-example.xml +111 -0
- data/fixtures/validation/observation.profile.xml +1534 -253
- data/fixtures/validation/observations/observation-example.xml +66 -0
- data/lib/FHIR_structure.json +129 -82
- data/lib/daf_resource_generator.rb +7 -7
- data/lib/data/resources.rb +50 -30
- data/lib/ext/client.rb +2 -2
- data/lib/plan_executor.rb +6 -1
- data/lib/resource_generator.rb +413 -212
- data/lib/tasks/tasks.rake +151 -20
- data/lib/tests/assertions.rb +24 -18
- data/lib/tests/base_test.rb +17 -3
- data/lib/tests/suites/argonaut_provider_connectathon_test.rb +234 -0
- data/lib/tests/suites/base_suite.rb +7 -3
- data/lib/tests/suites/connectathon_attachment_track_test.rb +124 -0
- data/lib/tests/suites/connectathon_audit_track.rb +113 -69
- data/lib/tests/suites/connectathon_care_plan_track.rb +237 -0
- data/lib/tests/suites/connectathon_fetch_patient_record.rb +40 -39
- data/lib/tests/suites/connectathon_financial_track.rb +231 -23
- data/lib/tests/suites/connectathon_genomics_track_test.rb +255 -0
- data/lib/tests/suites/connectathon_lab_order_track.rb +131 -104
- data/lib/tests/suites/connectathon_patch_track.rb +125 -0
- data/lib/tests/suites/connectathon_patient_track.rb +75 -68
- data/lib/tests/suites/connectathon_profile_validation.rb +9 -8
- data/lib/tests/suites/connectathon_scheduling_track.rb +127 -70
- data/lib/tests/suites/connectathon_terminology_track.rb +211 -34
- data/lib/tests/suites/daf_profiles_test.rb +112 -72
- data/lib/tests/suites/format_test.rb +113 -255
- data/lib/tests/suites/history_test.rb +72 -68
- data/lib/tests/suites/read_test.rb +31 -27
- data/lib/tests/suites/resource_test.rb +283 -85
- data/lib/tests/suites/search_test.rb +5 -3
- data/lib/tests/suites/search_test_robust.rb +8 -76
- data/lib/tests/suites/sprinkler_search_test.rb +104 -84
- data/lib/tests/suites/suite_engine.rb +17 -23
- data/lib/tests/suites/transaction_test.rb +117 -174
- data/lib/tests/testscripts/base_testscript.rb +425 -189
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-base-client-id-json.xml +517 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-base-client-id-xml.xml +517 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-bonus-client-id-json.xml +648 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-bonus-client-id-xml.xml +648 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/README.html +68 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-base-server-id-json.xml +515 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-base-server-id-xml.xml +515 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-bonus-server-id-json.xml +645 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-bonus-server-id-xml.xml +642 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/capabilities/PatientCapabilityStatement.xml +43 -0
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers-min.json +1 -3
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers-min.xml +0 -0
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers.json +5 -10
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers.xml +5 -5
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers-min.json +1 -3
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers-min.xml +0 -0
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers.json +5 -10
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers.xml +4 -5
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-PeterChalmers.json +96 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-PeterChalmers.xml +103 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-bonus-PeterChalmers.json +104 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-bonus-PeterChalmers.xml +108 -0
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers-min.json +1 -3
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers-min.xml +0 -0
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers.json +6 -10
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers.xml +6 -5
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers-min.json +1 -3
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers-min.xml +0 -0
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers.json +7 -11
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers.xml +5 -5
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers-min.json +2 -4
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers-min.xml +1 -1
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers.json +7 -11
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers.xml +8 -7
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/01-RegisterPatient/connectathon-14-patient-fhirclient-01-register-client-id-xml.xml +306 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/01-RegisterPatient/connectathon-14-patient-fhirclient-01-register-server-id-xml.xml +317 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/02-PatientUpdate/connectathon-14-patient-fhirclient-02-update-client-id-xml.xml +346 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/02-PatientUpdate/connectathon-14-patient-fhirclient-02-update-server-id-xml.xml +385 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/capabilities/PatientCapabilityStatement.json +50 -0
- data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient/_reference/conformance/PatientConformance.xml → scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/capabilities/PatientCapabilityStatement.xml} +10 -2
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-client-id.json +21 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-client-id.xml +15 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-server-id.json +20 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-server-id.xml +14 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-client-id.json +21 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-client-id.xml +15 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-server-id.json +20 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-server-id.xml +14 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-client-id-json.xml +262 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-client-id-xml.xml +262 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-server-id-json.xml +273 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-server-id-xml.xml +273 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-client-id-json.xml +290 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-client-id-xml.xml +290 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-server-id-json.xml +326 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-server-id-xml.xml +326 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-client-id-json.xml +247 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-client-id-xml.xml +247 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-server-id-json.xml +282 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-server-id-xml.xml +281 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-client-id-json.xml +330 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-client-id-xml.xml +330 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-server-id-json.xml +366 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-server-id-xml.xml +366 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-client-id-json.xml +527 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-client-id-xml.xml +527 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-server-id-json.xml +519 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-server-id-xml.xml +519 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-client-id-json.xml +290 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-client-id-xml.xml +290 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-server-id-json.xml +288 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-server-id-xml.xml +288 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-client-id-json.xml +252 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-client-id-xml.xml +252 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-server-id-json.xml +284 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-server-id-xml.xml +284 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-client-id-json.xml +897 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-client-id-xml.xml +897 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-server-id-json.xml +963 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-server-id-xml.xml +963 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/capabilities/PatientCapabilityStatement.json +50 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/capabilities/PatientCapabilityStatement.xml +42 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-client-id.json +86 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-client-id.xml +62 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-server-id.json +85 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-server-id.xml +61 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-client-id.json +86 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-client-id.xml +62 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-server-id.json +86 -0
- data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-server-id.xml +62 -0
- data/lib/tests/testscripts/scripts/spec/_reference/resources/patient-example-update.json +145 -0
- data/lib/tests/testscripts/scripts/spec/_reference/resources/patient-example.json +146 -0
- data/lib/tests/testscripts/scripts/spec/testscript-example-history.xml +191 -0
- data/lib/tests/testscripts/scripts/spec/testscript-example-multisystem.xml +190 -0
- data/lib/tests/testscripts/scripts/spec/testscript-example-readtest.xml +178 -0
- data/lib/tests/testscripts/scripts/spec/testscript-example-rule.xml +266 -0
- data/lib/tests/testscripts/scripts/spec/testscript-example-search.xml +177 -0
- data/lib/tests/testscripts/scripts/spec/testscript-example-update.xml +163 -0
- data/lib/tests/testscripts/scripts/spec/testscript-example.xml +228 -0
- data/lib/tests/testscripts/testscript_engine.rb +36 -22
- data/logs/.keep +0 -0
- data/plan_executor.gemspec +11 -3
- data/test/test_helper.rb +3 -3
- data/test/unit/fixtures_test.rb +24 -24
- data/test/unit/metadata_test.rb +19 -9
- data/test/unit/resource_generator_test.rb +20 -0
- metadata +244 -249
- data/fixtures/diagnostic_order/do-200.xml +0 -121
- data/fixtures/diagnostic_order/do-400.xml +0 -88
- data/fixtures/financial/claim-example-average.xml +0 -168
- data/fixtures/financial/claim-example-simple.xml +0 -67
- data/fixtures/order/order-100.xml +0 -61
- data/fixtures/order/order-200.xml +0 -61
- data/fixtures/order/order-300.xml +0 -61
- data/fixtures/order/order-400.xml +0 -61
- data/fixtures/order_response/ordresp-100.xml +0 -79
- data/fixtures/order_response/ordresp-110.xml +0 -79
- data/fixtures/order_response/ordresp-200.xml +0 -79
- data/fixtures/order_response/ordresp-210.xml +0 -79
- data/fixtures/order_response/ordresp-300.xml +0 -79
- data/fixtures/order_response/ordresp-310.xml +0 -79
- data/fixtures/order_response/ordresp-400.xml +0 -79
- data/fixtures/order_response/ordresp-410.xml +0 -79
- data/fixtures/patient/patient-example-us-extensions(us01).xml +0 -81
- data/fixtures/patient/patient-format-example.xml +0 -101
- data/fixtures/validation/observations/observation-example(example).xml +0 -50
- data/lib/tests/suites/argonaut_resprint_1_test.rb +0 -260
- data/lib/tests/suites/argonaut_resprint_2_test.rb +0 -369
- data/lib/tests/suites/argonaut_resprint_3_test.rb +0 -309
- data/lib/tests/suites/argonaut_sprint_1_test.rb +0 -187
- data/lib/tests/suites/argonaut_sprint_2_test.rb +0 -115
- data/lib/tests/suites/argonaut_sprint_3_test.rb +0 -208
- data/lib/tests/suites/argonaut_sprint_4_test.rb +0 -335
- data/lib/tests/suites/argonaut_sprint_5_test.rb +0 -196
- data/lib/tests/suites/argonaut_sprint_6_test.rb +0 -243
- data/lib/tests/suites/argonaut_sprint_7_test.rb +0 -161
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-base-client-id-json.xml +0 -348
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-base-client-id-xml.xml +0 -348
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-bonus-client-id-json.xml +0 -420
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-bonus-client-id-xml.xml +0 -420
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/README.html +0 -68
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-base-server-id-json.xml +0 -352
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-base-server-id-xml.xml +0 -352
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-bonus-server-id-json.xml +0 -421
- data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-bonus-server-id-xml.xml +0 -421
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/C-CDA_R2-1_CCD-ussg.xml +0 -3414
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A1-empty-on-instance.xml +0 -9
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A2-empty-by-ref.xml +0 -15
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A3-empty-by-identifier.xml +0 -13
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A4-empty-by-contained.xml +0 -15
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B1-CCDA-on-instance.xml +0 -15
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B2-CCDA-by-ref.xml +0 -21
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B3-CCDA-by-identifier.xml +0 -19
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B4-CCDA-by-contained.xml +0 -21
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaire-sdc-profile-example-ussg-fht.xml +0 -3905
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaireresponse-expected-ussg-fht-CCDA.xml +0 -190
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaireresponse-expected-ussg-fht-empty.xml +0 -177
- data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/track11-sdc-prepop-xml.xml +0 -142
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Client Assigned Id/track2-ts-suite1-expand-client-id.xml +0 -925
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Client Assigned Id/track2-ts-suite2-expand-filter-client-id.xml +0 -930
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Server Assigned Id/track2-ts-suite1-expand-server-id.xml +0 -953
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Server Assigned Id/track2-ts-suite2-expand-filter-server-id.xml +0 -958
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Lookup/track2-ts-suite5-loinc-lookup-xml.xml +0 -224
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Lookup/track2-ts-suite5-snomed-lookup-xml.xml +0 -224
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/README.html +0 -85
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Translate/track2-ts-suite6-translate-xml.xml +0 -224
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Client Assigned Id/track2-ts-suite3-validate-code-client-id.xml +0 -1807
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Client Assigned Id/track2-ts-suite4-validate-code-client-id.xml +0 -714
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Server Assigned Id/track2-ts-suite3-validate-code-server-id.xml +0 -1835
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Server Assigned Id/track2-ts-suite4-validate-code-server-id.xml +0 -742
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ConceptMapSuite6Conformance.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite1Conformance.xml +0 -17
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite2Conformance.xml +0 -17
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite3Conformance.xml +0 -14
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite4Conformance.xml +0 -14
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite5Conformance.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-2-a.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-2-b.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-3-a.xml +0 -13
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-3-b.xml +0 -13
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-4-a.xml +0 -15
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-4-b.xml +0 -15
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-loinc-input-5-2.xml +0 -10
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-loinc-input-5-3.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-snomed-input-5-2.xml +0 -10
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-snomed-input-5-3.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/translate-conceptmap-input-6-2.xml +0 -14
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/translate-conceptmap-input-6-3.xml +0 -15
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-1-expand-min.xml +0 -47
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-1-filter-min.xml +0 -23
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-2-expand-min.xml +0 -132
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-2-filter-min.xml +0 -38
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-3-expand-min.xml +0 -252
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-3-filter-min.xml +0 -58
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-4-expand-min.xml +0 -57
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-4-filter-min.xml +0 -28
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-1-expand-min.xml +0 -347
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-1-filter-min.xml +0 -33
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-2-expand-min.xml +0 -637
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-2-filter-min.xml +0 -33
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-3-filter-min.xml +0 -58
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/lookup-loinc-min.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/lookup-snomed-min.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite3-invalid-min.xml +0 -10
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite3-valid-min.xml +0 -7
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite4-invalid-min.xml +0 -10
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite4-valid-min.xml +0 -7
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/translate-conceptmap-min.xml +0 -17
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-1.xml +0 -55
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-2.xml +0 -122
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-3.xml +0 -222
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-4.xml +0 -65
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-1.xml +0 -31
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-2.xml +0 -31
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-3.xml +0 -31
- data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/translate-conceptmap-case-1.xml +0 -145
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/conformance/DecisionSupportServiceModule-Evaluate.xml +0 -17
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-request-payload.xml +0 -26
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-response-min-payload.xml +0 -7
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-response-payload.xml +0 -332
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-request-payload.xml +0 -28
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-response-min-payload.xml +0 -7
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-response-payload.xml +0 -20
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-request-payload.xml +0 -28
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-response-min-payload.xml +0 -7
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-response-payload.xml +0 -332
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-request-payload.xml +0 -28
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-response-min-payload.xml +0 -7
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-response-payload.xml +0 -8
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-request-payload.xml +0 -176
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-response-payload-min.xml +0 -32
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-response-payload.xml +0 -80
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/track3-cds-evaluate-cdc-immunization.xml +0 -290
- data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/track3-cds-evaluate-gao-profile.xml +0 -110
- data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/Client_Assigned_Id/TestScript_FHIR-Genomics.xml +0 -170
- data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/_reference/resources/sequence-example-1.xml +0 -31
- data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/_reference/resources/sequence-example-2.xml +0 -31
- 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 +0 -590
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder200-xml.xml +0 -587
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder300-xml.xml +0 -612
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder400-xml.xml +0 -635
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Peer-to-Peer/track7-laborder100-peer2peer-xml.xml +0 -752
- 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 +0 -187
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/conformance/html.xslt +0 -45
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-100-update.xml +0 -64
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-100.xml +0 -64
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-200-update.xml +0 -121
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-200.xml +0 -121
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-300-update.xml +0 -91
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-300.xml +0 -91
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-400-update.xml +0 -88
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-100.xml +0 -96
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-200.xml +0 -125
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-300.xml +0 -132
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-400.xml +0 -121
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-100.xml +0 -58
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-101.xml +0 -58
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-200.xml +0 -125
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-300.xml +0 -106
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-301.xml +0 -106
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-302.xml +0 -106
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-303.xml +0 -106
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-304.xml +0 -106
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-400.xml +0 -87
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-401.xml +0 -95
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-402.xml +0 -95
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-403.xml +0 -84
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-404.xml +0 -84
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-405.xml +0 -83
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-406.xml +0 -83
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-407.xml +0 -70
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-408.xml +0 -84
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-uslab-example5.xml +0 -102
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-100.xml +0 -61
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-200.xml +0 -61
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-300.xml +0 -61
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-400.xml +0 -61
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-100.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-110.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-200.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-210.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-300.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-310.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-400.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-410.xml +0 -79
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Organization/org-uslab-example3.xml +0 -49
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Patient/patient-uslab-example1.xml +0 -44
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Practitioner/pract-uslab-example1.xml +0 -18
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Practitioner/pract-uslab-example3.xml +0 -36
- 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 +0 -65
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-400.xml +0 -70
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-uslab-example1.xml +0 -82
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 1 Document.txt +0 -122
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 2 Document.txt +0 -103
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 3 Document.txt +0 -201
- data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 4 Document.txt +0 -310
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/conformance/MedicationStatementCreate.xml +0 -11
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/conformance/PatientSearchType.xml +0 -15
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/resources/medicationstatement-create.json +0 -39
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/resources/medicationstatement-patch.json +0 -3
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-medicationstatement-json-if-match.xml +0 -321
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-medicationstatement-json.xml +0 -303
- data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-peer2peer-patient-json.xml +0 -235
- data/test/fixtures/testscript-example.xml +0 -202
- data/test/fixtures/testscript-history.xml +0 -143
- data/test/fixtures/testscript-readtest.xml +0 -272
- data/test/fixtures/testscript-search.xml +0 -282
- data/test/fixtures/testscript-update.xml +0 -147
- data/test/unit/argonaut_sprint6_test.rb +0 -31
- data/test/unit/argonaut_sprint7_test.rb +0 -21
- data/test/unit/basic_test.rb +0 -27
- data/test/unit/fetch_patient_record_test.rb +0 -357
- data/test/unit/financial_test.rb +0 -41
@@ -40,7 +40,6 @@ module Crucible
|
|
40
40
|
@category = {id: 'testscript', title: 'TestScript'}
|
41
41
|
@id_map = {}
|
42
42
|
@response_map = {}
|
43
|
-
@warnings = []
|
44
43
|
@autocreate = []
|
45
44
|
@autodelete = []
|
46
45
|
@testscript = testscript
|
@@ -58,15 +57,36 @@ module Crucible
|
|
58
57
|
end
|
59
58
|
|
60
59
|
def id
|
61
|
-
@testscript.
|
60
|
+
@testscript.id
|
62
61
|
end
|
63
62
|
|
64
63
|
def title
|
65
64
|
"TS-#{id}"
|
66
65
|
end
|
67
66
|
|
67
|
+
def multiserver
|
68
|
+
@testscript.origin.length >= 2 || @testscript.destination.length >= 2
|
69
|
+
end
|
70
|
+
|
71
|
+
def containsRuleAssertions?
|
72
|
+
has_declared_rule = !@testscript.rule.empty? || !@testscript.ruleset.empty?
|
73
|
+
return true if has_declared_rule
|
74
|
+
|
75
|
+
if @testscript.setup
|
76
|
+
has_setup_rule = @testscript.setup.action.find{ |action| action.assert && (action.assert.rule || action.assert.ruleset) }
|
77
|
+
return true if has_setup_rule
|
78
|
+
end
|
79
|
+
|
80
|
+
has_test_rule = @testscript.test.find do |test|
|
81
|
+
test.action.find{ |action| action.assert && (action.assert.rule || action.assert.ruleset) }
|
82
|
+
end
|
83
|
+
return true if has_test_rule
|
84
|
+
|
85
|
+
false
|
86
|
+
end
|
87
|
+
|
68
88
|
def tests
|
69
|
-
@testscript.test.map { |test| "#{test.
|
89
|
+
@testscript.test.map { |test| "#{test.id} #{test.name} test".downcase.tr(' ', '_').to_sym }
|
70
90
|
end
|
71
91
|
|
72
92
|
def debug_prefix
|
@@ -74,12 +94,14 @@ module Crucible
|
|
74
94
|
end
|
75
95
|
|
76
96
|
def log(message)
|
77
|
-
|
97
|
+
output = "#{debug_prefix}#{message}"
|
98
|
+
puts output
|
99
|
+
FHIR.logger.info(output)
|
78
100
|
end
|
79
101
|
|
80
102
|
def define_tests
|
81
103
|
@testscript.test.each do |test|
|
82
|
-
test_method = "#{test.
|
104
|
+
test_method = "#{test.id} #{test.name} test".downcase.tr(' ', '_').to_sym
|
83
105
|
define_singleton_method test_method, -> { process_test(test) }
|
84
106
|
end
|
85
107
|
end
|
@@ -87,105 +109,250 @@ module Crucible
|
|
87
109
|
def load_fixtures
|
88
110
|
@fixtures = {}
|
89
111
|
@testscript.fixture.each do |fixture|
|
90
|
-
@fixtures[fixture.
|
91
|
-
@fixtures[fixture.
|
92
|
-
@autocreate << fixture.
|
93
|
-
@autodelete << fixture.
|
112
|
+
@fixtures[fixture.id] = get_reference(fixture.resource.reference)
|
113
|
+
@fixtures[fixture.id].id = nil unless @fixtures[fixture.id].nil? #fixture resources cannot have an ID
|
114
|
+
@autocreate << fixture.id if fixture.autocreate
|
115
|
+
@autodelete << fixture.id if fixture.autodelete
|
94
116
|
end
|
95
117
|
end
|
96
118
|
|
97
|
-
def collect_metadata(
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
119
|
+
def collect_metadata(_methods_only=nil)
|
120
|
+
metadata = {}
|
121
|
+
metadata['links'] = []
|
122
|
+
metadata['requires'] = nil
|
123
|
+
metadata['validates'] = nil
|
124
|
+
|
125
|
+
if @testscript.metadata
|
126
|
+
@testscript.metadata.link.each do |link|
|
127
|
+
metadata['links'] << link.url
|
128
|
+
end
|
129
|
+
@testscript.metadata.capability.each do |capability|
|
130
|
+
capability.link.each{|url| metadata['links'] << url }
|
131
|
+
metadata['links'] << capability.capabilities.reference if capability.capabilities.reference
|
132
|
+
end
|
133
|
+
end
|
134
|
+
|
135
|
+
{
|
136
|
+
@testscript.id => @testscript.test.map do |test|
|
137
|
+
{
|
138
|
+
"key" => "#{test.id} #{test.name} test".downcase.tr(' ', '_'),
|
139
|
+
"id" => "#{test.id} #{test.name} test".downcase.tr(' ', '_'),
|
140
|
+
"description" => test.description,
|
141
|
+
:test_method=> "#{test.id} #{test.name} test".downcase.tr(' ', '_').to_sym
|
142
|
+
|
143
|
+
}.merge(metadata)
|
144
|
+
end
|
145
|
+
}
|
146
|
+
|
103
147
|
end
|
104
148
|
|
105
|
-
def
|
106
|
-
|
107
|
-
|
108
|
-
|
149
|
+
def testreport_template
|
150
|
+
report = FHIR::TestReport.new(
|
151
|
+
{
|
152
|
+
'identifier' => { 'system' => 'http://projectcrucible.org', 'value' => id },
|
153
|
+
'status' => 'complete',
|
154
|
+
'TestScript' => { 'display' => id },
|
155
|
+
'issued' => Time.now.to_s.sub(' ','T').sub(' ','').insert(-3,':'),
|
156
|
+
'participant' => [
|
157
|
+
{
|
158
|
+
'type' => 'test-engine',
|
159
|
+
'uri' => 'http://projectcrucible.org',
|
160
|
+
'display' => 'plan_executor'
|
161
|
+
},
|
162
|
+
{
|
163
|
+
'type' => 'server',
|
164
|
+
'uri' => (@client ? @client.full_resource_url({}) : nil )
|
165
|
+
}
|
166
|
+
]
|
167
|
+
})
|
168
|
+
report.participant.pop if @client.nil?
|
169
|
+
report
|
170
|
+
end
|
171
|
+
|
172
|
+
# This overrides a method of the same name in the Crucible::Tests::BaseTest base class,
|
173
|
+
# to handle differences in the structure of the FHIR TestReport resource than Crucible's
|
174
|
+
# internal TestResult class.
|
175
|
+
def execute_test_methods
|
176
|
+
@testreport = testreport_template
|
109
177
|
begin
|
110
|
-
|
111
|
-
perform_action action
|
112
|
-
end unless @setup_failed || @metadata_only
|
178
|
+
@testreport.setup = setup if respond_to? :setup and not @metadata_only
|
113
179
|
rescue AssertionException => e
|
114
|
-
|
115
|
-
|
116
|
-
|
180
|
+
FHIR.logger.error "Setup Error #{id}: #{e.message}\n#{e.backtrace}"
|
181
|
+
@setup_failed = e
|
182
|
+
@testreport.status = 'error'
|
183
|
+
if @testreport.setup.action.last.operation
|
184
|
+
@testreport.setup.action.last.operation.message = "#{e.message}\n#{e.backtrace}"
|
185
|
+
elsif @testreport.setup.action.last.assert
|
186
|
+
@testreport.setup.action.last.assert.message = "#{e.message}\n#{e.backtrace}"
|
187
|
+
end
|
117
188
|
end
|
118
|
-
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
-
|
128
|
-
|
189
|
+
prefix = if @metadata_only then 'generating metadata' else 'executing' end
|
190
|
+
methods = tests
|
191
|
+
methods = tests & @tests_subset unless @tests_subset.blank?
|
192
|
+
methods.each do |test_method|
|
193
|
+
@client.requests = [] if @client
|
194
|
+
FHIR.logger.info "[#{title}#{('_' + @resource_class.name.demodulize) if @resource_class}] #{prefix}: #{test_method}..."
|
195
|
+
begin
|
196
|
+
@testreport.test << self.method(test_method).call
|
197
|
+
rescue => e
|
198
|
+
FHIR.logger.error "Fatal Error executing #{id} #{test_method}: #{e.message}\n#{e.backtrace}"
|
199
|
+
@testreport.status = 'error'
|
200
|
+
if @testreport.test.last.action.last.operation
|
201
|
+
@testreport.test.last.action.last.operation.message = "#{e.message}\n#{e.backtrace}"
|
202
|
+
elsif @testreport.test.last.action.last.assert
|
203
|
+
@testreport.test.last.action.last.assert.message = "#{e.message}\n#{e.backtrace}"
|
129
204
|
end
|
130
205
|
end
|
131
|
-
|
206
|
+
end
|
207
|
+
begin
|
208
|
+
@testreport.teardown = teardown if respond_to? :teardown and not @metadata_only
|
209
|
+
rescue
|
210
|
+
end
|
211
|
+
@testreport
|
212
|
+
end
|
213
|
+
|
214
|
+
# Returns a FHIR::TestReport::Test
|
215
|
+
def process_test(test)
|
216
|
+
result = FHIR::TestReport::Test.new({
|
217
|
+
'name' => test.id,
|
218
|
+
'description' => test.description,
|
219
|
+
'action' => []
|
220
|
+
})
|
221
|
+
@current_test = test
|
222
|
+
@last_response = nil # clear out any responses from previous tests
|
223
|
+
@test_failed = false
|
224
|
+
begin
|
225
|
+
test.action.each do |action|
|
226
|
+
if !@test_failed
|
227
|
+
@current_action = action
|
228
|
+
result.action << perform_action(action)
|
229
|
+
@test_failed = true if action_failed?(result.action.last)
|
230
|
+
end
|
231
|
+
end unless @metadata_only
|
232
|
+
rescue => e
|
233
|
+
@testreport.status = 'error'
|
234
|
+
FHIR.logger.error "Fatal Error processing TestScript #{test.id} Action: #{e.message}\n#{e.backtrace}"
|
132
235
|
end
|
133
236
|
result
|
134
237
|
end
|
135
238
|
|
239
|
+
def action_failed?(action)
|
240
|
+
return true if action.nil?
|
241
|
+
if action.operation
|
242
|
+
['fail','error'].include?(action.operation.result)
|
243
|
+
elsif action.assert
|
244
|
+
['fail','error'].include?(action.assert.result)
|
245
|
+
else
|
246
|
+
true
|
247
|
+
end
|
248
|
+
end
|
249
|
+
|
250
|
+
# Returns a FHIR::TestReport::Setup
|
136
251
|
def setup
|
137
|
-
return if @testscript.setup.blank? && @autocreate.empty?
|
252
|
+
return nil if @testscript.setup.blank? && @autocreate.empty?
|
253
|
+
report_setup = FHIR::TestReport::Setup.new
|
254
|
+
@current_test = :setup
|
138
255
|
@setup_failed = false
|
139
|
-
|
140
|
-
|
256
|
+
# Run any autocreates
|
257
|
+
@autocreate.each do |fixture_id|
|
258
|
+
if !@setup_failed
|
259
|
+
@current_action = "Autocreate Fixture #{fixture_id}"
|
141
260
|
@last_response = @client.create @fixtures[fixture_id]
|
142
261
|
@id_map[fixture_id] = @last_response.id
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
262
|
+
report_setup.action << FHIR::TestReport::Setup::Action.new({
|
263
|
+
'operation' => {
|
264
|
+
'result' => ( [200,201].include?(@last_response.code) ? 'pass' : 'fail' ),
|
265
|
+
'message' => @current_action
|
266
|
+
}
|
267
|
+
})
|
268
|
+
@setup_failed = true unless [200,201].include?(@last_response.code)
|
269
|
+
end
|
270
|
+
end unless @client.nil?
|
271
|
+
# Run setup actions if any
|
272
|
+
@testscript.setup.action.each do |action|
|
273
|
+
if !@setup_failed
|
274
|
+
@current_action = action
|
275
|
+
report_setup.action << perform_action(action)
|
276
|
+
@setup_failed = true if action_failed?(report_setup.action.last)
|
277
|
+
end
|
278
|
+
end unless @testscript.setup.blank?
|
279
|
+
report_setup
|
150
280
|
end
|
151
281
|
|
282
|
+
# Returns a FHIR::TestReport::Teardown
|
152
283
|
def teardown
|
153
|
-
return if @testscript.teardown.blank? && @autodelete.empty?
|
284
|
+
return nil if @testscript.teardown.blank? && @autodelete.empty?
|
285
|
+
report_teardown = FHIR::TestReport::Teardown.new
|
286
|
+
# First run teardown as normal
|
154
287
|
@testscript.teardown.action.each do |action|
|
155
|
-
|
288
|
+
report_teardown.action << perform_action(action)
|
156
289
|
end unless @testscript.teardown.blank?
|
290
|
+
# Next autodelete any auto fixtures
|
157
291
|
@autodelete.each do |fixture_id|
|
158
292
|
@last_response = @client.destroy @fixtures[fixture_id].class, @id_map[fixture_id]
|
159
293
|
@id_map.delete(fixture_id)
|
294
|
+
report_teardown.action << FHIR::TestReport::Setup::Action.new({
|
295
|
+
'operation' => {
|
296
|
+
'result' => ( [200,204].include?(@last_response.code) ? 'pass' : 'fail' ),
|
297
|
+
'message' => "Autodelete Fixture #{fixture_id}"
|
298
|
+
}
|
299
|
+
})
|
160
300
|
end unless @client.nil?
|
301
|
+
report_teardown
|
161
302
|
end
|
162
303
|
|
304
|
+
# Returns a FHIR::TestReport::Setup::Action
|
305
|
+
# containing either a FHIR::TestReport::Setup::Action::Operation
|
306
|
+
# or a FHIR::TestReport::Setup::Action::Assert
|
163
307
|
def perform_action(action)
|
164
|
-
|
165
|
-
|
308
|
+
result = FHIR::TestReport::Setup::Action.new
|
309
|
+
if action.operation
|
310
|
+
result.operation = execute_operation(action.operation)
|
311
|
+
elsif action.assert
|
312
|
+
result.assert = handle_assertion(action.assert)
|
313
|
+
end
|
314
|
+
result
|
166
315
|
end
|
167
316
|
|
317
|
+
# Returns a FHIR::TestReport::Setup::Action::Operation
|
168
318
|
def execute_operation(operation)
|
169
|
-
return if @client.nil?
|
170
|
-
|
319
|
+
return nil if @client.nil?
|
320
|
+
result = FHIR::TestReport::Setup::Action::Operation.new({
|
321
|
+
'result' => 'pass',
|
322
|
+
'message' => operation.description
|
323
|
+
})
|
324
|
+
|
325
|
+
requestHeaders = Hash[(operation.requestHeader || []).map{|u| [u.field, u.value]}] #Client needs upgrade to support
|
171
326
|
format = FHIR::Formats::ResourceFormat::RESOURCE_XML
|
172
327
|
format = FORMAT_MAP[operation.contentType] unless operation.contentType.nil?
|
173
328
|
format = FORMAT_MAP[operation.accept] unless operation.accept.nil?
|
174
329
|
|
175
330
|
operationCode = 'empty'
|
176
|
-
operationCode = operation.
|
331
|
+
operationCode = operation.type.code unless operation.type.nil?
|
177
332
|
|
178
333
|
case operationCode
|
179
334
|
when 'read'
|
180
|
-
if
|
181
|
-
@last_response = @client.read @fixtures[operation.targetId].class, @id_map[operation.targetId]
|
335
|
+
if operation.targetId
|
336
|
+
@last_response = @client.read @fixtures[operation.targetId].class, @id_map[operation.targetId], format
|
337
|
+
elsif operation.url
|
338
|
+
@last_response = @client.get replace_variables(operation.url), @client.fhir_headers({ format: format})
|
339
|
+
@last_response.resource = FHIR.from_contents(@last_response.body)
|
340
|
+
@last_response.resource_class = @last_response.resource.class
|
182
341
|
else
|
183
342
|
resource_type = replace_variables(operation.resource)
|
184
343
|
resource_id = replace_variables(operation.params)
|
185
|
-
@last_response = @client.read "FHIR::#{resource_type}".constantize, id_from_path(resource_id)
|
344
|
+
@last_response = @client.read "FHIR::#{resource_type}".constantize, id_from_path(resource_id), format
|
186
345
|
end
|
187
346
|
when 'vread'
|
188
|
-
|
347
|
+
if operation.url
|
348
|
+
@last_response = @client.get replace_variables(operation.url), @client.fhir_headers({ format: format})
|
349
|
+
@last_response.resource = FHIR.from_contents(@last_response.body)
|
350
|
+
@last_response.resource_class = @last_response.resource.class
|
351
|
+
else
|
352
|
+
resource_type = replace_variables(operation.resource)
|
353
|
+
resource_id = replace_variables(operation.params)
|
354
|
+
@last_response = @client.read "FHIR::#{resource_type}".constantize, resource_id, format
|
355
|
+
end
|
189
356
|
when 'search'
|
190
357
|
if operation.url.nil?
|
191
358
|
params = extract_operation_parameters(operation)
|
@@ -201,7 +368,7 @@ module Crucible
|
|
201
368
|
when 'create'
|
202
369
|
@last_response = @client.base_create(@fixtures[operation.sourceId], requestHeaders, format)
|
203
370
|
@id_map[operation.sourceId] = @last_response.id
|
204
|
-
when 'update'
|
371
|
+
when 'update','updateCreate'
|
205
372
|
target_id = nil
|
206
373
|
|
207
374
|
if !operation.targetId.nil?
|
@@ -210,15 +377,15 @@ module Crucible
|
|
210
377
|
target_id = id_from_path(replace_variables(operation.params))
|
211
378
|
end
|
212
379
|
|
213
|
-
raise "No target specified for update" if target_id.nil?
|
214
|
-
|
215
380
|
fixture = @fixtures[operation.sourceId]
|
216
|
-
fixture.
|
381
|
+
fixture.id = replace_variables(target_id) if fixture.id.nil?
|
217
382
|
@last_response = @client.update fixture, replace_variables(target_id), format
|
218
383
|
when 'transaction'
|
219
|
-
|
384
|
+
result.result = 'error'
|
385
|
+
result.message = 'transaction not implemented'
|
220
386
|
when 'conformance'
|
221
|
-
|
387
|
+
result.result = 'error'
|
388
|
+
result.message = 'conformance not implemented'
|
222
389
|
when 'delete'
|
223
390
|
if operation.targetId.nil?
|
224
391
|
params = replace_variables(operation.params)
|
@@ -228,49 +395,46 @@ module Crucible
|
|
228
395
|
@id_map.delete(operation.targetId)
|
229
396
|
end
|
230
397
|
when '$expand'
|
231
|
-
|
398
|
+
result.result = 'error'
|
399
|
+
result.message = '$expand not supported'
|
232
400
|
# @last_response = @client.value_set_expansion( extract_operation_parameters(operation) )
|
233
401
|
when '$validate'
|
234
|
-
|
402
|
+
result.result = 'error'
|
403
|
+
result.message = '$validate not supported'
|
235
404
|
# @last_response = @client.value_set_code_validation( extract_operation_parameters(operation) )
|
236
405
|
when '$validate-code'
|
237
|
-
|
238
|
-
|
239
|
-
|
240
|
-
#
|
241
|
-
#
|
242
|
-
#
|
243
|
-
#
|
244
|
-
|
245
|
-
|
246
|
-
|
247
|
-
|
248
|
-
|
249
|
-
options = {
|
250
|
-
:operation => {
|
251
|
-
:method => 'GET',
|
252
|
-
:parameters => {
|
253
|
-
'code' => { type: 'Code', value: params['code'] },
|
254
|
-
'identifier' => { type: 'Uri', value: params['system'] }
|
255
|
-
}
|
256
|
-
}
|
257
|
-
}
|
258
|
-
@last_response = @client.value_set_code_validation(options)
|
259
|
-
|
406
|
+
result.result = 'error'
|
407
|
+
result.message = '$validate-code not supported'
|
408
|
+
# options = {
|
409
|
+
# :operation => {
|
410
|
+
# :method => 'GET',
|
411
|
+
# :parameters => {
|
412
|
+
# 'code' => { type: 'Code', value: params['code'] },
|
413
|
+
# 'identifier' => { type: 'Uri', value: params['system'] }
|
414
|
+
# }
|
415
|
+
# }
|
416
|
+
# }
|
417
|
+
# @last_response = @client.value_set_code_validation(options)
|
260
418
|
when 'empty'
|
261
|
-
|
262
419
|
if !operation.params.nil? && !operation.resource.nil?
|
263
420
|
resource = "FHIR::#{operation.resource}".constantize
|
264
421
|
@last_response = @client.read resource, nil, FORMAT_MAP[operation.accept], nil, params: replace_variables(operation.params)
|
265
|
-
end
|
266
|
-
|
422
|
+
end
|
267
423
|
else
|
268
|
-
|
424
|
+
result.result = 'error'
|
425
|
+
result.message = "Undefined operation #{operation.type.to_json}"
|
426
|
+
FHIR.logger.error(result.message)
|
269
427
|
end
|
270
428
|
handle_response(operation)
|
429
|
+
result
|
271
430
|
end
|
272
431
|
|
432
|
+
# Returns a FHIR::TestReport::Setup::Action::Assert
|
273
433
|
def handle_assertion(assertion)
|
434
|
+
result = FHIR::TestReport::Setup::Action::Assert.new({
|
435
|
+
'result' => 'pass',
|
436
|
+
'message' => assertion.label || assertion.description
|
437
|
+
})
|
274
438
|
|
275
439
|
operator = :equals
|
276
440
|
operator = OPERATOR_MAP[assertion.operator] unless assertion.operator.nil?
|
@@ -278,102 +442,173 @@ module Crucible
|
|
278
442
|
warningOnly = false
|
279
443
|
warningOnly = assertion.warningOnly unless assertion.warningOnly.nil?
|
280
444
|
|
281
|
-
|
282
|
-
|
283
|
-
|
445
|
+
begin
|
446
|
+
case
|
447
|
+
when !assertion.contentType.nil?
|
448
|
+
call_assertion(:assert_resource_content_type, @last_response, assertion.contentType)
|
449
|
+
|
450
|
+
when !assertion.headerField.nil?
|
451
|
+
if assertion.direction && assertion.direction=='request'
|
452
|
+
header_value = @last_response.request[:headers][assertion.headerField]
|
453
|
+
msg_prefix = 'Request'
|
454
|
+
else
|
455
|
+
header_value = @last_response.response[:headers][assertion.headerField.downcase]
|
456
|
+
msg_prefix = 'Response'
|
457
|
+
end
|
458
|
+
call_assertion(:assert_operator, operator, replace_variables(assertion.value), header_value, "#{msg_prefix} Header field #{assertion.headerField}")
|
459
|
+
when !assertion.minimumId.nil?
|
460
|
+
call_assertion(:assert_minimum, @last_response, @fixtures[assertion.minimumId])
|
461
|
+
|
462
|
+
when !assertion.navigationLinks.nil?
|
463
|
+
call_assertion(:assert_navigation_links, @last_response.resource)
|
464
|
+
|
465
|
+
when !assertion.path.nil?
|
466
|
+
actual_value = nil
|
467
|
+
resource = nil
|
468
|
+
if assertion.sourceId.nil?
|
469
|
+
resource = @last_response.try(:resource) || FHIR.from_contents(@last_response.body)
|
470
|
+
else
|
471
|
+
resource = @fixtures[assertion.sourceId]
|
472
|
+
resource = @response_map[assertion.sourceId].try(:resource) || FHIR.from_contents(@response_map[assertion.sourceId].body) if resource.nil?
|
473
|
+
end
|
474
|
+
actual_value = extract_value_by_path(resource, assertion.path)
|
284
475
|
|
285
|
-
|
286
|
-
|
476
|
+
expected_value = replace_variables(assertion.value)
|
477
|
+
unless assertion.compareToSourceId.nil?
|
478
|
+
resource = @fixtures[assertion.compareToSourceId]
|
479
|
+
resource = @response_map[assertion.compareToSourceId].try(:resource) || FHIR.from_contents(@response_map[assertion.compareToSourceId].body) if resource.nil?
|
480
|
+
expected_value = extract_value_by_path(resource, assertion.path)
|
481
|
+
end
|
287
482
|
|
288
|
-
|
289
|
-
|
483
|
+
call_assertion(:assert_operator, operator, expected_value, actual_value)
|
484
|
+
when !assertion.compareToSourcePath.nil?
|
485
|
+
actual_value = nil
|
486
|
+
resource = nil
|
487
|
+
if assertion.sourceId
|
488
|
+
resource = @fixtures[assertion.sourceId]
|
489
|
+
resource = @response_map[assertion.sourceId].try(:resource) || FHIR.from_contents(@response_map[assertion.sourceId].body) if resource.nil?
|
490
|
+
else
|
491
|
+
raise AssertionException.new("compareToSourcePath requires sourceId: #{assertion.to_json}")
|
492
|
+
end
|
493
|
+
actual_value = extract_value_by_path(resource, assertion.compareToSourcePath)
|
290
494
|
|
291
|
-
|
292
|
-
|
495
|
+
expected_value = replace_variables(assertion.value)
|
496
|
+
unless assertion.compareToSourceId.nil?
|
497
|
+
resource = @fixtures[assertion.compareToSourceId]
|
498
|
+
resource = @response_map[assertion.compareToSourceId].try(:resource) || FHIR.from_contents(@response_map[assertion.compareToSourceId].body) if resource.nil?
|
499
|
+
expected_value = extract_value_by_path(resource, assertion.compareToSourcePath)
|
500
|
+
end
|
293
501
|
|
294
|
-
|
295
|
-
|
502
|
+
call_assertion(:assert_operator, operator, expected_value, actual_value)
|
503
|
+
when !assertion.resource.nil?
|
504
|
+
call_assertion(:assert_resource_type, @last_response, "FHIR::#{assertion.resource}".constantize)
|
296
505
|
|
297
|
-
|
298
|
-
|
299
|
-
resource_xml = @last_response.try(:resource).try(:to_xml) || @last_response.body
|
300
|
-
else
|
301
|
-
resource_xml = @fixtures[assertion.sourceId].try(:to_xml)
|
302
|
-
resource_xml = @response_map[assertion.sourceId].try(:resource).try(:to_xml) || @response_map[assertion.soureId].body if resource_xml.nil?
|
303
|
-
end
|
506
|
+
when !assertion.responseCode.nil?
|
507
|
+
call_assertion(:assert_operator, operator, assertion.responseCode, @last_response.response[:code].to_s)
|
304
508
|
|
305
|
-
|
509
|
+
when !assertion.response.nil?
|
510
|
+
call_assertion(:assert_response_code, @last_response, CODE_MAP[assertion.response])
|
306
511
|
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
512
|
+
when !assertion.validateProfileId.nil?
|
513
|
+
profile_uri = @testscript.profile.first{|p| p.id = assertion.validateProfileId}.reference
|
514
|
+
reply = @client.validate(@last_response.resource,{profile_uri: profile_uri})
|
515
|
+
call_assertion(:assert_valid_profile, reply.response, @last_response.resource.class)
|
311
516
|
|
312
|
-
|
517
|
+
when !assertion.expression.nil?
|
518
|
+
resource = nil
|
519
|
+
if assertion.sourceId.nil?
|
520
|
+
resource = @last_response.try(:resource) || FHIR.from_contents(@last_response.body)
|
521
|
+
else
|
522
|
+
resource = @fixtures[assertion.sourceId]
|
523
|
+
resource = @response_map[assertion.sourceId].try(:resource) || FHIR.from_contents(@response_map[assertion.sourceId].body) if resource.nil?
|
524
|
+
end
|
525
|
+
begin
|
526
|
+
unless FluentPath.evaluate(assertion.expression, resource.to_hash)
|
527
|
+
raise AssertionException.new("Expression did not evaluate to true: #{assertion.expression}", assertion.expression)
|
528
|
+
end
|
529
|
+
rescue => fpe
|
530
|
+
raise "Invalid Expression: #{assertion.expression}"
|
531
|
+
end
|
532
|
+
when !assertion.compareToSourceExpression.nil?
|
533
|
+
resource = nil
|
534
|
+
if assertion.sourceId
|
535
|
+
resource = @fixtures[assertion.sourceId]
|
536
|
+
resource = @response_map[assertion.sourceId].try(:resource) || FHIR.from_contents(@response_map[assertion.sourceId].body) if resource.nil?
|
537
|
+
else
|
538
|
+
raise AssertionException.new("compareToSourceExpression requires sourceId: #{assertion.to_json}")
|
539
|
+
end
|
540
|
+
begin
|
541
|
+
unless FluentPath.evaluate(assertion.compareToSourceExpression, resource.to_hash)
|
542
|
+
raise AssertionException.new("Expression did not evaluate to true: #{assertion.compareToSourceExpression}", assertion.compareToSourceExpression)
|
543
|
+
end
|
544
|
+
rescue => fpe
|
545
|
+
raise "Invalid Expression: #{assertion.compareToSourceExpression}"
|
546
|
+
end
|
547
|
+
else
|
548
|
+
result.result = 'error'
|
549
|
+
result.message = "Unhandled Assertion: #{assertion.to_json}"
|
313
550
|
end
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
|
320
|
-
|
321
|
-
call_assertion(:assert_operator, warningOnly, operator, assertion.responseCode, @last_response.response[:code], "Response Code #{assertion.responseCode}")
|
322
|
-
|
323
|
-
# call_assertion(:assert_response_code, warningOnly, @last_response, assertion.responseCode)
|
324
|
-
|
325
|
-
when !assertion.response.nil?
|
326
|
-
call_assertion(:assert_response_code, warningOnly, @last_response, CODE_MAP[assertion.response])
|
327
|
-
|
328
|
-
when !assertion.validateProfileId.nil?
|
329
|
-
profile_uri = @testscript.profile.first{|p| p.xmlId = assertion.validateProfileId}.reference
|
330
|
-
reply = @client.validate(@last_response.resource,{profile_uri: profile_uri})
|
331
|
-
call_assertion(:assert_valid_profile, warningOnly, reply.response, @last_response.resource.class)
|
332
|
-
|
333
|
-
else
|
334
|
-
raise "Unknown Assertion"
|
335
|
-
|
551
|
+
rescue AssertionException => ae
|
552
|
+
result.result = 'fail'
|
553
|
+
result.result = 'warning' if warningOnly
|
554
|
+
result.message = ae.message
|
555
|
+
rescue => e
|
556
|
+
result.result = 'error'
|
557
|
+
result.message = "#{e.message}\n#{e.backtrace}"
|
336
558
|
end
|
337
559
|
|
560
|
+
result
|
338
561
|
end
|
339
562
|
|
340
|
-
def call_assertion(method,
|
341
|
-
|
342
|
-
|
343
|
-
else
|
344
|
-
self.method(method).call(*params)
|
345
|
-
end
|
563
|
+
def call_assertion(method, *params)
|
564
|
+
FHIR.logger.debug "Assertion: #{method}"
|
565
|
+
self.method(method).call(*params)
|
346
566
|
end
|
347
567
|
|
348
568
|
def replace_variables(input)
|
349
569
|
return nil if input.nil?
|
570
|
+
return input unless input.include?('${')
|
350
571
|
|
351
572
|
@testscript.variable.each do |var|
|
352
|
-
if
|
353
|
-
|
354
|
-
|
355
|
-
|
356
|
-
|
357
|
-
|
358
|
-
|
359
|
-
|
360
|
-
|
361
|
-
|
362
|
-
|
363
|
-
|
364
|
-
|
573
|
+
if input.include? "${#{var.name}}"
|
574
|
+
variable_value = nil
|
575
|
+
|
576
|
+
if !var.headerField.nil?
|
577
|
+
variable_source_response = @response_map[var.sourceId]
|
578
|
+
headers = variable_source_response.response[:headers]
|
579
|
+
headers.each do |key,value|
|
580
|
+
variable_value = value if key.downcase == var.headerField.downcase
|
581
|
+
end
|
582
|
+
elsif !var.path.nil?
|
583
|
+
|
584
|
+
resource = nil
|
585
|
+
variable_source_response = @response_map[var.sourceId]
|
586
|
+
unless variable_source_response.nil?
|
587
|
+
resource = variable_source_response.try(:resource) || FHIR.from_contents(variable_source_response.body)
|
588
|
+
else
|
589
|
+
resource = @fixtures[var.sourceId]
|
590
|
+
end
|
591
|
+
|
592
|
+
variable_value = extract_value_by_path(resource, var.path)
|
365
593
|
end
|
366
594
|
|
367
|
-
|
368
|
-
|
369
|
-
|
595
|
+
unless variable_value
|
596
|
+
if var.defaultValue
|
597
|
+
variable_value = var.defaultValue
|
598
|
+
else
|
599
|
+
variable_value = ''
|
600
|
+
end
|
601
|
+
end
|
370
602
|
|
371
|
-
|
603
|
+
input.gsub!("${#{var.name}}", variable_value)
|
604
|
+
end
|
372
605
|
end
|
373
606
|
|
374
607
|
if input.include? '${'
|
375
|
-
|
376
|
-
|
608
|
+
unknown_variables = input.scan(/(\$\{)([A-Za-z0-9\_]+)(\})/).map{|x|x[1]}
|
609
|
+
message = "Unknown variables: #{unknown_variables.join(', ')}"
|
610
|
+
log message
|
611
|
+
warning { assert unknown_variables.empty?, message }
|
377
612
|
end
|
378
613
|
|
379
614
|
input
|
@@ -392,24 +627,35 @@ module Crucible
|
|
392
627
|
end
|
393
628
|
|
394
629
|
def handle_response(operation)
|
395
|
-
if !operation.responseId.blank? && operation.
|
630
|
+
if !operation.responseId.blank? && operation.type.code != 'delete'
|
396
631
|
log "Overwriting response #{operation.responseId}..." if @response_map.keys.include?(operation.responseId)
|
397
632
|
log "Storing response #{operation.responseId}..."
|
398
633
|
@response_map[operation.responseId] = @last_response
|
399
634
|
end
|
400
635
|
end
|
401
636
|
|
402
|
-
def
|
637
|
+
def extract_value_by_path(resource, path)
|
638
|
+
result = nil
|
639
|
+
begin
|
640
|
+
# First, try xpath
|
641
|
+
result = extract_xpath_value(resource.to_xml, path)
|
642
|
+
rescue
|
643
|
+
# If xpath fails, see if JSON path will work...
|
644
|
+
result = JsonPath.new(path).first(resource.to_json)
|
645
|
+
end
|
646
|
+
result
|
647
|
+
end
|
403
648
|
|
649
|
+
def extract_xpath_value(resource_xml, resource_xpath)
|
404
650
|
# Massage the xpath if it doesn't have fhir: namespace or if doesn't end in @value
|
405
651
|
# Also make it look in the entire xml document instead of just starting at the root
|
406
|
-
|
407
|
-
|
408
|
-
|
652
|
+
xpath = resource_xpath.split("/").map{|s| if s.starts_with?('fhir:') || s.length == 0 || s.starts_with?('@') then s else "fhir:#{s}" end}.join('/')
|
653
|
+
xpath = "#{xpath}/@value" unless xpath.ends_with? '@value'
|
654
|
+
xpath = "//#{xpath}"
|
409
655
|
|
410
656
|
resource_doc = Nokogiri::XML(resource_xml)
|
411
657
|
resource_doc.root.add_namespace_definition('fhir', 'http://hl7.org/fhir')
|
412
|
-
resource_element = resource_doc.xpath(
|
658
|
+
resource_element = resource_doc.xpath(xpath)
|
413
659
|
|
414
660
|
# This doesn't work on warningOnly; consider putting back in place
|
415
661
|
# raise AssertionException.new("[#{resource_xpath}] resolved to multiple values instead of a single value", resource_element.to_s) if resource_element.length>1
|
@@ -424,26 +670,16 @@ module Crucible
|
|
424
670
|
resource = nil
|
425
671
|
if reference.start_with?('#')
|
426
672
|
contained_id = reference[1..-1]
|
427
|
-
resource = @testscript.contained.select{|r| r.
|
673
|
+
resource = @testscript.contained.select{|r| r.id == contained_id}.first
|
674
|
+
elsif reference.start_with?('http')
|
675
|
+
raise "Remote references not supported: #{reference}"
|
428
676
|
else
|
429
|
-
|
430
|
-
return nil unless File.exist?
|
431
|
-
file = File.open(
|
677
|
+
filepath = File.expand_path reference, File.dirname(File.absolute_path(@testscript.url))
|
678
|
+
return nil unless File.exist? filepath
|
679
|
+
file = File.open(filepath, 'r:UTF-8', &:read)
|
432
680
|
file.encode!('UTF-8', 'binary', invalid: :replace, undef: :replace, replace: '')
|
433
681
|
file = preprocess(file) if file.include?('${')
|
434
|
-
|
435
|
-
resourceType = JSON.parse(file)["resourceType"]
|
436
|
-
resource = "FHIR::#{resourceType}".constantize.from_fhir_json(file)
|
437
|
-
else
|
438
|
-
resourceType = Nokogiri::XML(file).children.find{|x| x.class == Nokogiri::XML::Element}.name
|
439
|
-
fhirType = "FHIR::#{resourceType}".constantize
|
440
|
-
if fhirType.respond_to? :from_xml
|
441
|
-
resource = fhirType.from_xml(file)
|
442
|
-
else
|
443
|
-
puts "Unable to load reference: Method from_xml undefined on FHIR::#{resourceType}"
|
444
|
-
end
|
445
|
-
|
446
|
-
end
|
682
|
+
resource = FHIR.from_contents(file)
|
447
683
|
end
|
448
684
|
|
449
685
|
resource
|
@@ -458,8 +694,8 @@ module Crucible
|
|
458
694
|
if @preprocessed_vars.key?(match[0])
|
459
695
|
output.sub!("${#{match[0]}}", @preprocessed_vars[match[0]])
|
460
696
|
else
|
461
|
-
code_matches = /^(
|
462
|
-
|
697
|
+
code_matches = /^(C|c|D|d|CD|cd)(\d+)$/.match(match[0])
|
698
|
+
next unless code_matches && code_matches.size == 3
|
463
699
|
mock_data = generate_mock_data(code_matches[1], code_matches[2].to_i)
|
464
700
|
output.sub!("${#{match[0]}}", mock_data)
|
465
701
|
@preprocessed_vars[match[0]] = mock_data
|