davinci_plan_net_test_kit 0.9.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (325) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/lib/davinci_plan_net_test_kit/custom_groups/capability_statement/conformance_support_test.rb +41 -0
  4. data/lib/davinci_plan_net_test_kit/custom_groups/capability_statement/fhir_version_test.rb +15 -0
  5. data/lib/davinci_plan_net_test_kit/custom_groups/capability_statement/instantiate_test.rb +19 -0
  6. data/lib/davinci_plan_net_test_kit/custom_groups/capability_statement/json_support_test.rb +39 -0
  7. data/lib/davinci_plan_net_test_kit/custom_groups/capability_statement/profile_support_test.rb +38 -0
  8. data/lib/davinci_plan_net_test_kit/custom_groups/combination_searches/examples.json +40 -0
  9. data/lib/davinci_plan_net_test_kit/custom_groups/data_absent_reason_group.rb +59 -0
  10. data/lib/davinci_plan_net_test_kit/custom_groups/reverse_chain_tests/examples.json +60 -0
  11. data/lib/davinci_plan_net_test_kit/custom_groups/v1.1.0/capability_statement_group.rb +75 -0
  12. data/lib/davinci_plan_net_test_kit/date_search_validation.rb +108 -0
  13. data/lib/davinci_plan_net_test_kit/fhir_resource_navigation.rb +75 -0
  14. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/davinci_plan_net_test_suite.rb +231 -0
  15. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_forward_chain_organization_address_search_test.rb +55 -0
  16. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_forward_chain_organization_name_search_test.rb +55 -0
  17. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_forward_chain_organization_partof_search_test.rb +55 -0
  18. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_forward_chain_organization_type_search_test.rb +55 -0
  19. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_id_search_test.rb +41 -0
  20. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_include_endpoint_organization_search_test.rb +52 -0
  21. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_lastupdated_search_test.rb +43 -0
  22. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_must_support_test.rb +47 -0
  23. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_no_params_search_test.rb +49 -0
  24. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_organization_search_test.rb +41 -0
  25. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_read_test.rb +26 -0
  26. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_reference_resolution_test.rb +42 -0
  27. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/endpoint_validation_test.rb +40 -0
  28. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint/metadata.yml +171 -0
  29. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/endpoint_group.rb +168 -0
  30. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_combination_list_specialty_covered_by_network_search_test.rb +55 -0
  31. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_coverage_area_search_test.rb +41 -0
  32. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_endpoint_search_test.rb +41 -0
  33. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_endpoint_organization_search_test.rb +55 -0
  34. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_location_address_city_search_test.rb +55 -0
  35. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_location_address_postalcode_search_test.rb +55 -0
  36. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_location_address_search_test.rb +55 -0
  37. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_location_address_state_search_test.rb +55 -0
  38. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_location_organization_search_test.rb +55 -0
  39. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_location_type_search_test.rb +55 -0
  40. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_organization_address_search_test.rb +55 -0
  41. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_organization_name_search_test.rb +55 -0
  42. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_organization_partof_search_test.rb +55 -0
  43. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_forward_chain_organization_type_search_test.rb +55 -0
  44. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_id_search_test.rb +41 -0
  45. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_include_healthcare_service_coverage_area_search_test.rb +52 -0
  46. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_include_healthcare_service_endpoint_search_test.rb +52 -0
  47. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_include_healthcare_service_location_search_test.rb +52 -0
  48. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_include_healthcare_service_organization_search_test.rb +52 -0
  49. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_lastupdated_search_test.rb +43 -0
  50. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_location_search_test.rb +41 -0
  51. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_must_support_test.rb +65 -0
  52. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_name_search_test.rb +41 -0
  53. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_no_params_search_test.rb +49 -0
  54. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_organization_search_test.rb +41 -0
  55. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_read_test.rb +26 -0
  56. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_reference_resolution_test.rb +45 -0
  57. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_revinclude_organization_affiliation_service_search_test.rb +60 -0
  58. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_revinclude_practitioner_role_service_search_test.rb +60 -0
  59. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_service_category_search_test.rb +42 -0
  60. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_service_type_search_test.rb +42 -0
  61. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_specialty_search_test.rb +42 -0
  62. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/healthcare_service_validation_test.rb +40 -0
  63. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service/metadata.yml +1377 -0
  64. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/healthcare_service_group.rb +240 -0
  65. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_administered_by_search_test.rb +41 -0
  66. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_coverage_area_search_test.rb +41 -0
  67. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_forward_chain_administered_by_name_search_test.rb +55 -0
  68. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_forward_chain_administered_by_partof_search_test.rb +55 -0
  69. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_forward_chain_owned_by_name_search_test.rb +55 -0
  70. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_forward_chain_owned_by_partof_search_test.rb +55 -0
  71. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_id_search_test.rb +41 -0
  72. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_identifier_search_test.rb +44 -0
  73. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_include_insurance_plan_administered_by_search_test.rb +52 -0
  74. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_include_insurance_plan_coverage_area_search_test.rb +52 -0
  75. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_include_insurance_plan_owned_by_search_test.rb +52 -0
  76. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_lastupdated_search_test.rb +43 -0
  77. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_must_support_test.rb +57 -0
  78. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_name_search_test.rb +41 -0
  79. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_no_params_search_test.rb +49 -0
  80. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_owned_by_search_test.rb +41 -0
  81. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_plan_type_search_test.rb +42 -0
  82. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_read_test.rb +26 -0
  83. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_reference_resolution_test.rb +48 -0
  84. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_type_search_test.rb +42 -0
  85. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/insurance_plan_validation_test.rb +40 -0
  86. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan/metadata.yml +368 -0
  87. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/insurance_plan_group.rb +193 -0
  88. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_address_city_search_test.rb +41 -0
  89. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_address_postalcode_search_test.rb +41 -0
  90. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_address_search_test.rb +41 -0
  91. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_address_state_search_test.rb +41 -0
  92. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_endpoint_search_test.rb +41 -0
  93. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_endpoint_organization_search_test.rb +55 -0
  94. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_organization_address_search_test.rb +55 -0
  95. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_organization_name_search_test.rb +55 -0
  96. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_organization_partof_search_test.rb +55 -0
  97. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_organization_type_search_test.rb +55 -0
  98. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_partof_address_search_test.rb +55 -0
  99. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_partof_organization_search_test.rb +55 -0
  100. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_forward_chain_partof_type_search_test.rb +55 -0
  101. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_id_search_test.rb +41 -0
  102. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_include_location_endpoint_search_test.rb +52 -0
  103. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_include_location_organization_search_test.rb +52 -0
  104. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_include_location_partof_search_test.rb +52 -0
  105. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_lastupdated_search_test.rb +43 -0
  106. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_must_support_test.rb +66 -0
  107. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_no_params_search_test.rb +49 -0
  108. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_organization_search_test.rb +41 -0
  109. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_partof_search_test.rb +41 -0
  110. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_read_test.rb +26 -0
  111. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_reference_resolution_test.rb +44 -0
  112. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_reverse_chain_insurance_plan_coverage_area_owned_by_search_test.rb +62 -0
  113. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_revinclude_healthcare_service_location_search_test.rb +60 -0
  114. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_revinclude_insurance_plan_coverage_area_search_test.rb +60 -0
  115. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_revinclude_organization_affiliation_location_search_test.rb +60 -0
  116. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_revinclude_practitioner_role_location_search_test.rb +60 -0
  117. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_type_search_test.rb +42 -0
  118. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/location_validation_test.rb +40 -0
  119. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location/metadata.yml +395 -0
  120. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/location_group.rb +262 -0
  121. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/metadata.yml +5214 -0
  122. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/metadata.yml +304 -0
  123. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_address_search_test.rb +41 -0
  124. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_coverage_area_search_test.rb +41 -0
  125. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_endpoint_search_test.rb +41 -0
  126. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_forward_chain_endpoint_organization_search_test.rb +55 -0
  127. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_forward_chain_partof_address_search_test.rb +55 -0
  128. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_forward_chain_partof_name_search_test.rb +55 -0
  129. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_forward_chain_partof_type_search_test.rb +55 -0
  130. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_id_search_test.rb +41 -0
  131. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_include_organization_coverage_area_search_test.rb +52 -0
  132. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_include_organization_endpoint_search_test.rb +52 -0
  133. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_include_organization_partof_search_test.rb +52 -0
  134. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_lastupdated_search_test.rb +43 -0
  135. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_must_support_test.rb +58 -0
  136. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_name_search_test.rb +41 -0
  137. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_no_params_search_test.rb +49 -0
  138. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_partof_search_test.rb +41 -0
  139. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_read_test.rb +26 -0
  140. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_reference_resolution_test.rb +43 -0
  141. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_reverse_chain_practitioner_role_network_location_search_test.rb +62 -0
  142. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_revinclude_practitioner_role_network_search_test.rb +60 -0
  143. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_type_search_test.rb +42 -0
  144. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network/network_validation_test.rb +40 -0
  145. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/network_group.rb +238 -0
  146. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/metadata.yml +1296 -0
  147. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_endpoint_search_test.rb +41 -0
  148. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_endpoint_organization_search_test.rb +55 -0
  149. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_location_address_city_search_test.rb +55 -0
  150. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_location_address_postalcode_search_test.rb +55 -0
  151. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_location_address_search_test.rb +55 -0
  152. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_location_address_state_search_test.rb +55 -0
  153. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_location_organization_search_test.rb +55 -0
  154. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_location_type_search_test.rb +55 -0
  155. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_network_name_search_test.rb +55 -0
  156. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_network_partof_search_test.rb +55 -0
  157. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_participating_organization_address_search_test.rb +55 -0
  158. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_participating_organization_name_search_test.rb +55 -0
  159. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_participating_organization_partof_search_test.rb +55 -0
  160. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_participating_organization_type_search_test.rb +55 -0
  161. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_primary_organization_address_search_test.rb +55 -0
  162. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_primary_organization_name_search_test.rb +55 -0
  163. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_primary_organization_partof_search_test.rb +55 -0
  164. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_primary_organization_type_search_test.rb +55 -0
  165. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_service_location_search_test.rb +55 -0
  166. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_service_organization_search_test.rb +55 -0
  167. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_forward_chain_service_service_category_search_test.rb +55 -0
  168. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_id_search_test.rb +41 -0
  169. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_include_organization_affiliation_endpoint_search_test.rb +52 -0
  170. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_include_organization_affiliation_location_search_test.rb +52 -0
  171. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_include_organization_affiliation_network_search_test.rb +52 -0
  172. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_include_organization_affiliation_participating_organization_search_test.rb +52 -0
  173. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_include_organization_affiliation_primary_organization_search_test.rb +52 -0
  174. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_include_organization_affiliation_service_search_test.rb +52 -0
  175. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_lastupdated_search_test.rb +43 -0
  176. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_location_search_test.rb +41 -0
  177. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_must_support_test.rb +52 -0
  178. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_network_search_test.rb +41 -0
  179. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_no_params_search_test.rb +49 -0
  180. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_participating_organization_search_test.rb +41 -0
  181. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_primary_organization_search_test.rb +41 -0
  182. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_read_test.rb +26 -0
  183. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_reference_resolution_test.rb +47 -0
  184. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_role_search_test.rb +42 -0
  185. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_service_search_test.rb +41 -0
  186. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_specialty_search_test.rb +42 -0
  187. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil/org_affil_validation_test.rb +40 -0
  188. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/org_affil_group.rb +241 -0
  189. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/metadata.yml +384 -0
  190. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_address_search_test.rb +41 -0
  191. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_coverage_area_search_test.rb +43 -0
  192. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_endpoint_search_test.rb +41 -0
  193. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_forward_chain_endpoint_organization_search_test.rb +55 -0
  194. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_forward_chain_partof_address_search_test.rb +55 -0
  195. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_forward_chain_partof_name_search_test.rb +55 -0
  196. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_forward_chain_partof_type_search_test.rb +55 -0
  197. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_id_search_test.rb +41 -0
  198. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_include_organization_coverage_area_search_test.rb +52 -0
  199. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_include_organization_endpoint_search_test.rb +52 -0
  200. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_include_organization_partof_search_test.rb +52 -0
  201. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_lastupdated_search_test.rb +43 -0
  202. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_must_support_test.rb +68 -0
  203. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_name_search_test.rb +41 -0
  204. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_no_params_search_test.rb +49 -0
  205. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_partof_search_test.rb +41 -0
  206. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_read_test.rb +26 -0
  207. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_reference_resolution_test.rb +43 -0
  208. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_reverse_chain_insurance_plan_owned_by_coverage_area_search_test.rb +62 -0
  209. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_reverse_chain_org_affil_participating_organization_location_search_test.rb +62 -0
  210. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_reverse_chain_org_affil_participating_organization_network_search_test.rb +62 -0
  211. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_reverse_chain_org_affil_participating_organization_specialty_search_test.rb +62 -0
  212. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_revinclude_endpoint_organization_search_test.rb +60 -0
  213. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_revinclude_healthcare_service_organization_search_test.rb +60 -0
  214. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_revinclude_insurance_plan_administered_by_search_test.rb +60 -0
  215. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_revinclude_insurance_plan_owned_by_search_test.rb +60 -0
  216. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_revinclude_organization_affiliation_participating_organization_search_test.rb +60 -0
  217. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_revinclude_organization_affiliation_primary_organization_search_test.rb +60 -0
  218. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_revinclude_practitioner_role_organization_search_test.rb +60 -0
  219. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_type_search_test.rb +42 -0
  220. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization/organization_validation_test.rb +40 -0
  221. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/organization_group.rb +265 -0
  222. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/metadata.yml +253 -0
  223. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_family_search_test.rb +41 -0
  224. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_given_search_test.rb +41 -0
  225. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_id_search_test.rb +41 -0
  226. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_lastupdated_search_test.rb +43 -0
  227. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_must_support_test.rb +57 -0
  228. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_name_search_test.rb +41 -0
  229. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_no_params_search_test.rb +49 -0
  230. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_read_test.rb +26 -0
  231. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_reference_resolution_test.rb +42 -0
  232. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_reverse_chain_practitioner_role_practitioner_location_search_test.rb +62 -0
  233. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_reverse_chain_practitioner_role_practitioner_network_search_test.rb +62 -0
  234. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_reverse_chain_practitioner_role_practitioner_role_search_test.rb +62 -0
  235. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_reverse_chain_practitioner_role_practitioner_specialty_search_test.rb +62 -0
  236. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_revinclude_practitioner_role_practitioner_search_test.rb +60 -0
  237. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner/practitioner_validation_test.rb +40 -0
  238. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_group.rb +188 -0
  239. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/metadata.yml +1198 -0
  240. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_combination_list_practitioners_with_specialty_and_location_search_test.rb +50 -0
  241. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_endpoint_search_test.rb +41 -0
  242. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_endpoint_organization_search_test.rb +55 -0
  243. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_location_address_city_search_test.rb +55 -0
  244. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_location_address_postalcode_search_test.rb +55 -0
  245. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_location_address_search_test.rb +55 -0
  246. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_location_address_state_search_test.rb +55 -0
  247. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_location_organization_search_test.rb +55 -0
  248. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_location_type_search_test.rb +55 -0
  249. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_network_address_search_test.rb +55 -0
  250. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_network_name_search_test.rb +55 -0
  251. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_network_partof_search_test.rb +55 -0
  252. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_network_type_search_test.rb +55 -0
  253. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_organization_address_search_test.rb +55 -0
  254. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_organization_name_search_test.rb +55 -0
  255. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_organization_partof_search_test.rb +55 -0
  256. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_organization_type_search_test.rb +55 -0
  257. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_practitioner_name_search_test.rb +55 -0
  258. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_service_location_search_test.rb +55 -0
  259. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_service_organization_search_test.rb +55 -0
  260. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_forward_chain_service_service_category_search_test.rb +55 -0
  261. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_id_search_test.rb +41 -0
  262. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_include_practitioner_role_endpoint_search_test.rb +52 -0
  263. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_include_practitioner_role_location_search_test.rb +52 -0
  264. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_include_practitioner_role_network_search_test.rb +52 -0
  265. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_include_practitioner_role_organization_search_test.rb +52 -0
  266. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_include_practitioner_role_practitioner_search_test.rb +52 -0
  267. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_include_practitioner_role_service_search_test.rb +52 -0
  268. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_lastupdated_search_test.rb +43 -0
  269. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_location_search_test.rb +41 -0
  270. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_must_support_test.rb +70 -0
  271. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_network_search_test.rb +41 -0
  272. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_no_params_search_test.rb +49 -0
  273. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_organization_search_test.rb +41 -0
  274. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_practitioner_search_test.rb +41 -0
  275. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_read_test.rb +26 -0
  276. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_reference_resolution_test.rb +46 -0
  277. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_role_search_test.rb +42 -0
  278. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_service_search_test.rb +41 -0
  279. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_specialty_search_test.rb +42 -0
  280. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role/practitioner_role_validation_test.rb +40 -0
  281. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/practitioner_role_group.rb +241 -0
  282. data/lib/davinci_plan_net_test_kit/generated/v1.1.0/resource_list.rb +16 -0
  283. data/lib/davinci_plan_net_test_kit/generator/combination_search_test_generator.rb +215 -0
  284. data/lib/davinci_plan_net_test_kit/generator/forward_chain_test_generator.rb +198 -0
  285. data/lib/davinci_plan_net_test_kit/generator/group_generator.rb +377 -0
  286. data/lib/davinci_plan_net_test_kit/generator/group_metadata.rb +77 -0
  287. data/lib/davinci_plan_net_test_kit/generator/group_metadata_extractor.rb +268 -0
  288. data/lib/davinci_plan_net_test_kit/generator/ig_loader.rb +76 -0
  289. data/lib/davinci_plan_net_test_kit/generator/ig_metadata.rb +52 -0
  290. data/lib/davinci_plan_net_test_kit/generator/ig_metadata_extractor.rb +57 -0
  291. data/lib/davinci_plan_net_test_kit/generator/ig_resources.rb +64 -0
  292. data/lib/davinci_plan_net_test_kit/generator/include_search_test_generator.rb +205 -0
  293. data/lib/davinci_plan_net_test_kit/generator/must_support_metadata_extractor.rb +337 -0
  294. data/lib/davinci_plan_net_test_kit/generator/must_support_metadata_extractor_us_core_3.rb +25 -0
  295. data/lib/davinci_plan_net_test_kit/generator/must_support_test_generator.rb +116 -0
  296. data/lib/davinci_plan_net_test_kit/generator/naming.rb +34 -0
  297. data/lib/davinci_plan_net_test_kit/generator/read_test_generator.rb +86 -0
  298. data/lib/davinci_plan_net_test_kit/generator/reference_resolution_test_generator.rb +92 -0
  299. data/lib/davinci_plan_net_test_kit/generator/resource_list_generator.rb +42 -0
  300. data/lib/davinci_plan_net_test_kit/generator/reverse_chain_search_test_generator.rb +194 -0
  301. data/lib/davinci_plan_net_test_kit/generator/revinclude_search_test_generator.rb +204 -0
  302. data/lib/davinci_plan_net_test_kit/generator/search_definition_metadata_extractor.rb +193 -0
  303. data/lib/davinci_plan_net_test_kit/generator/search_metadata_extractor.rb +74 -0
  304. data/lib/davinci_plan_net_test_kit/generator/search_no_params_test_generator.rb +124 -0
  305. data/lib/davinci_plan_net_test_kit/generator/search_test_generator.rb +276 -0
  306. data/lib/davinci_plan_net_test_kit/generator/special_cases.rb +92 -0
  307. data/lib/davinci_plan_net_test_kit/generator/suite_generator.rb +93 -0
  308. data/lib/davinci_plan_net_test_kit/generator/terminology_binding_metadata_extractor.rb +120 -0
  309. data/lib/davinci_plan_net_test_kit/generator/validation_test_generator.rb +140 -0
  310. data/lib/davinci_plan_net_test_kit/generator/value_extractor.rb +117 -0
  311. data/lib/davinci_plan_net_test_kit/generator.rb +143 -0
  312. data/lib/davinci_plan_net_test_kit/igs/package/SearchParameter-Resource-id.json +1 -0
  313. data/lib/davinci_plan_net_test_kit/igs/package/SearchParameter-Resource-lastUpdated.json +1 -0
  314. data/lib/davinci_plan_net_test_kit/igs/package.tgz +0 -0
  315. data/lib/davinci_plan_net_test_kit/must_support_test.rb +211 -0
  316. data/lib/davinci_plan_net_test_kit/provenance_validator.rb +37 -0
  317. data/lib/davinci_plan_net_test_kit/read_test.rb +62 -0
  318. data/lib/davinci_plan_net_test_kit/reference_resolution_test.rb +179 -0
  319. data/lib/davinci_plan_net_test_kit/request_logger.rb +46 -0
  320. data/lib/davinci_plan_net_test_kit/search_test.rb +1252 -0
  321. data/lib/davinci_plan_net_test_kit/search_test_properties.rb +66 -0
  322. data/lib/davinci_plan_net_test_kit/validation_test.rb +56 -0
  323. data/lib/davinci_plan_net_test_kit/version.rb +5 -0
  324. data/lib/davinci_plan_net_test_kit.rb +1 -0
  325. metadata +452 -0
