ipa_test_kit 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (270) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/lib/ipa_test_kit/custom_groups/capability_statement/conformance_support_test.rb +41 -0
  4. data/lib/ipa_test_kit/custom_groups/capability_statement/fhir_version_test.rb +15 -0
  5. data/lib/ipa_test_kit/custom_groups/capability_statement/json_support_test.rb +39 -0
  6. data/lib/ipa_test_kit/custom_groups/capability_statement/profile_support_test.rb +76 -0
  7. data/lib/ipa_test_kit/custom_groups/capability_statement_group.rb +64 -0
  8. data/lib/ipa_test_kit/date_search_validation.rb +101 -0
  9. data/lib/ipa_test_kit/ext/fhir_models.rb +59 -0
  10. data/lib/ipa_test_kit/fhir_resource_navigation.rb +63 -0
  11. data/lib/ipa_test_kit/generated/allergy_intolerance/allergy_intolerance_must_support_test.rb +40 -0
  12. data/lib/ipa_test_kit/generated/allergy_intolerance/allergy_intolerance_patient_clinical_status_search_test.rb +46 -0
  13. data/lib/ipa_test_kit/generated/allergy_intolerance/allergy_intolerance_patient_search_test.rb +60 -0
  14. data/lib/ipa_test_kit/generated/allergy_intolerance/allergy_intolerance_provenance_revinclude_search_test.rb +49 -0
  15. data/lib/ipa_test_kit/generated/allergy_intolerance/allergy_intolerance_read_test.rb +24 -0
  16. data/lib/ipa_test_kit/generated/allergy_intolerance/allergy_intolerance_reference_resolution_test.rb +28 -0
  17. data/lib/ipa_test_kit/generated/allergy_intolerance/allergy_intolerance_validation_test.rb +34 -0
  18. data/lib/ipa_test_kit/generated/allergy_intolerance/metadata.yml +165 -0
  19. data/lib/ipa_test_kit/generated/allergy_intolerance_group.rb +85 -0
  20. data/lib/ipa_test_kit/generated/bmi/bmi_must_support_test.rb +49 -0
  21. data/lib/ipa_test_kit/generated/bmi/bmi_patient_category_date_search_test.rb +46 -0
  22. data/lib/ipa_test_kit/generated/bmi/bmi_patient_category_search_test.rb +45 -0
  23. data/lib/ipa_test_kit/generated/bmi/bmi_patient_category_status_search_test.rb +47 -0
  24. data/lib/ipa_test_kit/generated/bmi/bmi_patient_code_date_search_test.rb +48 -0
  25. data/lib/ipa_test_kit/generated/bmi/bmi_patient_code_search_test.rb +62 -0
  26. data/lib/ipa_test_kit/generated/bmi/bmi_provenance_revinclude_search_test.rb +51 -0
  27. data/lib/ipa_test_kit/generated/bmi/bmi_read_test.rb +24 -0
  28. data/lib/ipa_test_kit/generated/bmi/bmi_reference_resolution_test.rb +28 -0
  29. data/lib/ipa_test_kit/generated/bmi/bmi_validation_test.rb +34 -0
  30. data/lib/ipa_test_kit/generated/bmi/metadata.yml +322 -0
  31. data/lib/ipa_test_kit/generated/bmi_group.rb +93 -0
  32. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_must_support_test.rb +49 -0
  33. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_patient_category_date_search_test.rb +46 -0
  34. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_patient_category_search_test.rb +45 -0
  35. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_patient_category_status_search_test.rb +47 -0
  36. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_patient_code_date_search_test.rb +48 -0
  37. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_patient_code_search_test.rb +62 -0
  38. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_provenance_revinclude_search_test.rb +51 -0
  39. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_read_test.rb +24 -0
  40. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_reference_resolution_test.rb +28 -0
  41. data/lib/ipa_test_kit/generated/bodyheight/bodyheight_validation_test.rb +34 -0
  42. data/lib/ipa_test_kit/generated/bodyheight/metadata.yml +328 -0
  43. data/lib/ipa_test_kit/generated/bodyheight_group.rb +93 -0
  44. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_must_support_test.rb +49 -0
  45. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_patient_category_date_search_test.rb +46 -0
  46. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_patient_category_search_test.rb +45 -0
  47. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_patient_category_status_search_test.rb +47 -0
  48. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_patient_code_date_search_test.rb +48 -0
  49. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_patient_code_search_test.rb +62 -0
  50. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_provenance_revinclude_search_test.rb +51 -0
  51. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_read_test.rb +24 -0
  52. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_reference_resolution_test.rb +28 -0
  53. data/lib/ipa_test_kit/generated/bodytemp/bodytemp_validation_test.rb +34 -0
  54. data/lib/ipa_test_kit/generated/bodytemp/metadata.yml +328 -0
  55. data/lib/ipa_test_kit/generated/bodytemp_group.rb +93 -0
  56. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_must_support_test.rb +49 -0
  57. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_patient_category_date_search_test.rb +46 -0
  58. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_patient_category_search_test.rb +45 -0
  59. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_patient_category_status_search_test.rb +47 -0
  60. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_patient_code_date_search_test.rb +48 -0
  61. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_patient_code_search_test.rb +62 -0
  62. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_provenance_revinclude_search_test.rb +51 -0
  63. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_read_test.rb +24 -0
  64. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_reference_resolution_test.rb +28 -0
  65. data/lib/ipa_test_kit/generated/bodyweight/bodyweight_validation_test.rb +34 -0
  66. data/lib/ipa_test_kit/generated/bodyweight/metadata.yml +328 -0
  67. data/lib/ipa_test_kit/generated/bodyweight_group.rb +93 -0
  68. data/lib/ipa_test_kit/generated/bp/bp_must_support_test.rb +52 -0
  69. data/lib/ipa_test_kit/generated/bp/bp_patient_category_date_search_test.rb +46 -0
  70. data/lib/ipa_test_kit/generated/bp/bp_patient_category_search_test.rb +45 -0
  71. data/lib/ipa_test_kit/generated/bp/bp_patient_category_status_search_test.rb +47 -0
  72. data/lib/ipa_test_kit/generated/bp/bp_patient_code_date_search_test.rb +48 -0
  73. data/lib/ipa_test_kit/generated/bp/bp_patient_code_search_test.rb +62 -0
  74. data/lib/ipa_test_kit/generated/bp/bp_provenance_revinclude_search_test.rb +51 -0
  75. data/lib/ipa_test_kit/generated/bp/bp_read_test.rb +24 -0
  76. data/lib/ipa_test_kit/generated/bp/bp_reference_resolution_test.rb +28 -0
  77. data/lib/ipa_test_kit/generated/bp/bp_validation_test.rb +34 -0
  78. data/lib/ipa_test_kit/generated/bp/metadata.yml +379 -0
  79. data/lib/ipa_test_kit/generated/bp_group.rb +93 -0
  80. data/lib/ipa_test_kit/generated/condition/condition_must_support_test.rb +39 -0
  81. data/lib/ipa_test_kit/generated/condition/condition_patient_category_search_test.rb +47 -0
  82. data/lib/ipa_test_kit/generated/condition/condition_patient_clinical_status_search_test.rb +46 -0
  83. data/lib/ipa_test_kit/generated/condition/condition_patient_code_search_test.rb +47 -0
  84. data/lib/ipa_test_kit/generated/condition/condition_patient_onset_date_search_test.rb +47 -0
  85. data/lib/ipa_test_kit/generated/condition/condition_patient_search_test.rb +60 -0
  86. data/lib/ipa_test_kit/generated/condition/condition_provenance_revinclude_search_test.rb +49 -0
  87. data/lib/ipa_test_kit/generated/condition/condition_read_test.rb +24 -0
  88. data/lib/ipa_test_kit/generated/condition/condition_reference_resolution_test.rb +28 -0
  89. data/lib/ipa_test_kit/generated/condition/condition_validation_test.rb +34 -0
  90. data/lib/ipa_test_kit/generated/condition/metadata.yml +231 -0
  91. data/lib/ipa_test_kit/generated/condition_group.rb +91 -0
  92. data/lib/ipa_test_kit/generated/document_reference/document_reference_id_search_test.rb +40 -0
  93. data/lib/ipa_test_kit/generated/document_reference/document_reference_must_support_test.rb +49 -0
  94. data/lib/ipa_test_kit/generated/document_reference/document_reference_patient_category_date_search_test.rb +46 -0
  95. data/lib/ipa_test_kit/generated/document_reference/document_reference_patient_category_search_test.rb +45 -0
  96. data/lib/ipa_test_kit/generated/document_reference/document_reference_patient_search_test.rb +61 -0
  97. data/lib/ipa_test_kit/generated/document_reference/document_reference_patient_status_search_test.rb +46 -0
  98. data/lib/ipa_test_kit/generated/document_reference/document_reference_patient_type_period_search_test.rb +48 -0
  99. data/lib/ipa_test_kit/generated/document_reference/document_reference_patient_type_search_test.rb +45 -0
  100. data/lib/ipa_test_kit/generated/document_reference/document_reference_provenance_revinclude_search_test.rb +50 -0
  101. data/lib/ipa_test_kit/generated/document_reference/document_reference_read_test.rb +24 -0
  102. data/lib/ipa_test_kit/generated/document_reference/document_reference_reference_resolution_test.rb +28 -0
  103. data/lib/ipa_test_kit/generated/document_reference/document_reference_validation_test.rb +34 -0
  104. data/lib/ipa_test_kit/generated/document_reference/metadata.yml +356 -0
  105. data/lib/ipa_test_kit/generated/document_reference_group.rb +99 -0
  106. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_must_support_test.rb +49 -0
  107. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_patient_category_date_search_test.rb +46 -0
  108. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_patient_category_search_test.rb +45 -0
  109. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_patient_category_status_search_test.rb +47 -0
  110. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_patient_code_date_search_test.rb +48 -0
  111. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_patient_code_search_test.rb +62 -0
  112. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_provenance_revinclude_search_test.rb +51 -0
  113. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_read_test.rb +24 -0
  114. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_reference_resolution_test.rb +28 -0
  115. data/lib/ipa_test_kit/generated/head_circumference/head_circumference_validation_test.rb +34 -0
  116. data/lib/ipa_test_kit/generated/head_circumference/metadata.yml +324 -0
  117. data/lib/ipa_test_kit/generated/head_circumference_group.rb +93 -0
  118. data/lib/ipa_test_kit/generated/heartrate/heartrate_must_support_test.rb +49 -0
  119. data/lib/ipa_test_kit/generated/heartrate/heartrate_patient_category_date_search_test.rb +46 -0
  120. data/lib/ipa_test_kit/generated/heartrate/heartrate_patient_category_search_test.rb +45 -0
  121. data/lib/ipa_test_kit/generated/heartrate/heartrate_patient_category_status_search_test.rb +47 -0
  122. data/lib/ipa_test_kit/generated/heartrate/heartrate_patient_code_date_search_test.rb +48 -0
  123. data/lib/ipa_test_kit/generated/heartrate/heartrate_patient_code_search_test.rb +62 -0
  124. data/lib/ipa_test_kit/generated/heartrate/heartrate_provenance_revinclude_search_test.rb +51 -0
  125. data/lib/ipa_test_kit/generated/heartrate/heartrate_read_test.rb +24 -0
  126. data/lib/ipa_test_kit/generated/heartrate/heartrate_reference_resolution_test.rb +28 -0
  127. data/lib/ipa_test_kit/generated/heartrate/heartrate_validation_test.rb +34 -0
  128. data/lib/ipa_test_kit/generated/heartrate/metadata.yml +325 -0
  129. data/lib/ipa_test_kit/generated/heartrate_group.rb +93 -0
  130. data/lib/ipa_test_kit/generated/immunization/immunization_must_support_test.rb +40 -0
  131. data/lib/ipa_test_kit/generated/immunization/immunization_patient_date_search_test.rb +47 -0
  132. data/lib/ipa_test_kit/generated/immunization/immunization_patient_search_test.rb +60 -0
  133. data/lib/ipa_test_kit/generated/immunization/immunization_patient_status_search_test.rb +45 -0
  134. data/lib/ipa_test_kit/generated/immunization/immunization_provenance_revinclude_search_test.rb +50 -0
  135. data/lib/ipa_test_kit/generated/immunization/immunization_read_test.rb +24 -0
  136. data/lib/ipa_test_kit/generated/immunization/immunization_reference_resolution_test.rb +28 -0
  137. data/lib/ipa_test_kit/generated/immunization/immunization_validation_test.rb +34 -0
  138. data/lib/ipa_test_kit/generated/immunization/metadata.yml +210 -0
  139. data/lib/ipa_test_kit/generated/immunization_group.rb +87 -0
  140. data/lib/ipa_test_kit/generated/ipa_test_suite.rb +88 -0
  141. data/lib/ipa_test_kit/generated/medication_request/medication_request_must_support_test.rb +44 -0
  142. data/lib/ipa_test_kit/generated/medication_request/medication_request_patient_intent_authoredon_search_test.rb +53 -0
  143. data/lib/ipa_test_kit/generated/medication_request/medication_request_patient_intent_encounter_search_test.rb +52 -0
  144. data/lib/ipa_test_kit/generated/medication_request/medication_request_patient_intent_search_test.rb +68 -0
  145. data/lib/ipa_test_kit/generated/medication_request/medication_request_patient_intent_status_search_test.rb +49 -0
  146. data/lib/ipa_test_kit/generated/medication_request/medication_request_provenance_revinclude_search_test.rb +51 -0
  147. data/lib/ipa_test_kit/generated/medication_request/medication_request_read_test.rb +24 -0
  148. data/lib/ipa_test_kit/generated/medication_request/medication_request_reference_resolution_test.rb +28 -0
  149. data/lib/ipa_test_kit/generated/medication_request/medication_request_validation_test.rb +34 -0
  150. data/lib/ipa_test_kit/generated/medication_request/medication_validation_test.rb +34 -0
  151. data/lib/ipa_test_kit/generated/medication_request/metadata.yml +307 -0
  152. data/lib/ipa_test_kit/generated/medication_request_group.rb +92 -0
  153. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_must_support_test.rb +43 -0
  154. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_patient_context_search_test.rb +51 -0
  155. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_patient_effective_search_test.rb +52 -0
  156. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_patient_search_test.rb +68 -0
  157. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_patient_status_search_test.rb +49 -0
  158. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_provenance_revinclude_search_test.rb +51 -0
  159. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_read_test.rb +24 -0
  160. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_reference_resolution_test.rb +28 -0
  161. data/lib/ipa_test_kit/generated/medication_statement/medication_statement_validation_test.rb +34 -0
  162. data/lib/ipa_test_kit/generated/medication_statement/medication_validation_test.rb +34 -0
  163. data/lib/ipa_test_kit/generated/medication_statement/metadata.yml +230 -0
  164. data/lib/ipa_test_kit/generated/medication_statement_group.rb +92 -0
  165. data/lib/ipa_test_kit/generated/metadata.yml +6230 -0
  166. data/lib/ipa_test_kit/generated/observation/metadata.yml +1280 -0
  167. data/lib/ipa_test_kit/generated/observation/observation_must_support_test.rb +41 -0
  168. data/lib/ipa_test_kit/generated/observation/observation_patient_category_date_search_test.rb +46 -0
  169. data/lib/ipa_test_kit/generated/observation/observation_patient_category_search_test.rb +62 -0
  170. data/lib/ipa_test_kit/generated/observation/observation_patient_category_status_search_test.rb +47 -0
  171. data/lib/ipa_test_kit/generated/observation/observation_patient_code_date_search_test.rb +48 -0
  172. data/lib/ipa_test_kit/generated/observation/observation_patient_code_search_test.rb +45 -0
  173. data/lib/ipa_test_kit/generated/observation/observation_provenance_revinclude_search_test.rb +51 -0
  174. data/lib/ipa_test_kit/generated/observation/observation_read_test.rb +24 -0
  175. data/lib/ipa_test_kit/generated/observation/observation_reference_resolution_test.rb +28 -0
  176. data/lib/ipa_test_kit/generated/observation/observation_validation_test.rb +34 -0
  177. data/lib/ipa_test_kit/generated/observation_group.rb +93 -0
  178. data/lib/ipa_test_kit/generated/oxygensat/metadata.yml +366 -0
  179. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_must_support_test.rb +65 -0
  180. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_patient_category_date_search_test.rb +46 -0
  181. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_patient_category_search_test.rb +45 -0
  182. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_patient_category_status_search_test.rb +47 -0
  183. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_patient_code_date_search_test.rb +48 -0
  184. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_patient_code_search_test.rb +62 -0
  185. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_provenance_revinclude_search_test.rb +51 -0
  186. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_read_test.rb +24 -0
  187. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_reference_resolution_test.rb +28 -0
  188. data/lib/ipa_test_kit/generated/oxygensat/oxygensat_validation_test.rb +34 -0
  189. data/lib/ipa_test_kit/generated/oxygensat_group.rb +93 -0
  190. data/lib/ipa_test_kit/generated/patient/metadata.yml +320 -0
  191. data/lib/ipa_test_kit/generated/patient/patient_birthdate_family_search_test.rb +41 -0
  192. data/lib/ipa_test_kit/generated/patient/patient_birthdate_name_search_test.rb +39 -0
  193. data/lib/ipa_test_kit/generated/patient/patient_family_gender_search_test.rb +41 -0
  194. data/lib/ipa_test_kit/generated/patient/patient_gender_name_search_test.rb +39 -0
  195. data/lib/ipa_test_kit/generated/patient/patient_id_search_test.rb +53 -0
  196. data/lib/ipa_test_kit/generated/patient/patient_identifier_search_test.rb +40 -0
  197. data/lib/ipa_test_kit/generated/patient/patient_must_support_test.rb +57 -0
  198. data/lib/ipa_test_kit/generated/patient/patient_name_search_test.rb +39 -0
  199. data/lib/ipa_test_kit/generated/patient/patient_provenance_revinclude_search_test.rb +49 -0
  200. data/lib/ipa_test_kit/generated/patient/patient_read_test.rb +24 -0
  201. data/lib/ipa_test_kit/generated/patient/patient_reference_resolution_test.rb +28 -0
  202. data/lib/ipa_test_kit/generated/patient/patient_validation_test.rb +34 -0
  203. data/lib/ipa_test_kit/generated/patient_group.rb +99 -0
  204. data/lib/ipa_test_kit/generated/practitioner/metadata.yml +124 -0
  205. data/lib/ipa_test_kit/generated/practitioner/practitioner_identifier_search_test.rb +40 -0
  206. data/lib/ipa_test_kit/generated/practitioner/practitioner_must_support_test.rb +40 -0
  207. data/lib/ipa_test_kit/generated/practitioner/practitioner_name_search_test.rb +49 -0
  208. data/lib/ipa_test_kit/generated/practitioner/practitioner_read_test.rb +24 -0
  209. data/lib/ipa_test_kit/generated/practitioner/practitioner_reference_resolution_test.rb +28 -0
  210. data/lib/ipa_test_kit/generated/practitioner/practitioner_validation_test.rb +34 -0
  211. data/lib/ipa_test_kit/generated/practitioner_group.rb +84 -0
  212. data/lib/ipa_test_kit/generated/practitioner_role/metadata.yml +141 -0
  213. data/lib/ipa_test_kit/generated/practitioner_role/practitioner_role_identifier_search_test.rb +40 -0
  214. data/lib/ipa_test_kit/generated/practitioner_role/practitioner_role_must_support_test.rb +40 -0
  215. data/lib/ipa_test_kit/generated/practitioner_role/practitioner_role_practitioner_search_test.rb +51 -0
  216. data/lib/ipa_test_kit/generated/practitioner_role/practitioner_role_read_test.rb +24 -0
  217. data/lib/ipa_test_kit/generated/practitioner_role/practitioner_role_reference_resolution_test.rb +28 -0
  218. data/lib/ipa_test_kit/generated/practitioner_role/practitioner_role_validation_test.rb +34 -0
  219. data/lib/ipa_test_kit/generated/practitioner_role_group.rb +84 -0
  220. data/lib/ipa_test_kit/generated/provenance/metadata.yml +114 -0
  221. data/lib/ipa_test_kit/generated/provenance/provenance_read_test.rb +24 -0
  222. data/lib/ipa_test_kit/generated/provenance/provenance_reference_resolution_test.rb +28 -0
  223. data/lib/ipa_test_kit/generated/provenance/provenance_validation_test.rb +34 -0
  224. data/lib/ipa_test_kit/generated/provenance_group.rb +53 -0
  225. data/lib/ipa_test_kit/generated/resource_list.rb +18 -0
  226. data/lib/ipa_test_kit/generated/resprate/metadata.yml +325 -0
  227. data/lib/ipa_test_kit/generated/resprate/resprate_must_support_test.rb +49 -0
  228. data/lib/ipa_test_kit/generated/resprate/resprate_patient_category_date_search_test.rb +46 -0
  229. data/lib/ipa_test_kit/generated/resprate/resprate_patient_category_search_test.rb +45 -0
  230. data/lib/ipa_test_kit/generated/resprate/resprate_patient_category_status_search_test.rb +47 -0
  231. data/lib/ipa_test_kit/generated/resprate/resprate_patient_code_date_search_test.rb +48 -0
  232. data/lib/ipa_test_kit/generated/resprate/resprate_patient_code_search_test.rb +62 -0
  233. data/lib/ipa_test_kit/generated/resprate/resprate_provenance_revinclude_search_test.rb +51 -0
  234. data/lib/ipa_test_kit/generated/resprate/resprate_read_test.rb +24 -0
  235. data/lib/ipa_test_kit/generated/resprate/resprate_reference_resolution_test.rb +28 -0
  236. data/lib/ipa_test_kit/generated/resprate/resprate_validation_test.rb +34 -0
  237. data/lib/ipa_test_kit/generated/resprate_group.rb +93 -0
  238. data/lib/ipa_test_kit/generator/group_generator.rb +171 -0
  239. data/lib/ipa_test_kit/generator/group_metadata.rb +98 -0
  240. data/lib/ipa_test_kit/generator/group_metadata_extractor.rb +278 -0
  241. data/lib/ipa_test_kit/generator/ig_loader.rb +63 -0
  242. data/lib/ipa_test_kit/generator/ig_metadata.rb +49 -0
  243. data/lib/ipa_test_kit/generator/ig_metadata_extractor.rb +56 -0
  244. data/lib/ipa_test_kit/generator/ig_resources.rb +48 -0
  245. data/lib/ipa_test_kit/generator/must_support_metadata_extractor.rb +221 -0
  246. data/lib/ipa_test_kit/generator/must_support_test_generator.rb +86 -0
  247. data/lib/ipa_test_kit/generator/naming.rb +46 -0
  248. data/lib/ipa_test_kit/generator/provenance_revinclude_search_test_generator.rb +186 -0
  249. data/lib/ipa_test_kit/generator/read_test_generator.rb +89 -0
  250. data/lib/ipa_test_kit/generator/reference_resolution_test_generator.rb +72 -0
  251. data/lib/ipa_test_kit/generator/resource_list_generator.rb +46 -0
  252. data/lib/ipa_test_kit/generator/search_definition_metadata_extractor.rb +181 -0
  253. data/lib/ipa_test_kit/generator/search_metadata_extractor.rb +74 -0
  254. data/lib/ipa_test_kit/generator/search_test_generator.rb +295 -0
  255. data/lib/ipa_test_kit/generator/special_cases.rb +16 -0
  256. data/lib/ipa_test_kit/generator/suite_generator.rb +67 -0
  257. data/lib/ipa_test_kit/generator/terminology_binding_metadata_extractor.rb +105 -0
  258. data/lib/ipa_test_kit/generator/validation_test_generator.rb +124 -0
  259. data/lib/ipa_test_kit/generator.rb +86 -0
  260. data/lib/ipa_test_kit/igs/package.tgz +0 -0
  261. data/lib/ipa_test_kit/must_support_test.rb +146 -0
  262. data/lib/ipa_test_kit/read_test.rb +62 -0
  263. data/lib/ipa_test_kit/reference_resolution_test.rb +111 -0
  264. data/lib/ipa_test_kit/request_logger.rb +46 -0
  265. data/lib/ipa_test_kit/search_test.rb +728 -0
  266. data/lib/ipa_test_kit/search_test_properties.rb +61 -0
  267. data/lib/ipa_test_kit/validation_test.rb +48 -0
  268. data/lib/ipa_test_kit/version.rb +3 -0
  269. data/lib/ipa_test_kit.rb +2 -0
  270. metadata +397 -0
