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.
Files changed (420) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +1 -0
  3. data/.travis.yml +3 -2
  4. data/Gemfile +3 -6
  5. data/Gemfile.lock +52 -48
  6. data/README.md +2 -2
  7. data/fixtures/attachment/ccda_pdf.pdf +0 -0
  8. data/fixtures/attachment/ccda_pdf_base64.txt +2489 -0
  9. data/fixtures/attachment/ccda_structured.xml +1976 -0
  10. data/fixtures/attachment/ccda_unstructured.xml +2563 -0
  11. data/fixtures/daf/conformance-daf-query-responder.xml +2024 -193
  12. data/fixtures/diagnostic_report/diagnosticreport-familyhistory-create.xml +67 -0
  13. data/fixtures/diagnostic_report/diagnosticreport-hlatyping-create.xml +64 -0
  14. data/fixtures/diagnostic_report/diagnosticreport-pathologyreport-create.xml +312 -0
  15. data/fixtures/diagnostic_report/dr-100.xml +3 -3
  16. data/fixtures/diagnostic_report/dr-200.xml +5 -5
  17. data/fixtures/diagnostic_report/dr-300.xml +3 -3
  18. data/fixtures/diagnostic_report/dr-400.xml +3 -3
  19. data/fixtures/{diagnostic_order → diagnostic_request}/do-100.xml +57 -64
  20. data/fixtures/diagnostic_request/do-200.xml +73 -0
  21. data/fixtures/{diagnostic_order → diagnostic_request}/do-300.xml +73 -91
  22. data/{lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder → fixtures/diagnostic_request}/do-400.xml +74 -88
  23. data/fixtures/family_member_history/familymemberhistory-familyhistory-create.xml +27 -0
  24. data/fixtures/financial/claim-example-oral-average.xml +199 -0
  25. data/fixtures/financial/claim-example-oral-orthoplan.xml +298 -0
  26. data/fixtures/financial/claim-example.xml +98 -0
  27. data/fixtures/financial/eligibilityrequest-example.xml +40 -0
  28. data/fixtures/observation/obs-401.xml +7 -17
  29. data/fixtures/observation/obs-402.xml +7 -17
  30. data/fixtures/observation/obs-403.xml +4 -29
  31. data/fixtures/observation/obs-407.xml +4 -11
  32. data/fixtures/observation/observation-datawarehouse-create.xml +72 -0
  33. data/fixtures/observation/observation-familyhistory-create.xml +61 -0
  34. data/fixtures/observation/observation-germline-create.xml +72 -0
  35. data/fixtures/observation/observation-register-create.xml +72 -0
  36. data/fixtures/patch/medicationrequest-simple.xml +16 -0
  37. data/fixtures/patient/patient-example-updated.xml +1 -7
  38. data/fixtures/patient/patient-example-us-extensions.xml +119 -0
  39. data/fixtures/patient/patient-example.xml +46 -27
  40. data/fixtures/patient/patient-familyhistory-create.xml +45 -0
  41. data/fixtures/patient/patient-register-create.xml +47 -0
  42. data/fixtures/practitioner/practitioner-register-create.xml +32 -0
  43. data/fixtures/record/condition-example-f201-fever.xml +54 -49
  44. data/fixtures/record/condition-example-f205-infection.xml +16 -15
  45. data/fixtures/record/diagnosticreport-example-f201-brainct.xml +45 -18
  46. data/fixtures/record/encounter-example-f201-20130404.xml +42 -15
  47. data/fixtures/record/encounter-example-f202-20130128.xml +57 -15
  48. data/fixtures/record/observation-example-f202-temperature.xml +85 -60
  49. data/fixtures/record/organization-example-f201-aumc.xml +87 -4
  50. data/fixtures/record/organization-example-f203-bumc.xml +53 -4
  51. data/fixtures/record/patient-example-f201-roel.xml +108 -8
  52. data/fixtures/record/practitioner-example-f201-ab.xml +73 -14
  53. data/fixtures/record/procedure-example-f201-tpf.xml +39 -9
  54. data/fixtures/scheduling/slot-simple.xml +1 -1
  55. data/fixtures/sequence/sequence-register-create.xml +31 -0
  56. data/fixtures/specimen/spec-100.xml +8 -8
  57. data/fixtures/specimen/spec-400.xml +11 -11
  58. data/fixtures/specimen/spec-uslab-example1.xml +11 -11
  59. data/fixtures/specimen/specimen-familyhistory-create.xml +54 -0
  60. data/fixtures/specimen/specimen-register-create.xml +49 -0
  61. data/fixtures/terminology/codesystem-data-types.json +230 -0
  62. data/fixtures/terminology/codesystem-resource-types.json +482 -0
  63. data/fixtures/terminology/codesystem-simple.xml +129 -0
  64. data/fixtures/terminology/conceptmap-example.xml +141 -0
  65. data/fixtures/terminology/v2-codesystem.json +1297 -0
  66. data/fixtures/terminology/v2-valueset.json +16 -0
  67. data/fixtures/terminology/valueset-defined-types.json +25 -0
  68. data/fixtures/terminology/valueset-example.xml +111 -0
  69. data/fixtures/validation/observation.profile.xml +1534 -253
  70. data/fixtures/validation/observations/observation-example.xml +66 -0
  71. data/lib/FHIR_structure.json +129 -82
  72. data/lib/daf_resource_generator.rb +7 -7
  73. data/lib/data/resources.rb +50 -30
  74. data/lib/ext/client.rb +2 -2
  75. data/lib/plan_executor.rb +6 -1
  76. data/lib/resource_generator.rb +413 -212
  77. data/lib/tasks/tasks.rake +151 -20
  78. data/lib/tests/assertions.rb +24 -18
  79. data/lib/tests/base_test.rb +17 -3
  80. data/lib/tests/suites/argonaut_provider_connectathon_test.rb +234 -0
  81. data/lib/tests/suites/base_suite.rb +7 -3
  82. data/lib/tests/suites/connectathon_attachment_track_test.rb +124 -0
  83. data/lib/tests/suites/connectathon_audit_track.rb +113 -69
  84. data/lib/tests/suites/connectathon_care_plan_track.rb +237 -0
  85. data/lib/tests/suites/connectathon_fetch_patient_record.rb +40 -39
  86. data/lib/tests/suites/connectathon_financial_track.rb +231 -23
  87. data/lib/tests/suites/connectathon_genomics_track_test.rb +255 -0
  88. data/lib/tests/suites/connectathon_lab_order_track.rb +131 -104
  89. data/lib/tests/suites/connectathon_patch_track.rb +125 -0
  90. data/lib/tests/suites/connectathon_patient_track.rb +75 -68
  91. data/lib/tests/suites/connectathon_profile_validation.rb +9 -8
  92. data/lib/tests/suites/connectathon_scheduling_track.rb +127 -70
  93. data/lib/tests/suites/connectathon_terminology_track.rb +211 -34
  94. data/lib/tests/suites/daf_profiles_test.rb +112 -72
  95. data/lib/tests/suites/format_test.rb +113 -255
  96. data/lib/tests/suites/history_test.rb +72 -68
  97. data/lib/tests/suites/read_test.rb +31 -27
  98. data/lib/tests/suites/resource_test.rb +283 -85
  99. data/lib/tests/suites/search_test.rb +5 -3
  100. data/lib/tests/suites/search_test_robust.rb +8 -76
  101. data/lib/tests/suites/sprinkler_search_test.rb +104 -84
  102. data/lib/tests/suites/suite_engine.rb +17 -23
  103. data/lib/tests/suites/transaction_test.rb +117 -174
  104. data/lib/tests/testscripts/base_testscript.rb +425 -189
  105. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-base-client-id-json.xml +517 -0
  106. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-base-client-id-xml.xml +517 -0
  107. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-bonus-client-id-json.xml +648 -0
  108. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Client Assigned Id/connectathon-14-patient-bonus-client-id-xml.xml +648 -0
  109. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/README.html +68 -0
  110. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-base-server-id-json.xml +515 -0
  111. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-base-server-id-xml.xml +515 -0
  112. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-bonus-server-id-json.xml +645 -0
  113. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/Server Assigned Id/connectathon-14-patient-bonus-server-id-xml.xml +642 -0
  114. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/capabilities/PatientCapabilityStatement.xml +43 -0
  115. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers-min.json +1 -3
  116. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers-min.xml +0 -0
  117. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers.json +5 -10
  118. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-PeterChalmers.xml +5 -5
  119. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers-min.json +1 -3
  120. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers-min.xml +0 -0
  121. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers.json +5 -10
  122. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-create-bonus-PeterChalmers.xml +4 -5
  123. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-PeterChalmers.json +96 -0
  124. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-PeterChalmers.xml +103 -0
  125. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-bonus-PeterChalmers.json +104 -0
  126. data/lib/tests/testscripts/scripts/connectathon/Patient-01-Intro/_reference/resources/patient-create-client-id-bonus-PeterChalmers.xml +108 -0
  127. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers-min.json +1 -3
  128. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers-min.xml +0 -0
  129. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers.json +6 -10
  130. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-PeterChalmers.xml +6 -5
  131. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers-min.json +1 -3
  132. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers-min.xml +0 -0
  133. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers.json +7 -11
  134. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus1-PeterChalmers.xml +5 -5
  135. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers-min.json +2 -4
  136. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers-min.xml +1 -1
  137. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers.json +7 -11
  138. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient → scripts/connectathon/Patient-01-Intro}/_reference/resources/patient-update-bonus2-PeterChalmers.xml +8 -7
  139. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/01-RegisterPatient/connectathon-14-patient-fhirclient-01-register-client-id-xml.xml +306 -0
  140. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/01-RegisterPatient/connectathon-14-patient-fhirclient-01-register-server-id-xml.xml +317 -0
  141. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/02-PatientUpdate/connectathon-14-patient-fhirclient-02-update-client-id-xml.xml +346 -0
  142. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/02-PatientUpdate/connectathon-14-patient-fhirclient-02-update-server-id-xml.xml +385 -0
  143. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/capabilities/PatientCapabilityStatement.json +50 -0
  144. data/lib/tests/testscripts/{xml/Connectathon11/Track1-Patient/_reference/conformance/PatientConformance.xml → scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/capabilities/PatientCapabilityStatement.xml} +10 -2
  145. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-client-id.json +21 -0
  146. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-client-id.xml +15 -0
  147. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-server-id.json +20 -0
  148. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-create-server-id.xml +14 -0
  149. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-client-id.json +21 -0
  150. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-client-id.xml +15 -0
  151. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-server-id.json +20 -0
  152. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRClient/_reference/resources/patient-update-server-id.xml +14 -0
  153. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-client-id-json.xml +262 -0
  154. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-client-id-xml.xml +262 -0
  155. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-server-id-json.xml +273 -0
  156. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/01-RegisterPatient/connectathon-14-patient-fhirserver-01-register-server-id-xml.xml +273 -0
  157. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-client-id-json.xml +290 -0
  158. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-client-id-xml.xml +290 -0
  159. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-server-id-json.xml +326 -0
  160. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/02-PatientUpdate/connectathon-14-patient-fhirserver-02-update-server-id-xml.xml +326 -0
  161. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-client-id-json.xml +247 -0
  162. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-client-id-xml.xml +247 -0
  163. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-server-id-json.xml +282 -0
  164. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/03-PatientRead/connectathon-14-patient-fhirserver-03-read-server-id-xml.xml +281 -0
  165. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-client-id-json.xml +330 -0
  166. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-client-id-xml.xml +330 -0
  167. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-server-id-json.xml +366 -0
  168. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/04-PatientHistory/connectathon-14-patient-fhirserver-04-history-server-id-xml.xml +366 -0
  169. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-client-id-json.xml +527 -0
  170. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-client-id-xml.xml +527 -0
  171. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-server-id-json.xml +519 -0
  172. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/05-PatientVRead/connectathon-14-patient-fhirserver-05-vread-server-id-xml.xml +519 -0
  173. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-client-id-json.xml +290 -0
  174. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-client-id-xml.xml +290 -0
  175. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-server-id-json.xml +288 -0
  176. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/06-PatientSearching/connectathon-14-patient-fhirserver-06-search-server-id-xml.xml +288 -0
  177. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-client-id-json.xml +252 -0
  178. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-client-id-xml.xml +252 -0
  179. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-server-id-json.xml +284 -0
  180. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/07-PatientDeletion/connectathon-14-patient-fhirserver-07-delete-server-id-xml.xml +284 -0
  181. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-client-id-json.xml +897 -0
  182. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-client-id-xml.xml +897 -0
  183. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-server-id-json.xml +963 -0
  184. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/99-PatientAll/connectathon-14-patient-fhirserver-99-all-server-id-xml.xml +963 -0
  185. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/capabilities/PatientCapabilityStatement.json +50 -0
  186. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/capabilities/PatientCapabilityStatement.xml +42 -0
  187. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-client-id.json +86 -0
  188. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-client-id.xml +62 -0
  189. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-server-id.json +85 -0
  190. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-create-server-id.xml +61 -0
  191. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-client-id.json +86 -0
  192. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-client-id.xml +62 -0
  193. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-server-id.json +86 -0
  194. data/lib/tests/testscripts/scripts/connectathon/Patient-02-Formal/FHIRServer/_reference/resources/patient-update-server-id.xml +62 -0
  195. data/lib/tests/testscripts/scripts/spec/_reference/resources/patient-example-update.json +145 -0
  196. data/lib/tests/testscripts/scripts/spec/_reference/resources/patient-example.json +146 -0
  197. data/lib/tests/testscripts/scripts/spec/testscript-example-history.xml +191 -0
  198. data/lib/tests/testscripts/scripts/spec/testscript-example-multisystem.xml +190 -0
  199. data/lib/tests/testscripts/scripts/spec/testscript-example-readtest.xml +178 -0
  200. data/lib/tests/testscripts/scripts/spec/testscript-example-rule.xml +266 -0
  201. data/lib/tests/testscripts/scripts/spec/testscript-example-search.xml +177 -0
  202. data/lib/tests/testscripts/scripts/spec/testscript-example-update.xml +163 -0
  203. data/lib/tests/testscripts/scripts/spec/testscript-example.xml +228 -0
  204. data/lib/tests/testscripts/testscript_engine.rb +36 -22
  205. data/logs/.keep +0 -0
  206. data/plan_executor.gemspec +11 -3
  207. data/test/test_helper.rb +3 -3
  208. data/test/unit/fixtures_test.rb +24 -24
  209. data/test/unit/metadata_test.rb +19 -9
  210. data/test/unit/resource_generator_test.rb +20 -0
  211. metadata +244 -249
  212. data/fixtures/diagnostic_order/do-200.xml +0 -121
  213. data/fixtures/diagnostic_order/do-400.xml +0 -88
  214. data/fixtures/financial/claim-example-average.xml +0 -168
  215. data/fixtures/financial/claim-example-simple.xml +0 -67
  216. data/fixtures/order/order-100.xml +0 -61
  217. data/fixtures/order/order-200.xml +0 -61
  218. data/fixtures/order/order-300.xml +0 -61
  219. data/fixtures/order/order-400.xml +0 -61
  220. data/fixtures/order_response/ordresp-100.xml +0 -79
  221. data/fixtures/order_response/ordresp-110.xml +0 -79
  222. data/fixtures/order_response/ordresp-200.xml +0 -79
  223. data/fixtures/order_response/ordresp-210.xml +0 -79
  224. data/fixtures/order_response/ordresp-300.xml +0 -79
  225. data/fixtures/order_response/ordresp-310.xml +0 -79
  226. data/fixtures/order_response/ordresp-400.xml +0 -79
  227. data/fixtures/order_response/ordresp-410.xml +0 -79
  228. data/fixtures/patient/patient-example-us-extensions(us01).xml +0 -81
  229. data/fixtures/patient/patient-format-example.xml +0 -101
  230. data/fixtures/validation/observations/observation-example(example).xml +0 -50
  231. data/lib/tests/suites/argonaut_resprint_1_test.rb +0 -260
  232. data/lib/tests/suites/argonaut_resprint_2_test.rb +0 -369
  233. data/lib/tests/suites/argonaut_resprint_3_test.rb +0 -309
  234. data/lib/tests/suites/argonaut_sprint_1_test.rb +0 -187
  235. data/lib/tests/suites/argonaut_sprint_2_test.rb +0 -115
  236. data/lib/tests/suites/argonaut_sprint_3_test.rb +0 -208
  237. data/lib/tests/suites/argonaut_sprint_4_test.rb +0 -335
  238. data/lib/tests/suites/argonaut_sprint_5_test.rb +0 -196
  239. data/lib/tests/suites/argonaut_sprint_6_test.rb +0 -243
  240. data/lib/tests/suites/argonaut_sprint_7_test.rb +0 -161
  241. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-base-client-id-json.xml +0 -348
  242. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-base-client-id-xml.xml +0 -348
  243. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-bonus-client-id-json.xml +0 -420
  244. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Client Assigned Id/track1-patient-bonus-client-id-xml.xml +0 -420
  245. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/README.html +0 -68
  246. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-base-server-id-json.xml +0 -352
  247. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-base-server-id-xml.xml +0 -352
  248. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-bonus-server-id-json.xml +0 -421
  249. data/lib/tests/testscripts/xml/Connectathon11/Track1-Patient/Server Assigned Id/track1-patient-bonus-server-id-xml.xml +0 -421
  250. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/C-CDA_R2-1_CCD-ussg.xml +0 -3414
  251. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A1-empty-on-instance.xml +0 -9
  252. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A2-empty-by-ref.xml +0 -15
  253. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A3-empty-by-identifier.xml +0 -13
  254. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-A4-empty-by-contained.xml +0 -15
  255. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B1-CCDA-on-instance.xml +0 -15
  256. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B2-CCDA-by-ref.xml +0 -21
  257. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B3-CCDA-by-identifier.xml +0 -19
  258. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/parameters-B4-CCDA-by-contained.xml +0 -21
  259. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaire-sdc-profile-example-ussg-fht.xml +0 -3905
  260. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaireresponse-expected-ussg-fht-CCDA.xml +0 -190
  261. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/_reference/resources/questionnaireresponse-expected-ussg-fht-empty.xml +0 -177
  262. data/lib/tests/testscripts/xml/Connectathon11/Track11-SDC/track11-sdc-prepop-xml.xml +0 -142
  263. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Client Assigned Id/track2-ts-suite1-expand-client-id.xml +0 -925
  264. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Client Assigned Id/track2-ts-suite2-expand-filter-client-id.xml +0 -930
  265. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Server Assigned Id/track2-ts-suite1-expand-server-id.xml +0 -953
  266. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Expand/Server Assigned Id/track2-ts-suite2-expand-filter-server-id.xml +0 -958
  267. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Lookup/track2-ts-suite5-loinc-lookup-xml.xml +0 -224
  268. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Lookup/track2-ts-suite5-snomed-lookup-xml.xml +0 -224
  269. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/README.html +0 -85
  270. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Translate/track2-ts-suite6-translate-xml.xml +0 -224
  271. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Client Assigned Id/track2-ts-suite3-validate-code-client-id.xml +0 -1807
  272. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Client Assigned Id/track2-ts-suite4-validate-code-client-id.xml +0 -714
  273. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Server Assigned Id/track2-ts-suite3-validate-code-server-id.xml +0 -1835
  274. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/Validate-code/Server Assigned Id/track2-ts-suite4-validate-code-server-id.xml +0 -742
  275. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ConceptMapSuite6Conformance.xml +0 -11
  276. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite1Conformance.xml +0 -17
  277. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite2Conformance.xml +0 -17
  278. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite3Conformance.xml +0 -14
  279. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite4Conformance.xml +0 -14
  280. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/conformance/ValueSetSuite5Conformance.xml +0 -11
  281. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-2-a.xml +0 -11
  282. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-2-b.xml +0 -11
  283. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-3-a.xml +0 -13
  284. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-3-b.xml +0 -13
  285. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-4-a.xml +0 -15
  286. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/extensional-case-1-input-4-4-b.xml +0 -15
  287. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-loinc-input-5-2.xml +0 -10
  288. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-loinc-input-5-3.xml +0 -11
  289. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-snomed-input-5-2.xml +0 -10
  290. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/lookup-snomed-input-5-3.xml +0 -11
  291. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/translate-conceptmap-input-6-2.xml +0 -14
  292. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/input/translate-conceptmap-input-6-3.xml +0 -15
  293. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-1-expand-min.xml +0 -47
  294. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-1-filter-min.xml +0 -23
  295. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-2-expand-min.xml +0 -132
  296. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-2-filter-min.xml +0 -38
  297. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-3-expand-min.xml +0 -252
  298. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-3-filter-min.xml +0 -58
  299. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-4-expand-min.xml +0 -57
  300. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/extensional-case-4-filter-min.xml +0 -28
  301. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-1-expand-min.xml +0 -347
  302. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-1-filter-min.xml +0 -33
  303. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-2-expand-min.xml +0 -637
  304. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-2-filter-min.xml +0 -33
  305. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/intensional-case-3-filter-min.xml +0 -58
  306. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/lookup-loinc-min.xml +0 -11
  307. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/lookup-snomed-min.xml +0 -11
  308. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite3-invalid-min.xml +0 -10
  309. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite3-valid-min.xml +0 -7
  310. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite4-invalid-min.xml +0 -10
  311. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/suite4-valid-min.xml +0 -7
  312. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/output/translate-conceptmap-min.xml +0 -17
  313. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-1.xml +0 -55
  314. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-2.xml +0 -122
  315. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-3.xml +0 -222
  316. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/extensional-case-4.xml +0 -65
  317. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-1.xml +0 -31
  318. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-2.xml +0 -31
  319. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/intensional-case-3.xml +0 -31
  320. data/lib/tests/testscripts/xml/Connectathon11/Track2-Terminology/_reference/resources/translate-conceptmap-case-1.xml +0 -145
  321. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/conformance/DecisionSupportServiceModule-Evaluate.xml +0 -17
  322. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-request-payload.xml +0 -26
  323. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-response-min-payload.xml +0 -7
  324. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-incomplete-response-payload.xml +0 -332
  325. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-request-payload.xml +0 -28
  326. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-response-min-payload.xml +0 -7
  327. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-malformed-response-payload.xml +0 -20
  328. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-request-payload.xml +0 -28
  329. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-response-min-payload.xml +0 -7
  330. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-response-payload.xml +0 -332
  331. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-request-payload.xml +0 -28
  332. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-response-min-payload.xml +0 -7
  333. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/ecrs-fhir-cdc-immunizations-unauthorized-response-payload.xml +0 -8
  334. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-request-payload.xml +0 -176
  335. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-response-payload-min.xml +0 -32
  336. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/_reference/resources/gao-assessment-response-payload.xml +0 -80
  337. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/track3-cds-evaluate-cdc-immunization.xml +0 -290
  338. data/lib/tests/testscripts/xml/Connectathon11/Track3-CDS-on-FHIR/track3-cds-evaluate-gao-profile.xml +0 -110
  339. data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/Client_Assigned_Id/TestScript_FHIR-Genomics.xml +0 -170
  340. data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/_reference/resources/sequence-example-1.xml +0 -31
  341. data/lib/tests/testscripts/xml/Connectathon11/Track6-FHIR-Genomics/_reference/resources/sequence-example-2.xml +0 -31
  342. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Actors.png +0 -0
  343. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder100-xml.xml +0 -590
  344. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder200-xml.xml +0 -587
  345. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder300-xml.xml +0 -612
  346. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Client_Assigned_Id/track7-laborder400-xml.xml +0 -635
  347. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Peer-to-Peer/track7-laborder100-peer2peer-xml.xml +0 -752
  348. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/Thumbs.db +0 -0
  349. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/conformance/LabOrderLabReport-CreateDeleteReadUpdate.xml +0 -187
  350. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/conformance/html.xslt +0 -45
  351. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-100-update.xml +0 -64
  352. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-100.xml +0 -64
  353. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-200-update.xml +0 -121
  354. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-200.xml +0 -121
  355. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-300-update.xml +0 -91
  356. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-300.xml +0 -91
  357. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticOrder/do-400-update.xml +0 -88
  358. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-100.xml +0 -96
  359. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-200.xml +0 -125
  360. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-300.xml +0 -132
  361. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/DiagnosticReport/dr-400.xml +0 -121
  362. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-100.xml +0 -58
  363. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-101.xml +0 -58
  364. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-200.xml +0 -125
  365. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-300.xml +0 -106
  366. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-301.xml +0 -106
  367. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-302.xml +0 -106
  368. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-303.xml +0 -106
  369. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-304.xml +0 -106
  370. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-400.xml +0 -87
  371. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-401.xml +0 -95
  372. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-402.xml +0 -95
  373. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-403.xml +0 -84
  374. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-404.xml +0 -84
  375. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-405.xml +0 -83
  376. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-406.xml +0 -83
  377. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-407.xml +0 -70
  378. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-408.xml +0 -84
  379. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Observation/obs-uslab-example5.xml +0 -102
  380. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-100.xml +0 -61
  381. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-200.xml +0 -61
  382. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-300.xml +0 -61
  383. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Order/order-400.xml +0 -61
  384. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-100.xml +0 -79
  385. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-110.xml +0 -79
  386. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-200.xml +0 -79
  387. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-210.xml +0 -79
  388. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-300.xml +0 -79
  389. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-310.xml +0 -79
  390. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-400.xml +0 -79
  391. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/OrderResponse/ordresp-410.xml +0 -79
  392. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Organization/org-uslab-example3.xml +0 -49
  393. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Patient/patient-uslab-example1.xml +0 -44
  394. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Practitioner/pract-uslab-example1.xml +0 -18
  395. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Practitioner/pract-uslab-example3.xml +0 -36
  396. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/Thumbs.db +0 -0
  397. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-100.xml +0 -65
  398. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-400.xml +0 -70
  399. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Specimen/spec-uslab-example1.xml +0 -82
  400. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 1 Document.txt +0 -122
  401. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 2 Document.txt +0 -103
  402. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 3 Document.txt +0 -201
  403. data/lib/tests/testscripts/xml/Connectathon11/Track7-LabOrderLabReport/_reference/resources/Testscript 4 Document.txt +0 -310
  404. data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/conformance/MedicationStatementCreate.xml +0 -11
  405. data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/conformance/PatientSearchType.xml +0 -15
  406. data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/resources/medicationstatement-create.json +0 -39
  407. data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/_reference/resources/medicationstatement-patch.json +0 -3
  408. data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-medicationstatement-json-if-match.xml +0 -321
  409. data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-medicationstatement-json.xml +0 -303
  410. data/lib/tests/testscripts/xml/Connectathon11/Track9-Patch/track9-patch-peer2peer-patient-json.xml +0 -235
  411. data/test/fixtures/testscript-example.xml +0 -202
  412. data/test/fixtures/testscript-history.xml +0 -143
  413. data/test/fixtures/testscript-readtest.xml +0 -272
  414. data/test/fixtures/testscript-search.xml +0 -282
  415. data/test/fixtures/testscript-update.xml +0 -147
  416. data/test/unit/argonaut_sprint6_test.rb +0 -31
  417. data/test/unit/argonaut_sprint7_test.rb +0 -21
  418. data/test/unit/basic_test.rb +0 -27
  419. data/test/unit/fetch_patient_record_test.rb +0 -357
  420. data/test/unit/financial_test.rb +0 -41