@@ -0,0 +1,268 @@
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 DaVinciPlanNetTestKit
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
+ versioned_profile_url: profile_url.gsub(/davinci-pdex-plan-net\/StructureDefinition\//, 'davinci-pdex-plan-net/STU1.1/StructureDefinition/'),
35
+ profile_name: profile_name,
36
+ profile_version: profile_version,
37
+ title: title,
38
+ short_description: short_description,
39
+ interactions: interactions,
40
+ operations: operations,
41
+ searches: searches,
42
+ search_definitions: search_definitions,
43
+ include_params: include_params,
44
+ revincludes: revincludes,
45
+ required_concepts: required_concepts,
46
+ must_supports: must_supports,
47
+ mandatory_elements: mandatory_elements,
48
+ bindings: bindings,
49
+ references: references
50
+ # tests: []
51
+ }
52
+
53
+ mark_mandatory_and_must_support_searches
54
+ handle_special_cases
55
+
56
+ @group_metadata_hash
57
+ end
58
+
59
+ def mark_mandatory_and_must_support_searches
60
+ searches.each do |search|
61
+ search[:names_not_must_support_or_mandatory] = search[:names].reject do |name|
62
+ full_paths = search_definitions[name.to_sym][:full_paths]
63
+ any_must_support_elements = (must_supports[:elements]).any? do |element|
64
+ full_must_support_paths = ["#{resource}.#{element[:original_path]}", "#{resource}.#{element[:path]}", element[:path]]
65
+
66
+ full_paths.any? do |path|
67
+ # allow for non-choice, choice types, _id
68
+ name == '_id' || full_must_support_paths.include?(path) || full_must_support_paths.include?("#{path}[x]")
69
+ end
70
+ end
71
+
72
+ any_must_support_slices = must_supports[:slices].any? do |slice|
73
+ # only handle type slices because that is all we need for now
74
+ # for a slice like Observation.effective[x]:effectiveDateTime, the search parameter's expression could be
75
+ # either Observation.effective or Observation.effectiveDateTime.
76
+ if slice[:discriminator] && slice[:discriminator][:type] == 'type'
77
+ full_must_support_path = "#{resource}.#{slice[:path].sub('[x]', slice[:discriminator][:code])}"
78
+ base_must_support_path = "#{resource}.#{slice[:path].sub('[x]', '')}"
79
+
80
+ full_paths.intersection([full_must_support_path,base_must_support_path]).present?
81
+ else
82
+ false
83
+ end
84
+ end
85
+
86
+ any_must_support_extensions = must_supports[:extensions].any? do |extension|
87
+ extension[:url].present? && full_paths.any? { |path| extension[:url] == path[/(?<=where\(url=').*(?='\))/] }
88
+ end
89
+
90
+ any_mandatory_elements = mandatory_elements.any? do |element|
91
+ full_paths.include?(element)
92
+ end
93
+
94
+ any_must_support_elements || any_must_support_slices || any_mandatory_elements || any_must_support_extensions
95
+ end
96
+
97
+ search[:must_support_or_mandatory] = search[:names_not_must_support_or_mandatory].empty?
98
+ end
99
+ end
100
+
101
+ ### BEGIN SPECIAL CASES ###
102
+ def first_search_params
103
+ # TODO
104
+ # I think we are still defining this? Shouldn't parameterless always be the first search at this point?
105
+ end
106
+
107
+ def handle_special_cases
108
+ set_first_search
109
+ end
110
+
111
+ def set_first_search
112
+ search = searches.find { |param| param[:names] == first_search_params }
113
+ return if search.nil?
114
+
115
+ searches.delete(search)
116
+ searches.unshift(search)
117
+ end
118
+
119
+ ### END SPECIAL CASES ###
120
+
121
+ def profile
122
+ @profile ||= ig_resources.profile_by_url(profile_url)
123
+ end
124
+
125
+ def profile_elements
126
+ @profile_elements ||= profile.snapshot.element
127
+ end
128
+
129
+ def base_name
130
+ profile_url.split('StructureDefinition/').last
131
+ end
132
+
133
+ def name
134
+ base_name.tr('-', '_')
135
+ end
136
+
137
+ def class_name
138
+ base_name
139
+ .split('-')
140
+ .map(&:capitalize)
141
+ .join
142
+ .concat('Sequence')
143
+ end
144
+
145
+ def version
146
+ ig_metadata.ig_version
147
+ end
148
+
149
+ def reformatted_version
150
+ ig_metadata.reformatted_version
151
+ end
152
+
153
+ def resource
154
+ resource_capabilities.type
155
+ end
156
+
157
+ def profile_name
158
+ profile.title.gsub(' ', ' ')
159
+ end
160
+
161
+ def profile_version
162
+ profile.version
163
+ end
164
+
165
+ def title
166
+ title = profile.title.gsub(/\s*Profile/, '').strip
167
+ title
168
+ end
169
+
170
+ def short_description
171
+ "Verify support for the server capabilities required by the #{profile_name}."
172
+ end
173
+
174
+ def interactions
175
+ @interactions ||=
176
+ resource_capabilities.interaction.map do |interaction|
177
+ {
178
+ code: interaction.code,
179
+ expectation: interaction.extension.first.valueCode # TODO: fix expectation extension finding
180
+ }
181
+ end
182
+ end
183
+
184
+ def operations
185
+ @operations ||=
186
+ resource_capabilities.operation.map do |operation|
187
+ {
188
+ code: operation.name,
189
+ expectation: operation.extension.first.valueCode # TODO: fix expectation extension finding
190
+ }
191
+ end
192
+ end
193
+
194
+ def search_metadata_extractor
195
+ @search_metadata_extractor ||=
196
+ SearchMetadataExtractor.new(resource_capabilities, ig_resources, resource, profile_elements)
197
+ end
198
+
199
+ def searches
200
+ @searches ||= search_metadata_extractor.searches
201
+ end
202
+
203
+ def search_definitions
204
+ @search_definitions ||= search_metadata_extractor.search_definitions
205
+ end
206
+
207
+ def include_params
208
+ resource_capabilities.searchInclude || []
209
+ end
210
+
211
+ def revincludes
212
+ resource_capabilities.searchRevInclude || []
213
+ end
214
+
215
+ def required_concepts
216
+ # The base FHIR vital signs profile has a required binding that isn't
217
+ # relevant for any of its child profiles
218
+ return [] if resource == 'Observation'
219
+
220
+ profile_elements
221
+ .select { |element| element.type&.any? { |type| type.code == 'CodeableConcept' } }
222
+ .select { |element| element.binding&.strength == 'required' }
223
+ .map { |element| element.path.gsub("#{resource}.", '').gsub('[x]', 'CodeableConcept') }
224
+ .uniq
225
+ end
226
+
227
+ def terminology_binding_metadata_extractor
228
+ @terminology_binding_metadata_extractor ||=
229
+ TerminologyBindingMetadataExtractor.new(profile_elements, ig_resources, resource)
230
+ end
231
+
232
+ def bindings
233
+ @bindings ||=
234
+ terminology_binding_metadata_extractor.terminology_bindings
235
+ end
236
+
237
+ def must_support_metadata_extractor
238
+ @must_support_metadata_extractor ||=
239
+ MustSupportMetadataExtractor.new(profile_elements, profile, resource, ig_resources)
240
+ end
241
+
242
+ def must_supports
243
+ @must_supports ||=
244
+ must_support_metadata_extractor.must_supports
245
+ end
246
+
247
+ def mandatory_elements
248
+ @mandatory_elements ||=
249
+ profile_elements
250
+ .select { |element| element.min.positive? }
251
+ .map { |element| element.path }
252
+ .uniq
253
+ end
254
+
255
+ def references
256
+ @references ||=
257
+ profile_elements
258
+ .select { |element| element.type&.first&.code == 'Reference' }
259
+ .map do |reference_definition|
260
+ {
261
+ path: reference_definition.path,
262
+ profiles: reference_definition.type.first.targetProfile
263
+ }
264
+ end
265
+ end
266
+ end
267
+ end
268
+ end
@@ -0,0 +1,76 @@
1
+ require 'active_support/all'
2
+ require 'fhir_models'
3
+ require 'pathname'
4
+ require 'rubygems/package'
5
+ require 'zlib'
6
+ require_relative 'ig_resources'
7
+
8
+ module DaVinciPlanNetTestKit
9
+ class Generator
10
+ class IGLoader
11
+ attr_accessor :ig_file_name
12
+
13
+ def initialize(ig_file_name)
14
+ self.ig_file_name = ig_file_name
15
+ end
16
+
17
+ def ig_resources
18
+ @ig_resources ||= IGResources.new
19
+ end
20
+
21
+ def load
22
+ load_ig
23
+ load_standalone_resources
24
+ end
25
+
26
+ def load_ig
27
+ tar = Gem::Package::TarReader.new(
28
+ Zlib::GzipReader.open(ig_file_name)
29
+ )
30
+
31
+ tar.each do |entry|
32
+ next if entry.directory?
33
+
34
+ file_name = entry.full_name.split('/').last
35
+
36
+ next unless file_name.end_with? '.json'
37
+
38
+ next unless entry.full_name.start_with? 'package/'
39
+
40
+ begin
41
+ resource = FHIR.from_contents(entry.read)
42
+ next if resource.nil?
43
+ rescue StandardError
44
+ puts "#{file_name} does not appear to be a FHIR resource."
45
+ next
46
+ end
47
+
48
+ ig_resources.add(resource)
49
+ end
50
+
51
+ ig_resources
52
+ end
53
+
54
+ def load_standalone_resources
55
+ ig_directory = ig_file_name.chomp('.tgz')
56
+
57
+ return ig_resources unless File.exist? ig_directory
58
+
59
+ Dir.glob(File.join(ig_directory, '*.json')).each do |file_path|
60
+ begin
61
+ resource = FHIR.from_contents(File.read(file_path))
62
+ next if resource.nil?
63
+ rescue StandardError
64
+ file_name = file_path.split('/').last
65
+ puts "#{file_name} does not appear to be a FHIR resource."
66
+ next
67
+ end
68
+
69
+ ig_resources.add(resource)
70
+ end
71
+
72
+ ig_resources
73
+ end
74
+ end
75
+ end
76
+ end
@@ -0,0 +1,52 @@
1
+ require_relative 'special_cases'
2
+
3
+ module DaVinciPlanNetTestKit
4
+ class Generator
5
+ class IGMetadata
6
+ attr_accessor :ig_version, :groups
7
+
8
+ def reformatted_version
9
+ @reformatted_version ||= ig_version.delete('.').gsub('-', '_')
10
+ end
11
+
12
+ def ordered_groups
13
+
14
+ if SpecialCases.has_explicit_group_order()
15
+ @ordered_groups ||=
16
+ groups.sort_by { |group| SpecialCases.group_index(group.name) }
17
+ else
18
+ @ordered_groups ||=
19
+ non_delayed_groups + delayed_groups
20
+ end
21
+ end
22
+
23
+ def delayed_groups
24
+ @delayed_groups ||=
25
+ groups.select { |group| group.delayed? }
26
+ end
27
+
28
+ def non_delayed_groups
29
+ @non_delayed_groups ||=
30
+ groups.reject { |group| group.delayed? }
31
+ end
32
+
33
+ def delayed_profiles
34
+ @delayed_profiles ||=
35
+ delayed_groups.map(&:profile_url)
36
+ end
37
+
38
+ def postprocess_groups(ig_resources)
39
+ groups.each do |group|
40
+ group.add_delayed_references(delayed_profiles, ig_resources)
41
+ end
42
+ end
43
+
44
+ def to_hash
45
+ {
46
+ ig_version: ig_version,
47
+ groups: groups.map(&:to_hash)
48
+ }
49
+ end
50
+ end
51
+ end
52
+ end
@@ -0,0 +1,57 @@
1
+ require_relative 'ig_metadata'
2
+ require_relative 'group_metadata_extractor'
3
+
4
+ module DaVinciPlanNetTestKit
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_missing_supported_profiles
12
+ #remove_extra_supported_profiles
13
+ self.metadata = IGMetadata.new
14
+ end
15
+
16
+ def extract
17
+ add_metadata_from_ig
18
+ add_metadata_from_resources
19
+ metadata
20
+ end
21
+
22
+ def add_metadata_from_ig
23
+ metadata.ig_version = "v#{ig_resources.ig.version}"
24
+ end
25
+
26
+ def resources_in_capability_statement
27
+ ig_resources.capability_statement.rest.first.resource
28
+ end
29
+
30
+ def add_missing_supported_profiles
31
+ case ig_resources.ig.version
32
+ when '1.1.0'
33
+ # This is the only expected version currently, just leaving this blank for now.
34
+ end
35
+ end
36
+
37
+ def remove_extra_supported_profiles
38
+ ig_resources.capability_statement.rest.first.resource
39
+ .find { |resource| resource.type == 'Observation' }
40
+ .supportedProfile.delete_if do |profile_url|
41
+ SpecialCases::PROFILES_TO_EXCLUDE.include?(profile_url)
42
+ end
43
+ end
44
+
45
+ def add_metadata_from_resources
46
+ metadata.groups =
47
+ resources_in_capability_statement.flat_map do |resource|
48
+ resource.supportedProfile&.map do |supported_profile|
49
+ next if supported_profile == 'http://hl7.org/fhir/uv/sdc/StructureDefinition/sdc-questionnaire'
50
+ GroupMetadataExtractor.new(resource, supported_profile, metadata, ig_resources).group_metadata
51
+ end
52
+ end.compact
53
+ metadata.postprocess_groups(ig_resources)
54
+ end
55
+ end
56
+ end
57
+ end
@@ -0,0 +1,64 @@
1
+ module DaVinciPlanNetTestKit
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 code_system_by_url(url)
35
+ resources_by_type['CodeSystem'].find { |system| system.url == url }
36
+ end
37
+
38
+ def search_param_by_resource_and_name(resource, name)
39
+ # remove '_' from search parameter name, such as _id or _tag
40
+ normalized_name = normalized_name = name.to_s.delete_prefix('_')
41
+
42
+ if ['family', 'given'].include?(normalized_name) && resource == 'Practitioner'
43
+ normalized_name += '-name'
44
+ end
45
+
46
+ param = resources_by_type['SearchParameter']
47
+ .find { |param| param.id == "#{resource.downcase}-#{normalized_name}" }
48
+
49
+ if param.nil?
50
+ param = resources_by_type['SearchParameter']
51
+ .find { |param| param.id == "Resource-#{normalized_name}" }
52
+ end
53
+
54
+ return param
55
+ end
56
+
57
+ private
58
+
59
+ def resources_by_type
60
+ @resources_by_type ||= Hash.new { |hash, key| hash[key] = [] }
61
+ end
62
+ end
63
+ end
64
+ end