@@ -0,0 +1,98 @@
1
+ module IpaTestKit
2
+ class Generator
3
+ class GroupMetadata
4
+ ATTRIBUTES = [
5
+ :name,
6
+ :class_name,
7
+ :version,
8
+ :reformatted_version,
9
+ :resource,
10
+ :profile_url,
11
+ :profile_name,
12
+ :title,
13
+ :short_description,
14
+ :interactions,
15
+ :operations,
16
+ :searches,
17
+ :search_definitions,
18
+ :include_params,
19
+ :revincludes,
20
+ :required_concepts,
21
+ :must_supports,
22
+ :mandatory_elements,
23
+ :bindings,
24
+ :references,
25
+ :tests,
26
+ :id,
27
+ :file_name,
28
+ :delayed_references
29
+ ].freeze
30
+
31
+ NON_USCDI_RESOURCES = [
32
+ 'Encounter',
33
+ 'Location',
34
+ 'Organization',
35
+ 'Practitioner',
36
+ 'PractitionerRole',
37
+ 'Provenance'
38
+ ].freeze
39
+
40
+ ATTRIBUTES.each { |name| attr_accessor name }
41
+
42
+ def initialize(params)
43
+ params.each do |key, value|
44
+ raise "Unknown attribute #{key}" unless ATTRIBUTES.include? key
45
+
46
+ instance_variable_set(:"@#{key}", value)
47
+ end
48
+ end
49
+
50
+ def delayed?
51
+ return false if resource == 'Patient'
52
+
53
+ no_patient_searches? || non_uscdi_resource?
54
+ end
55
+
56
+ def no_patient_searches?
57
+ searches.none? { |search| search[:names].include? 'patient' }
58
+ end
59
+
60
+ def non_uscdi_resource?
61
+ NON_USCDI_RESOURCES.include? resource
62
+ end
63
+
64
+ def add_test(id:, file_name:)
65
+ self.tests ||= []
66
+
67
+ test_metadata = {
68
+ id: id,
69
+ file_name: file_name
70
+ }
71
+
72
+ if delayed? && id.include?('read')
73
+ self.tests.unshift(test_metadata)
74
+ else
75
+ self.tests << test_metadata
76
+ end
77
+ end
78
+
79
+ def to_hash
80
+ ATTRIBUTES.each_with_object({}) { |key, hash| hash[key] = send(key) }
81
+ end
82
+
83
+ def add_delayed_references(delayed_profiles, ig_resources)
84
+ self.delayed_references =
85
+ references
86
+ .select { |reference| (reference[:profiles] & delayed_profiles).present? }
87
+ .map do |reference|
88
+ profile_urls = (reference[:profiles] & delayed_profiles)
89
+ delayed_resources = profile_urls.map { |url| ig_resources.resource_for_profile(url) }
90
+ {
91
+ path: reference[:path].gsub("#{resource}.", ''),
92
+ resources: delayed_resources
93
+ }
94
+ end
95
+ end
96
+ end
97
+ end
98
+ end
@@ -0,0 +1,278 @@
1
+ require_relative 'group_metadata'
2
+ require_relative 'ig_metadata'
3
+ require_relative 'must_support_metadata_extractor'
4
+ require_relative 'search_metadata_extractor'
5
+ require_relative 'terminology_binding_metadata_extractor'
6
+
7
+ module IpaTestKit
8
+ class Generator
9
+ class GroupMetadataExtractor
10
+ attr_accessor :resource_capabilities, :profile_url, :ig_metadata, :ig_resources
11
+
12
+ def initialize(resource_capabilities, profile_url, ig_metadata, ig_resources)
13
+ self.resource_capabilities = resource_capabilities
14
+ self.profile_url = profile_url
15
+ self.ig_metadata = ig_metadata
16
+ self.ig_resources = ig_resources
17
+ end
18
+
19
+ def group_metadata
20
+ @group_metadata ||=
21
+ GroupMetadata.new(group_metadata_hash)
22
+ end
23
+
24
+ def group_metadata_hash
25
+ @group_metadata_hash ||=
26
+ {
27
+ name: name,
28
+ class_name: class_name,
29
+ version: version,
30
+ reformatted_version: reformatted_version,
31
+ # test_id_prefix: test_id_prefix,
32
+ resource: resource,
33
+ profile_url: profile_url,
34
+ profile_name: profile_name,
35
+ title: title,
36
+ short_description: short_description,
37
+ interactions: interactions,
38
+ operations: operations,
39
+ searches: searches,
40
+ search_definitions: search_definitions,
41
+ include_params: include_params,
42
+ revincludes: revincludes,
43
+ required_concepts: required_concepts,
44
+ must_supports: must_supports,
45
+ mandatory_elements: mandatory_elements,
46
+ bindings: bindings,
47
+ references: references
48
+ # tests: []
49
+ }
50
+
51
+ mark_mandatory_and_must_support_searches
52
+ handle_special_cases
53
+
54
+ @group_metadata_hash
55
+ end
56
+
57
+ def mark_mandatory_and_must_support_searches
58
+ searches.each do |search|
59
+ search[:names_not_must_support_or_mandatory] = search[:names].reject do |name|
60
+ path = search_definitions[name.to_sym][:full_path]
61
+ any_must_support_elements = (must_supports[:elements]).any? do |element|
62
+ full_must_support_path = "#{resource}.#{element[:path]}"
63
+
64
+ # allow for non-choice, choice types, and _id
65
+ name == '_id' || full_must_support_path == path || full_must_support_path == "#{path}[x]"
66
+ end
67
+
68
+ any_must_support_slices = must_supports[:slices].any? do |slice|
69
+ # only handle type slices because that is all we need for now
70
+ if slice[:discriminator] && slice[:discriminator][:type] == 'type'
71
+ full_must_support_path = "#{resource}.#{slice[:path].sub('[x]', slice[:discriminator][:code])}"
72
+ full_must_support_path == path
73
+ else
74
+ false
75
+ end
76
+ end
77
+
78
+ any_mandatory_elements = mandatory_elements.any? do |element|
79
+ element == path
80
+ end
81
+
82
+ any_must_support_elements || any_must_support_slices || any_mandatory_elements
83
+ end
84
+
85
+ search[:must_support_or_mandatory] = search[:names_not_must_support_or_mandatory].empty?
86
+ end
87
+ end
88
+
89
+ ### BEGIN SPECIAL CASES ###
90
+
91
+ CATEGORY_FIRST_PROFILES = [
92
+ 'http://hl7.org/fhir/uv/ipa/StructureDefinition/ipa-observation',
93
+ ]
94
+
95
+ def category_first_profile?
96
+ CATEGORY_FIRST_PROFILES.include?(profile_url)
97
+ end
98
+
99
+ def first_search_params
100
+ @first_search_params ||=
101
+ if category_first_profile?
102
+ ['patient', 'category']
103
+ elsif resource == 'Observation'
104
+ ['patient', 'code']
105
+ elsif resource == 'MedicationRequest'
106
+ ['patient', 'intent']
107
+ else
108
+ ['patient']
109
+ end
110
+ end
111
+
112
+ def handle_special_cases
113
+ set_first_search
114
+
115
+ case profile_url
116
+ when 'http://hl7.org/fhir/uv/ipa/StructureDefinition/ipa-implantable-device'
117
+ must_supports[:elements].delete_if do |element|
118
+ ['udiCarrier.carrierAIDC', 'udiCarrier.carrierHRF'].include? element[:path]
119
+ end
120
+ when 'http://hl7.org/fhir/uv/ipa/StructureDefinition/ipa-documentreference'
121
+ must_supports[:elements].delete_if do |element|
122
+ ['content.attachment.data', 'content.attachment.url'].include? element[:path]
123
+ end
124
+ end
125
+ end
126
+
127
+ def set_first_search
128
+ search = searches.find { |param| param[:names] == first_search_params }
129
+ return if search.nil?
130
+
131
+ searches.delete(search)
132
+ searches.unshift(search)
133
+ end
134
+
135
+ ### END SPECIAL CASES ###
136
+
137
+ def profile
138
+ @profile ||= ig_resources.profile_by_url(profile_url)
139
+ end
140
+
141
+ def profile_elements
142
+ @profile_elements ||= profile.snapshot.element
143
+ end
144
+
145
+ def base_name
146
+ profile_url.split('StructureDefinition/').last
147
+ end
148
+
149
+ def name
150
+ base_name.tr('-', '_')
151
+ end
152
+
153
+ def class_name
154
+ base_name
155
+ .split('-')
156
+ .map(&:capitalize)
157
+ .join
158
+ .gsub('Ipa', "Ipa#{ig_metadata.reformatted_version}")
159
+ .concat('Sequence')
160
+ end
161
+
162
+ def version
163
+ ig_metadata.ig_version
164
+ end
165
+
166
+ def reformatted_version
167
+ ig_metadata.reformatted_version
168
+ end
169
+
170
+ def resource
171
+ resource_capabilities.type
172
+ end
173
+
174
+ def profile_name
175
+ profile.title.gsub(' ', ' ')
176
+ end
177
+
178
+ def title
179
+ profile.title.gsub(/IPA\s*/, '').gsub(/\s*Profile/, '').strip
180
+ end
181
+
182
+ def short_description
183
+ "Verify support for the server capabilities required by the #{profile_name}."
184
+ end
185
+
186
+ def interactions
187
+ @interactions ||=
188
+ resource_capabilities.interaction.map do |interaction|
189
+ {
190
+ code: interaction.code,
191
+ expectation: interaction.extension.first.valueCode # TODO: fix expectation extension finding
192
+ }
193
+ end
194
+ end
195
+
196
+ def operations
197
+ @operations ||=
198
+ resource_capabilities.operation.map do |operation|
199
+ {
200
+ code: operation.name,
201
+ expectation: operation.extension.first.valueCode # TODO: fix expectation extension finding
202
+ }
203
+ end
204
+ end
205
+
206
+ def search_metadata_extractor
207
+ @search_metadata_extractor ||=
208
+ SearchMetadataExtractor.new(resource_capabilities, ig_resources, resource, profile_elements)
209
+ end
210
+
211
+ def searches
212
+ @searches ||= search_metadata_extractor.searches
213
+ end
214
+
215
+ def search_definitions
216
+ @search_definitions ||= search_metadata_extractor.search_definitions
217
+ end
218
+
219
+ def include_params
220
+ resource_capabilities.searchInclude || []
221
+ end
222
+
223
+ def revincludes
224
+ resource_capabilities.searchRevInclude || []
225
+ end
226
+
227
+ def required_concepts
228
+ # The base FHIR vital signs profile has a required binding that isn't
229
+ # relevant for any of its child profiles
230
+ return if resource == 'Observation'
231
+
232
+ profile_elements
233
+ .select { |element| element.type&.any? { |type| type.code == 'CodeableConcept' } }
234
+ .select { |element| element.binding&.strength == 'required' }
235
+ .map { |element| element.path.gsub("#{resource}.", '').gsub('[x]', 'CodeableConcept') }
236
+ end
237
+
238
+ def terminology_binding_metadata_extractor
239
+ @terminology_binding_metadata_extractor ||=
240
+ TerminologyBindingMetadataExtractor.new(profile_elements, ig_resources, resource)
241
+ end
242
+
243
+ def bindings
244
+ @bindings ||=
245
+ terminology_binding_metadata_extractor.terminology_bindings
246
+ end
247
+
248
+ def must_support_metadata_extractor
249
+ @must_support_metadata_extractor ||=
250
+ MustSupportMetadataExtractor.new(profile_elements, profile, resource)
251
+ end
252
+
253
+ def must_supports
254
+ @must_supports ||=
255
+ must_support_metadata_extractor.must_supports
256
+ end
257
+
258
+ def mandatory_elements
259
+ @mandatory_elements ||=
260
+ profile_elements
261
+ .select { |element| element.min.positive? }
262
+ .map { |element| element.path }
263
+ end
264
+
265
+ def references
266
+ @references ||=
267
+ profile_elements
268
+ .select { |element| element.type&.first&.code == 'Reference' }
269
+ .map do |reference_definition|
270
+ {
271
+ path: reference_definition.path,
272
+ profiles: reference_definition.type.first.targetProfile
273
+ }
274
+ end
275
+ end
276
+ end
277
+ end
278
+ end
@@ -0,0 +1,63 @@
1
+ require 'active_support/all'
2
+ require 'fhir_models'
3
+ require 'rubygems/package'
4
+ require 'zlib'
5
+ require_relative 'ig_resources'
6
+
7
+ module IpaTestKit
8
+ class Generator
9
+ class IGLoader
10
+ def ig_resources
11
+ @ig_resources ||= IGResources.new
12
+ end
13
+
14
+ def load
15
+ load_ig
16
+ load_standalone_resources
17
+ end
18
+
19
+ def load_ig
20
+ tar = Gem::Package::TarReader.new(Zlib::GzipReader.open(File.join(__dir__, '..', 'igs', 'package.tgz')))
21
+
22
+ tar.each do |entry|
23
+ next if entry.directory?
24
+
25
+ file_name = entry.full_name.split('/').last
26
+
27
+ next unless file_name.end_with? '.json'
28
+
29
+ next unless entry.full_name.start_with? 'package/'
30
+
31
+ begin
32
+ resource = FHIR.from_contents(entry.read)
33
+ next if resource.nil?
34
+ rescue StandardError
35
+ puts "#{file_name} does not appear to be a FHIR resource."
36
+ next
37
+ end
38
+
39
+ ig_resources.add(resource)
40
+ end
41
+
42
+ ig_resources
43
+ end
44
+
45
+ def load_standalone_resources
46
+ Dir.glob(File.join(__dir__, '..', 'igs', '*.json')).each do |file_path|
47
+ begin
48
+ resource = FHIR.from_contents(File.read(file_path))
49
+ next if resource.nil?
50
+ rescue StandardError
51
+ file_name = file_path.split('/').last
52
+ puts "#{file_name} does not appear to be a FHIR resource."
53
+ next
54
+ end
55
+
56
+ ig_resources.add(resource)
57
+ end
58
+
59
+ ig_resources
60
+ end
61
+ end
62
+ end
63
+ end
@@ -0,0 +1,49 @@
1
+ module IpaTestKit
2
+ class Generator
3
+ class IGMetadata
4
+ attr_accessor :ig_version, :groups
5
+
6
+ def reformatted_version
7
+ @reformatted_version ||= ig_version.delete('.')
8
+ end
9
+
10
+ def ordered_groups
11
+ @ordered_groups ||=
12
+ [patient_group] + non_delayed_groups + delayed_groups
13
+ end
14
+
15
+ def patient_group
16
+ @patient_group ||=
17
+ groups.find { |group| group.resource == 'Patient' }
18
+ end
19
+
20
+ def delayed_groups
21
+ @delayed_groups ||=
22
+ groups.select { |group| group.delayed? }
23
+ end
24
+
25
+ def non_delayed_groups
26
+ @non_delayed_groups ||=
27
+ groups.reject { |group| group.delayed? } - [patient_group]
28
+ end
29
+
30
+ def delayed_profiles
31
+ @delayed_profiles ||=
32
+ delayed_groups.map(&:profile_url)
33
+ end
34
+
35
+ def postprocess_groups(ig_resources)
36
+ groups.each do |group|
37
+ group.add_delayed_references(delayed_profiles, ig_resources)
38
+ end
39
+ end
40
+
41
+ def to_hash
42
+ {
43
+ ig_version: ig_version,
44
+ groups: groups.map(&:to_hash)
45
+ }
46
+ end
47
+ end
48
+ end
49
+ end
@@ -0,0 +1,56 @@
1
+ require_relative 'ig_metadata'
2
+ require_relative 'group_metadata_extractor'
3
+
4
+ module IpaTestKit
5
+ class Generator
6
+ class IGMetadataExtractor
7
+ attr_accessor :ig_resources, :metadata
8
+
9
+ def initialize(ig_resources)
10
+ self.ig_resources = ig_resources
11
+ add_vital_signs_profiles
12
+ self.metadata = IGMetadata.new
13
+ end
14
+
15
+ def extract
16
+ add_metadata_from_ig
17
+ add_metadata_from_resources
18
+ metadata
19
+ end
20
+
21
+ def add_metadata_from_ig
22
+ metadata.ig_version = "v#{ig_resources.ig.version}"
23
+ end
24
+
25
+ def resources_in_capability_statement
26
+ ig_resources.capability_statement.rest.first.resource
27
+ end
28
+
29
+ # The IPA Server Capability Statement does not list support for the
30
+ # required vital signs profiles, so they need to be added
31
+ def add_vital_signs_profiles
32
+ ig_resources.capability_statement.rest.first.resource
33
+ .find { |resource| resource.type == 'Observation' }
34
+ .supportedProfile.concat [
35
+ 'http://hl7.org/fhir/StructureDefinition/bodyheight',
36
+ 'http://hl7.org/fhir/StructureDefinition/bodytemp',
37
+ 'http://hl7.org/fhir/StructureDefinition/bp',
38
+ 'http://hl7.org/fhir/StructureDefinition/bodyweight',
39
+ 'http://hl7.org/fhir/StructureDefinition/heartrate',
40
+ 'http://hl7.org/fhir/StructureDefinition/resprate'
41
+ ]
42
+ end
43
+
44
+ def add_metadata_from_resources
45
+ metadata.groups =
46
+ resources_in_capability_statement.flat_map do |resource|
47
+ resource.supportedProfile&.map do |supported_profile|
48
+ GroupMetadataExtractor.new(resource, supported_profile, metadata, ig_resources).group_metadata
49
+ end
50
+ end
51
+
52
+ metadata.postprocess_groups(ig_resources)
53
+ end
54
+ end
55
+ end
56
+ end
@@ -0,0 +1,48 @@
1
+ module IpaTestKit
2
+ class Generator
3
+ class IGResources
4
+ def add(resource)
5
+ resources_by_type[resource.resourceType] << resource
6
+ end
7
+
8
+ def capability_statement(mode = 'server')
9
+ resources_by_type['CapabilityStatement'].find do |capability_statement_resource|
10
+ capability_statement_resource.rest.any? { |r| r.mode == mode }
11
+ end
12
+ end
13
+
14
+ def ig
15
+ resources_by_type['ImplementationGuide'].first
16
+ end
17
+
18
+ def inspect
19
+ 'IGResources'
20
+ end
21
+
22
+ def profile_by_url(url)
23
+ resources_by_type['StructureDefinition'].find { |profile| profile.url == url }
24
+ end
25
+
26
+ def resource_for_profile(url)
27
+ resources_by_type['StructureDefinition'].find { |profile| profile.url == url }.type
28
+ end
29
+
30
+ def value_set_by_url(url)
31
+ resources_by_type['ValueSet'].find { |profile| profile.url == url }
32
+ end
33
+
34
+ def search_param_by_resource_and_name(resource, name)
35
+ normalized_name = name.to_s == '_id' ? 'id' : name.to_s
36
+
37
+ resources_by_type['SearchParameter']
38
+ .find { |param| param.id == "ipa-#{resource.downcase}-#{normalized_name}" }
39
+ end
40
+
41
+ private
42
+
43
+ def resources_by_type
44
+ @resources_by_type ||= Hash.new { |hash, key| hash[key] = [] }
45
+ end
46
+ end
47
+ end
48
+ end