@@ -0,0 +1,234 @@
1
+ module Crucible
2
+ module Tests
3
+ class ArgonautProviderConnectathonTest < BaseSuite
4
+ def id
5
+ 'ArgonautProviderConnectathonTest'
6
+ end
7
+
8
+ def description
9
+ 'Test suite for the Argonaut Provider Directory Virtual Connectathon'
10
+ end
11
+
12
+ def details
13
+ {
14
+ 'Overview' => 'Test suite for the Argonaut Provider Directory Virtual Connectathon'
15
+ }
16
+ end
17
+
18
+ def initialize(client1, client2 = nil)
19
+ super(client1, client2)
20
+ @tags.append('provider')
21
+ @tags.append('connectathon')
22
+ @category = {id: 'argonaut', title: 'Argonaut'}
23
+ end
24
+
25
+ test 'APCT01', 'GET a set of Practitioners to test' do
26
+ metadata {
27
+ links "#{REST_SPEC_LINK}#read"
28
+ links "#{REST_SPEC_LINK}#search"
29
+ requires resource: 'Practitioner', methods: ['read', 'search']
30
+ validates resource: 'Practitioner', methods: ['read', 'search']
31
+ }
32
+
33
+ # Basically just get a group of 10 Practitioners
34
+ options = {
35
+ :search => {
36
+ # :flag => true,
37
+ :compartment => nil,
38
+ :parameters => {
39
+ _count: 100
40
+ }
41
+ }
42
+ }
43
+
44
+ result = @client.search(FHIR::Practitioner, options)
45
+
46
+ assert_response_ok(result)
47
+
48
+ @practitioners = result.resource.try(:entry)
49
+
50
+ assert @practitioners, 'No Practitioners found'
51
+
52
+ end
53
+
54
+ test 'APCT02', 'Test ability to locate a Practitioner\'s Telecom/Physical Address' do
55
+ metadata {
56
+ links "#{REST_SPEC_LINK}#read"
57
+ requires resource: 'Practitioner', methods: ['read']
58
+ validates resource: 'Practitioner', methods: ['read']
59
+ }
60
+
61
+ skip if !@practitioners
62
+
63
+ practitioner_id = @practitioners.select{ |p| !p.resource.role.empty? }.sample.try(:resource).try(:id)
64
+ assert practitioner_id, 'No practitioner found with a role'
65
+
66
+ @practitioner = @client.read(FHIR::Practitioner, practitioner_id).try(:resource)
67
+
68
+ assert @practitioner, "No Practitioner found for ID #{practitioner_id}"
69
+
70
+ assert @practitioner.role.select { |pr|
71
+ !pr.location.empty?
72
+ }.size >= 1, "None of the Roles associated with Practitioner #{@practitioner.identifier.first.value}'s contain Location information"
73
+
74
+ # Test for address presence
75
+ assert @practitioner.role.select { |pr|
76
+ pr.location.select { |locref|
77
+ # Try and find the Location in contained/Server resources
78
+ loc = resolve_reference(@practitioner, FHIR::Location, locref.reference)
79
+ loc && !loc.address.nil?
80
+ }.size >= 1
81
+ }.size >= 1, "None of the Locations associated with Practitioner #{@practitioner.identifier.first.value}'s Roles contain Address information"
82
+
83
+ # Test for telecom presence
84
+ assert @practitioner.role.select { |pr|
85
+ pr.location.select { |locref|
86
+ # Try and find the Location in contained/Server resources
87
+ loc = resolve_reference(@practitioner, FHIR::Location, locref.reference)
88
+ # See if any of the location resources have telecom elements on them
89
+ loc && !loc.telecom.nil? && !loc.telecom.empty?
90
+ }.size >= 1
91
+ }.size >= 1 || @practitioner.role.select { |pr| !pr.telecom.empty? }.size >= 1, "None of the roles associated with Practitioner #{@practitioner.identifier.first.value} contain Telecom information"
92
+
93
+ end
94
+
95
+ test 'APCT03', 'Test ability to locate a Provider\'s Direct Address' do
96
+ metadata {
97
+ links "#{REST_SPEC_LINK}#read"
98
+ requires resource: 'Practitioner', methods: ['read', 'search']
99
+ requires resource: 'PractitionerRole', methods: ['read']
100
+ requires resource: 'Location', methods: ['read']
101
+ validates resource: 'Practitioner', methods: ['read', 'search']
102
+ validates resource: 'PractitionerRole', methods: ['read']
103
+ validates resource: 'Location', methods: ['read']
104
+ }
105
+ skip if !@practitioners || !@practitioner
106
+
107
+ assert @practitioner.role.select { |pr| !pr.endpoint.empty? }.size >= 1, "No Endpoints found for Practitioner #{@practitioner.identifier.first.value}"
108
+ assert @practitioner.role.select { |pr|
109
+ pr.endpoint.select { |endref|
110
+ endpoint = resolve_reference(@practitioner, FHIR::Endpoint, endref.reference)
111
+ endpoint && !endpoint.address.nil? && !endpoint.address.empty?
112
+ }.size >= 1
113
+ }.size >= 1, "No Endpoints found with direct address found for Practitioner #{@practitioner.identifier.first.value}"
114
+ end
115
+
116
+ test 'APCT04', 'Test ability to locate an Organization\'s Endpoint' do
117
+ metadata {
118
+ links "#{REST_SPEC_LINK}#read"
119
+ requires resource: 'Organization', methods: ['read', 'search']
120
+ requires resource: 'Endpoint', methods: ['read']
121
+ validates resource: 'Organization', methods: ['read', 'search']
122
+ validates resource: 'Endpoint', methods: ['read']
123
+ }
124
+
125
+ options = {
126
+ :search => {
127
+ # :flag => true,
128
+ :compartment => nil,
129
+ :parameters => {
130
+ _count: 100
131
+ }
132
+ }
133
+ }
134
+
135
+ result = @client.search(FHIR::Organization, options)
136
+
137
+ assert_response_ok(result)
138
+
139
+ orgs = result.resource.try(:entry)
140
+
141
+ assert orgs, 'No Organizations found'
142
+
143
+ assert orgs.select{ |org| !org.resource.endpoint.empty? }.size >= 1, "No Organization found with an Endpoint"
144
+ end
145
+
146
+ test 'APCT05', 'Test ability to locate a Location\'s Telecom/physical address' do
147
+ metadata {
148
+ requires resource: 'Location', methods: ['read']
149
+ validates resource: 'Location', methods: ['read']
150
+ requires resource: 'Address', methods: ['read']
151
+ validates resource: 'Address', methods: ['read']
152
+ requires resource: 'ContactPoint', methods: ['read']
153
+ validates resource: 'ContactPoint', methods: ['read']
154
+ }
155
+
156
+ options = {
157
+ :search => {
158
+ # :flag => true,
159
+ :compartment => nil,
160
+ :parameters => {
161
+ _count: 100
162
+ }
163
+ }
164
+ }
165
+
166
+ result = @client.search(FHIR::Location, options)
167
+
168
+ assert_response_ok(result)
169
+
170
+ locs = result.resource.try(:entry)
171
+
172
+ assert locs, "No Locations found"
173
+
174
+ assert locs.select { |loc| !loc.resource.address.nil? }.size >= 1, "No Locations found with non-empty Address"
175
+
176
+ assert locs.select { |loc| !loc.resource.telecom.nil? && !loc.resource.telecom.empty? }.size >= 1, "No Locations found with non-empty Telecom"
177
+
178
+ end
179
+
180
+ test 'APCT06', 'Test ability to locate a Location\'s Endpoint' do
181
+ metadata {
182
+ requires resource: 'Location', methods: ['read']
183
+ validates resource: 'Location', methods: ['read']
184
+ requires resource: 'Endpoint', methods: ['read']
185
+ validates resource: 'Endpoint', methods: ['read']
186
+ }
187
+
188
+ options = {
189
+ :search => {
190
+ # :flag => true,
191
+ :compartment => nil,
192
+ :parameters => {
193
+ _count: 100
194
+ }
195
+ }
196
+ }
197
+
198
+ result = @client.search(FHIR::Location, options)
199
+
200
+ assert_response_ok(result)
201
+
202
+ locs = result.resource.try(:entry)
203
+
204
+ assert locs, "No Locations found"
205
+
206
+ assert locs.select { |loc| !loc.resource.endpoint.nil? && !loc.resource.endpoint.empty? }.size >= 1, "No Locations found with non-empty Endpoint"
207
+ end
208
+
209
+ private
210
+
211
+ def resolve_reference(resource, reftype, id)
212
+ return id if id.class == reftype || id.nil?
213
+ loc = resource.contained.find { |con| con.id == id.gsub('#', '') }
214
+ #if that doesn't work, try to read it from the server
215
+ if loc.nil? || loc.try(:empty?)
216
+ if id.split("/").count > 1
217
+ res = @client.read(reftype, id.split("/")[1])
218
+
219
+ assert_response_ok(res)
220
+ loc = res.resource
221
+ else
222
+ res = @client.read(reftype, id)
223
+ assert_response_ok(res)
224
+
225
+ loc = res.resource
226
+ end
227
+ end
228
+ assert !loc.nil?, "Could not find #{reftype.to_s.split("::")[1]} resource #{id}"
229
+
230
+ loc
231
+ end
232
+ end
233
+ end
234
+ end
@@ -2,6 +2,8 @@ module Crucible
2
2
  module Tests
3
3
  class BaseSuite < BaseTest
4
4
 
5
+ EXCLUDED_RESOURCES = ['DomainResource', 'Resource', 'Parameters', 'OperationOutcome']
6
+
5
7
  def title
6
8
  self.class.name.demodulize
7
9
  end
@@ -10,7 +12,7 @@ module Crucible
10
12
  # body should be a String
11
13
  outcome = nil
12
14
  begin
13
- outcome = FHIR::Resource.from_contents(body)
15
+ outcome = FHIR.from_contents(body)
14
16
  outcome = nil if outcome.class!=FHIR::OperationOutcome
15
17
  rescue
16
18
  outcome = nil
@@ -26,8 +28,8 @@ module Crucible
26
28
  messages
27
29
  end
28
30
 
29
- def fhir_resources
30
- Mongoid.models.select {|c| c.name.include?('FHIR') && !c.included_modules.find_index(FHIR::Resource).nil?}
31
+ def self.fhir_resources
32
+ FHIR::RESOURCES.select {|r| !EXCLUDED_RESOURCES.include?(r)}.map {|r| "FHIR::#{r}".constantize}
31
33
  end
32
34
 
33
35
  def requires(hash)
@@ -79,6 +81,8 @@ module Crucible
79
81
  result.update(STATUS[:fail], e.message, e.data)
80
82
  rescue SkipException => e
81
83
  result.update(STATUS[:skip], "Skipped: #{test_method}", '')
84
+ rescue ClientException => e
85
+ result.update(STATUS[:fail], e.message, '')
82
86
  rescue => e
83
87
  result.update(STATUS[:error], "Fatal Error: #{e.message}", e.backtrace.join("\n"))
84
88
  end
@@ -0,0 +1,124 @@
1
+ module Crucible
2
+ module Tests
3
+ class ConnectathonAttachmentTrackTest < BaseSuite
4
+ require "base64"
5
+
6
+ attr_accessor :attachments
7
+
8
+ def id
9
+ 'ConnectathonAttachmentTrackTest'
10
+ end
11
+
12
+ def description
13
+ 'Test support for using FHIR-based messaging for exchanging attachments, particularly for claims processing/payer provider interactions.'
14
+ end
15
+
16
+ def initialize(client1, client2=nil)
17
+ super(client1, client2)
18
+ @tags.append('connectathon')
19
+ @category = {id: 'connectathon', title: 'Connectathon'}
20
+ end
21
+
22
+ def setup
23
+ @attachments = {}
24
+ @mime_types = {}
25
+ @records = {}
26
+ @attachments["pdf"] = 'ccda_pdf.pdf'
27
+ @attachments["structured"] = 'ccda_structured.xml'
28
+ @attachments["unstructured"] = 'ccda_unstructured.xml'
29
+
30
+ @mime_types["pdf"] = "application/pdf"
31
+ @mime_types["structured"] = "application/xml"
32
+ @mime_types["unstructured"] = "application/xml"
33
+
34
+ @resources = Crucible::Generator::Resources.new
35
+
36
+ patient = @resources.load_fixture("patient/patient-register-create.xml")
37
+ practitioner = @resources.load_fixture("practitioner/practitioner-register-create.xml")
38
+
39
+
40
+ create_object(patient, :patient)
41
+ create_object(practitioner, :practitioner)
42
+ end
43
+
44
+ def teardown
45
+ @records.each_value do |value|
46
+ @client.destroy(value.class, value.id)
47
+ end
48
+ end
49
+
50
+ %w(pdf structured unstructured).each do |att_type|
51
+ test "A13_#{att_type}1", "Submit unsolicited attachment of #{att_type}" do
52
+ comm = FHIR::Communication.new()
53
+ comm.subject = [@records[:patient].to_reference]
54
+ comm.recipient = [@records[:practitioner].to_reference]
55
+
56
+ comm_att = FHIR::Attachment.new()
57
+ comm_att.contentType = @mime_types[att_type]
58
+ comm_att.data = base64_encoded(att_type)
59
+ comm_att.title = @attachments[att_type]
60
+
61
+ payload = FHIR::Communication::Payload.new
62
+ payload.contentAttachment = [comm_att]
63
+
64
+ comm.payload = payload
65
+ create_object(comm, "comm_#{att_type}")
66
+ end
67
+
68
+ test "A13_#{att_type}2", "Submit solicited attachment of #{att_type}" do
69
+ # find a suitable CommunicationRequest to respond to
70
+ options = {
71
+ :search => {
72
+ :flag => true,
73
+ :compartment => nil,
74
+ :parameters => {
75
+ _count: 10
76
+ }
77
+ }
78
+ }
79
+ reply = @client.search(FHIR::CommunicationRequest, options)
80
+ assert_response_ok(reply)
81
+ assert_bundle_response(reply)
82
+ comm_req = reply.resource.entry.sample.try(:resource)
83
+
84
+ assert comm_req, 'No CommunicationRequest returned from server'
85
+
86
+ comm = FHIR::Communication.new()
87
+ comm.subject = [comm_req.subject]
88
+ comm.recipient = [comm_req.sender]
89
+ comm.basedOn = [comm_req.to_reference]
90
+
91
+ comm_att = FHIR::Attachment.new()
92
+ comm_att.contentType = @mime_types[att_type]
93
+ comm_att.data = base64_encoded(att_type)
94
+ comm_att.title = @attachments[att_type]
95
+
96
+ payload = FHIR::Communication::Payload.new
97
+ payload.contentAttachment = [comm_att]
98
+
99
+ comm.payload = payload
100
+ create_object(comm, "comm_#{att_type}")
101
+ end
102
+ end
103
+
104
+ private
105
+
106
+ def base64_encoded(type)
107
+ Base64.encode64(File.read(File.join(Crucible::Generator::Resources::FIXTURE_DIR, "attachment", "#{@attachments[type]}")))
108
+ end
109
+
110
+ def create_object(obj, obj_sym)
111
+ reply = @client.create obj
112
+ assert_response_ok(reply)
113
+ obj.id = reply.id
114
+ @records[obj_sym] = obj
115
+
116
+ warning { assert_valid_resource_content_type_present(reply) }
117
+ warning { assert_valid_content_location_present(reply) }
118
+
119
+ warning { assert @records[obj_sym].equals? reply.resource }
120
+ end
121
+
122
+ end
123
+ end
124
+ end
@@ -20,13 +20,13 @@ module Crucible
20
20
  end
21
21
 
22
22
  def teardown
23
- @client.destroy(FHIR::Provenance, @provenance1.xmlId) if @provenance1 && !@provenance1.xmlId.nil?
24
- @client.destroy(FHIR::Provenance, @provenance2.xmlId) if @provenance2 && !@provenance2.xmlId.nil?
25
- @client.destroy(FHIR::Provenance, @provenance3.xmlId) if @provenance3 && !@provenance3.xmlId.nil?
26
- @client.destroy(FHIR::Provenance, @provenance4.xmlId) if @provenance4 && !@provenance4.xmlId.nil?
27
- @client.destroy(FHIR::Patient, @patient.xmlId) if @patient && !@patient.xmlId.nil?
28
- @client.destroy(FHIR::Patient, @patient1.xmlId) if @patient1 && !@patient1.xmlId.nil?
29
- @client.destroy(FHIR::Patient, @patient2.xmlId) if @patient2 && !@patient2.xmlId.nil?
23
+ @client.destroy(FHIR::Provenance, @provenance1.id) if @provenance1 && !@provenance1.id.nil?
24
+ @client.destroy(FHIR::Provenance, @provenance2.id) if @provenance2 && !@provenance2.id.nil?
25
+ @client.destroy(FHIR::Provenance, @provenance3.id) if @provenance3 && !@provenance3.id.nil?
26
+ @client.destroy(FHIR::Provenance, @provenance4.id) if @provenance4 && !@provenance4.id.nil?
27
+ @client.destroy(FHIR::Patient, @patient.id) if @patient && !@patient.id.nil?
28
+ @client.destroy(FHIR::Patient, @patient1.id) if @patient1 && !@patient1.id.nil?
29
+ @client.destroy(FHIR::Patient, @patient2.id) if @patient2 && !@patient2.id.nil?
30
30
  FHIR::ResourceAddress::DEFAULTS.delete('X-Provenance') # just in case
31
31
  end
32
32
 
@@ -42,29 +42,31 @@ module Crucible
42
42
  requires resource: 'AuditEvent', methods: ['search']
43
43
  validates resource: 'Patient', methods: ['create']
44
44
  validates resource: 'AuditEvent', methods: ['search']
45
- validates resource: nil, methods: ['Audit Logging', 'audit event']
45
+ validates resource: nil, methods: ['Audit Logging']
46
46
  }
47
47
  @patient = @resources.minimal_patient
48
- @patient.xmlId = nil # clear the identifier
48
+ @patient.id = nil # clear the identifier
49
49
  reply = @client.create(@patient)
50
50
  assert_response_ok(reply)
51
- @patient.xmlId = reply.id
51
+ @patient.id = reply.id
52
52
 
53
53
  options = {
54
54
  :search => {
55
55
  :flag => false,
56
56
  :compartment => nil,
57
57
  :parameters => {
58
- 'reference' => "Patient/#{@patient.xmlId}"
58
+ 'entity' => "Patient/#{@patient.id}"
59
59
  }
60
60
  }
61
61
  }
62
+ sleep 5 # give a few seconds for the Audit Event to be generated
62
63
  reply = @client.search(FHIR::AuditEvent, options)
63
64
  assert_response_ok(reply)
64
65
  assert_bundle_response(reply)
65
66
  assert_equal(1, reply.resource.entry.size, 'There should only be one AuditEvent for the test Patient currently in the system.', reply.body)
66
- assert(reply.resource.entry[0].try(:resource).try(:object).try(:reference).include?(@patient.xmlId), 'The correct AuditEvent was not returned.', reply.body)
67
- warning { assert_equal('110110', reply.resource.entry[0].try(:resource).try(:event).try(:type).try(:code), 'Was expecting an AuditEvent.event.type.code of 110110 (Patient Record).', reply.body) }
67
+ assert(reply.resource.entry[0].try(:resource).try(:entity).try(:first).try(:reference).try(:reference).include?(@patient.id), 'The correct AuditEvent was not returned.', reply.body)
68
+ warning { assert_equal('rest', reply.resource.entry[0].try(:resource).try(:type).try(:code), 'Was expecting an AuditEvent.event.type.code of rest', reply.body) }
69
+ warning { assert_equal('http://hl7.org/fhir/audit-event-type', reply.resource.entry[0].try(:resource).try(:type).try(:system), 'Was expecting an AuditEvent.event.type.system of http://hl7.org/fhir/audit-event-type', reply.body) }
68
70
  end
69
71
 
70
72
  # Create a Patient with Provenance as a transaction
@@ -84,14 +86,21 @@ module Crucible
84
86
  }
85
87
 
86
88
  @patient1 = @resources.minimal_patient
87
- @patient1.xmlId = 'foo'
89
+ @patient1.id = 'foo'
88
90
 
89
91
  @provenance1 = FHIR::Provenance.new
90
92
  @provenance1.target = [ FHIR::Reference.new ]
91
- @provenance1.target[0].reference = "Patient/#{@patient1.xmlId}"
92
- @provenance1.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ%z")
93
- @provenance1.reason = [ FHIR::CodeableConcept.new ]
94
- @provenance1.reason[0].text = 'New patient'
93
+ @provenance1.target[0].reference = "Patient/#{@patient1.id}"
94
+ @provenance1.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ")
95
+ @provenance1.reason = [ FHIR::Coding.new ]
96
+ @provenance1.reason[0].system = 'http://hl7.org/fhir/v3/ActReason'
97
+ @provenance1.reason[0].display = 'patient administration'
98
+ @provenance1.reason[0].code = 'PATADMIN'
99
+ @provenance1.agent = [ FHIR::Provenance::Agent.new ]
100
+ @provenance1.agent[0].role = FHIR::Coding.new
101
+ @provenance1.agent[0].role.system = 'http://hl7.org/fhir/provenance-participant-role'
102
+ @provenance1.agent[0].role.display = 'Author'
103
+ @provenance1.agent[0].role.code = 'author'
95
104
 
96
105
  @client.begin_transaction
97
106
  @client.add_transaction_request('POST',nil,@patient1)
@@ -100,21 +109,21 @@ module Crucible
100
109
 
101
110
  # set the patient id as nil, until we know that the transaction was successful, so teardown doesn't try
102
111
  # to delete something that wasn't created
103
- @patient1.xmlId = nil
112
+ @patient1.id = nil
104
113
 
105
- assert_response_ok(reply)
114
+ assert([200,201,202].include?(reply.code), 'Expected response code 200, 201, or 202', reply.body)
106
115
  assert_bundle_response(reply)
107
116
 
108
117
  # set the patient id back from nil to whatever the server created
109
- @patient1.xmlId = FHIR::ResourceAddress.pull_out_id('Patient',reply.resource.entry[0].try(:response).try(:location))
110
- @provenance1.xmlId = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[1].try(:response).try(:location))
118
+ @patient1.id = FHIR::ResourceAddress.pull_out_id('Patient',reply.resource.entry[0].try(:response).try(:location))
119
+ @provenance1.id = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[1].try(:response).try(:location))
111
120
 
112
121
  options = {
113
122
  :search => {
114
123
  :flag => false,
115
124
  :compartment => nil,
116
125
  :parameters => {
117
- 'target' => "Patient/#{@patient1.xmlId}"
126
+ 'target' => "Patient/#{@patient1.id}"
118
127
  }
119
128
  }
120
129
  }
@@ -122,7 +131,7 @@ module Crucible
122
131
  assert_response_ok(reply)
123
132
  assert_bundle_response(reply)
124
133
  assert_equal(1, reply.resource.entry.size, 'There should only be one Provenance for the test Patient currently in the system.', reply.body)
125
- assert(reply.resource.entry[0].try(:resource).try(:target).try(:first).try(:reference).include?(@patient1.xmlId), 'The correct Provenance was not returned.', reply.body)
134
+ assert(reply.resource.entry[0].try(:resource).try(:target).try(:first).try(:reference).include?(@patient1.id), 'The correct Provenance was not returned.', reply.body)
126
135
  end
127
136
 
128
137
  # Create a Patient with a Provenance header:
@@ -138,31 +147,38 @@ module Crucible
138
147
  requires resource: 'Provenance', methods: ['search']
139
148
  validates resource: 'Patient', methods: ['create']
140
149
  validates resource: 'Provenance', methods: ['search']
150
+ validates resource: nil, methods: ['provenance']
141
151
  }
142
152
 
143
153
  @patient2 = @resources.minimal_patient
144
- @patient2.xmlId = nil # clear the identifier
154
+ @patient2.id = nil # clear the identifier
145
155
 
146
156
  @provenance2 = FHIR::Provenance.new
147
157
  @provenance2.target = [ FHIR::Reference.new ]
148
- # @provenance2.target[0].reference = "Patient/#{@patient2.xmlId}"
149
- @provenance2.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ%z")
150
- @provenance2.reason = [ FHIR::CodeableConcept.new ]
151
- @provenance2.reason[0].text = 'New patient'
152
-
153
- FHIR::ResourceAddress::DEFAULTS['X-Provenance'] = @provenance2.to_fhir_json
154
- reply = @client.create(@patient2)
155
- FHIR::ResourceAddress::DEFAULTS.delete('X-Provenance')
158
+ # @provenance2.target[0].reference = "Patient/#{@patient2.id}"
159
+ @provenance2.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ")
160
+ @provenance2.reason = [ FHIR::Coding.new ]
161
+ @provenance2.reason[0].system = 'http://hl7.org/fhir/v3/ActReason'
162
+ @provenance2.reason[0].display = 'patient administration'
163
+ @provenance2.reason[0].code = 'PATADMIN'
164
+ @provenance2.agent = [ FHIR::Provenance::Agent.new ]
165
+ @provenance2.agent[0].role = FHIR::Coding.new
166
+ @provenance2.agent[0].role.system = 'http://hl7.org/fhir/provenance-participant-role'
167
+ @provenance2.agent[0].role.display = 'Author'
168
+ @provenance2.agent[0].role.code = 'author'
169
+
170
+ options = { 'X-Provenance' => @provenance2.to_json }
171
+ reply = @client.base_create(@patient2, options, @client.default_format)
156
172
 
157
173
  assert_response_ok(reply)
158
- @patient2.xmlId = reply.id
174
+ @patient2.id = reply.id
159
175
 
160
176
  options = {
161
177
  :search => {
162
178
  :flag => false,
163
179
  :compartment => nil,
164
180
  :parameters => {
165
- 'target' => "Patient/#{@patient2.xmlId}"
181
+ 'target' => "Patient/#{@patient2.id}"
166
182
  }
167
183
  }
168
184
  }
@@ -170,8 +186,8 @@ module Crucible
170
186
  assert_response_ok(reply)
171
187
  assert_bundle_response(reply)
172
188
  assert_equal(1, reply.resource.entry.size, 'There should only be one Provenance for the test Patient currently in the system.', reply.body)
173
- assert(reply.resource.entry[0].try(:resource).try(:target).try(:first).try(:reference).include?(@patient2.xmlId), 'The correct Provenance was not returned.', reply.body)
174
- @provenance2.xmlId = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[0].try(:response).try(:location))
189
+ assert(reply.resource.entry[0].try(:resource).try(:target).try(:first).try(:reference).include?(@patient2.id), 'The correct Provenance was not returned.', reply.body)
190
+ @provenance2.id = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[0].try(:response).try(:location))
175
191
  end
176
192
 
177
193
  # Update a Patient and check for AuditEvent
@@ -186,9 +202,10 @@ module Crucible
186
202
  requires resource: 'AuditEvent', methods: ['search']
187
203
  validates resource: 'Patient', methods: ['update']
188
204
  validates resource: 'AuditEvent', methods: ['search']
205
+ validates resource: nil, methods: ['Audit Logging']
189
206
  }
190
207
  @patient.gender = 'male'
191
- reply = @client.update(@patient,@patient.xmlId)
208
+ reply = @client.update(@patient,@patient.id)
192
209
  assert_response_ok(reply)
193
210
 
194
211
  options = {
@@ -196,18 +213,25 @@ module Crucible
196
213
  :flag => false,
197
214
  :compartment => nil,
198
215
  :parameters => {
199
- 'reference' => "Patient/#{@patient.xmlId}"
216
+ 'entity' => "Patient/#{@patient.id}"
200
217
  }
201
218
  }
202
219
  }
220
+ sleep 5 # give a few seconds for the Audit Event to be generated
203
221
  reply = @client.search(FHIR::AuditEvent, options)
204
222
  assert_response_ok(reply)
205
223
  assert_bundle_response(reply)
206
- assert_equal(2, reply.resource.entry.size, 'There should be two AuditEvents for the test Patient currently in the system.', reply.body)
224
+ found_update_type = false
207
225
  reply.resource.entry.each do |entry|
208
- assert(entry.try(:resource).try(:object).try(:reference).include?(@patient.xmlId), 'An incorrect AuditEvent was returned.', reply.body)
209
- warning { assert_equal('110110', entry.try(:resource).try(:event).try(:type).try(:code), 'Was expecting an AuditEvent.event.type.code of 110110 (Patient Record).', reply.body) }
226
+ assert(entry.try(:resource).try(:entity).try(:first).try(:reference).try(:reference), 'An incorrect AuditEvent was returned.', reply.body)
227
+ assert(entry.try(:resource).try(:entity).try(:first).try(:reference).try(:reference).include?(@patient.id), 'An incorrect AuditEvent was returned.', reply.body)
228
+ if entry.try(:resource).try(:action) == 'U'
229
+ found_update_type = true
230
+ warning { assert_equal('rest', entry.try(:resource).try(:type).try(:code), 'Was expecting an AuditEvent.event.type.code of rest', reply.body) }
231
+ warning { assert_equal('http://hl7.org/fhir/audit-event-type', entry.try(:resource).try(:type).try(:system), 'Was expecting an AuditEvent.event.type.system of http://hl7.org/fhir/audit-event-type', reply.body) }
232
+ end
210
233
  end
234
+ assert(found_update_type, 'No update AuditEvent returned', reply.body)
211
235
  end
212
236
 
213
237
  # Update a Patient with Provenance as a transaction
@@ -229,27 +253,34 @@ module Crucible
229
253
 
230
254
  @provenance3 = FHIR::Provenance.new
231
255
  @provenance3.target = [ FHIR::Reference.new ]
232
- @provenance3.target[0].reference = "Patient/#{@patient1.xmlId}"
233
- @provenance3.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ%z")
234
- @provenance3.reason = [ FHIR::CodeableConcept.new ]
235
- @provenance3.reason[0].text = 'Update Gender'
256
+ @provenance3.target[0].reference = "Patient/#{@patient1.id}"
257
+ @provenance3.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ")
258
+ @provenance3.reason = [ FHIR::Coding.new ]
259
+ @provenance3.reason[0].system = 'http://hl7.org/fhir/v3/ActReason'
260
+ @provenance3.reason[0].display = 'patient administration'
261
+ @provenance3.reason[0].code = 'PATADMIN'
262
+ @provenance3.agent = [ FHIR::Provenance::Agent.new ]
263
+ @provenance3.agent[0].role = FHIR::Coding.new
264
+ @provenance3.agent[0].role.system = 'http://hl7.org/fhir/provenance-participant-role'
265
+ @provenance3.agent[0].role.display = 'Author'
266
+ @provenance3.agent[0].role.code = 'author'
236
267
 
237
268
  @client.begin_transaction
238
269
  @client.add_transaction_request('PUT',nil,@patient1)
239
270
  @client.add_transaction_request('POST',nil,@provenance3)
240
271
  reply = @client.end_transaction
241
272
 
242
- assert_response_ok(reply)
273
+ assert([200,201,202].include?(reply.code), 'Expected response code 200, 201, or 202', reply.body)
243
274
  assert_bundle_response(reply)
244
275
 
245
- @provenance3.xmlId = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[1].try(:response).try(:location))
276
+ @provenance3.id = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[1].try(:response).try(:location))
246
277
 
247
278
  options = {
248
279
  :search => {
249
280
  :flag => false,
250
281
  :compartment => nil,
251
282
  :parameters => {
252
- 'target' => "Patient/#{@patient1.xmlId}"
283
+ 'target' => "Patient/#{@patient1.id}"
253
284
  }
254
285
  }
255
286
  }
@@ -258,7 +289,7 @@ module Crucible
258
289
  assert_bundle_response(reply)
259
290
  assert_equal(2, reply.resource.entry.size, 'There should be two Provenance resources for the test Patient currently in the system.', reply.body)
260
291
  reply.resource.entry.each do |entry|
261
- assert(entry.try(:resource).try(:target).try(:first).try(:reference).include?(@patient1.xmlId), 'An incorrect Provenance was returned.', reply.body)
292
+ assert(entry.try(:resource).try(:target).try(:first).try(:reference).include?(@patient1.id), 'An incorrect Provenance was returned.', reply.body)
262
293
  end
263
294
  end
264
295
 
@@ -275,21 +306,26 @@ module Crucible
275
306
  requires resource: 'Provenance', methods: ['search']
276
307
  validates resource: 'Patient', methods: ['create']
277
308
  validates resource: 'Provenance', methods: ['search']
278
- validates resource: nil, methods: ['provenance']
279
309
  }
280
310
 
281
311
  @patient2.gender = 'male'
282
312
 
283
313
  @provenance4 = FHIR::Provenance.new
284
314
  @provenance4.target = [ FHIR::Reference.new ]
285
- @provenance4.target[0].reference = "Patient/#{@patient2.xmlId}"
286
- @provenance4.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ%z")
287
- @provenance4.reason = [ FHIR::CodeableConcept.new ]
288
- @provenance4.reason[0].text = 'Update Gender'
289
-
290
- FHIR::ResourceAddress::DEFAULTS['X-Provenance'] = @provenance4.to_fhir_json
291
- reply = @client.update(@patient2,@patient2.xmlId)
292
- FHIR::ResourceAddress::DEFAULTS.delete('X-Provenance')
315
+ # @provenance4.target[0].reference = "Patient/#{@patient2.id}"
316
+ @provenance4.recorded = DateTime.now.strftime("%Y-%m-%dT%T.%LZ")
317
+ @provenance4.reason = [ FHIR::Coding.new ]
318
+ @provenance4.reason[0].system = 'http://hl7.org/fhir/v3/ActReason'
319
+ @provenance4.reason[0].display = 'patient administration'
320
+ @provenance4.reason[0].code = 'PATADMIN'
321
+ @provenance4.agent = [ FHIR::Provenance::Agent.new ]
322
+ @provenance4.agent[0].role = FHIR::Coding.new
323
+ @provenance4.agent[0].role.system = 'http://hl7.org/fhir/provenance-participant-role'
324
+ @provenance4.agent[0].role.display = 'Author'
325
+ @provenance4.agent[0].role.code = 'author'
326
+
327
+ options = { 'X-Provenance' => @provenance4.to_json }
328
+ reply = @client.base_update(@patient2, @patient2.id, options, @client.default_format)
293
329
  assert_response_ok(reply)
294
330
 
295
331
 
@@ -298,7 +334,7 @@ module Crucible
298
334
  :flag => false,
299
335
  :compartment => nil,
300
336
  :parameters => {
301
- 'target' => "Patient/#{@patient2.xmlId}"
337
+ 'target' => "Patient/#{@patient2.id}"
302
338
  }
303
339
  }
304
340
  }
@@ -307,10 +343,11 @@ module Crucible
307
343
  assert_bundle_response(reply)
308
344
  assert_equal(2, reply.resource.entry.size, 'There should be two Provenance resources for the test Patient currently in the system.', reply.body)
309
345
  reply.resource.entry.each do |entry|
310
- assert(entry.try(:resource).try(:target).try(:first).try(:reference).include?(@patient2.xmlId), 'An incorrect Provenance was returned.', reply.body)
346
+ assert(entry.try(:resource).try(:target).try(:first).try(:reference), 'An incorrect Provenance was returned.', reply.body)
347
+ assert(entry.try(:resource).try(:target).try(:first).try(:reference).include?(@patient2.id), 'An incorrect Provenance was returned.', reply.body)
311
348
  end
312
- @provenance3.xmlId = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[0].try(:response).try(:location))
313
- @provenance4.xmlId = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[1].try(:response).try(:location))
349
+ @provenance3.id = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[0].try(:response).try(:location))
350
+ @provenance4.id = FHIR::ResourceAddress.pull_out_id('Provenance',reply.resource.entry[1].try(:response).try(:location))
314
351
  end
315
352
 
316
353
  # Read a Patient and check for AuditEvent
@@ -325,9 +362,9 @@ module Crucible
325
362
  requires resource: 'AuditEvent', methods: ['search']
326
363
  validates resource: 'Patient', methods: ['read']
327
364
  validates resource: 'AuditEvent', methods: ['search']
328
- validates resource: nil, methods: ['Audit Logging', 'audit event']
365
+ validates resource: nil, methods: ['Audit Logging']
329
366
  }
330
- reply = @client.read(FHIR::Patient,@patient.xmlId)
367
+ reply = @client.read(FHIR::Patient,@patient.id)
331
368
  assert_response_ok(reply)
332
369
 
333
370
  options = {
@@ -335,18 +372,25 @@ module Crucible
335
372
  :flag => false,
336
373
  :compartment => nil,
337
374
  :parameters => {
338
- 'reference' => "Patient/#{@patient.xmlId}"
375
+ 'entity' => "Patient/#{@patient.id}"
339
376
  }
340
377
  }
341
378
  }
379
+ sleep 5 # give a few seconds for the Audit Event to be generated
342
380
  reply = @client.search(FHIR::AuditEvent, options)
343
381
  assert_response_ok(reply)
344
382
  assert_bundle_response(reply)
345
- assert_equal(3, reply.resource.entry.size, 'There should be three AuditEvents for the test Patient currently in the system.', reply.body)
383
+ found_read_type = false
346
384
  reply.resource.entry.each do |entry|
347
- assert(entry.try(:resource).try(:object).try(:reference).include?(@patient.xmlId), 'An incorrect AuditEvent was returned.', reply.body)
348
- warning { assert_equal('110110', entry.try(:resource).try(:event).try(:type).try(:code), 'Was expecting an AuditEvent.event.type.code of 110110 (Patient Record).', reply.body) }
385
+ assert(entry.try(:resource).try(:entity).try(:first).try(:reference).try(:reference), 'An incorrect AuditEvent was returned.', reply.body)
386
+ assert(entry.try(:resource).try(:entity).try(:first).try(:reference).try(:reference).include?(@patient.id), 'An incorrect AuditEvent was returned.', reply.body)
387
+ if entry.try(:resource).try(:action) == 'R'
388
+ found_read_type = true
389
+ warning { assert_equal('rest', entry.try(:resource).try(:type).try(:code), 'Was expecting an AuditEvent.event.type.code of rest', reply.body) }
390
+ warning { assert_equal('http://hl7.org/fhir/audit-event-type', entry.try(:resource).try(:type).try(:system), 'Was expecting an AuditEvent.event.type.system of http://hl7.org/fhir/audit-event-type', reply.body) }
391
+ end
349
392
  end
393
+ assert(found_read_type, 'No read AuditEvent returned', reply.body)
350
394
  end
351
395
 
352
396
  end