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,34 @@
1
+ module DaVinciPlanNetTestKit
2
+ class Generator
3
+ module Naming
4
+
5
+ class << self
6
+ def resources_with_multiple_profiles
7
+ ['Organization']
8
+ end
9
+
10
+ def resource_has_multiple_profiles?(resource)
11
+ resources_with_multiple_profiles.include? resource
12
+ end
13
+
14
+ def snake_case_for_profile(group_metadata)
15
+ resource = group_metadata.resource
16
+ return "org_affil" if resource == "OrganizationAffiliation"
17
+ return resource.underscore unless resource_has_multiple_profiles?(resource)
18
+
19
+ # Networks and Organizations need to be separated
20
+ case group_metadata.profile_url
21
+ when 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Network'
22
+ return 'network'
23
+ when 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Organization'
24
+ return 'organization'
25
+ end
26
+ end
27
+
28
+ def upper_camel_case_for_profile(group_metadata)
29
+ snake_case_for_profile(group_metadata).camelize
30
+ end
31
+ end
32
+ end
33
+ end
34
+ end
@@ -0,0 +1,86 @@
1
+ require_relative 'naming'
2
+ require_relative 'special_cases'
3
+
4
+ module DaVinciPlanNetTestKit
5
+ class Generator
6
+ class ReadTestGenerator
7
+ class << self
8
+ def generate(ig_metadata, base_output_dir)
9
+ ig_metadata.groups
10
+ .reject { |group| SpecialCases.exclude_group? group }
11
+ .select { |group| read_interaction(group).present? }
12
+ .each { |group| new(group, base_output_dir).generate }
13
+ end
14
+
15
+ def read_interaction(group_metadata)
16
+ group_metadata.interactions.find { |interaction| interaction[:code] == 'read' }
17
+ end
18
+ end
19
+
20
+ attr_accessor :group_metadata, :base_output_dir
21
+
22
+ def initialize(group_metadata, base_output_dir)
23
+ self.group_metadata = group_metadata
24
+ self.base_output_dir = base_output_dir
25
+ end
26
+
27
+ def template
28
+ @template ||= File.read(File.join(__dir__, 'templates', 'read.rb.erb'))
29
+ end
30
+
31
+ def output
32
+ @output ||= ERB.new(template).result(binding)
33
+ end
34
+
35
+ def base_output_file_name
36
+ "#{class_name.underscore}.rb"
37
+ end
38
+
39
+ def output_file_directory
40
+ File.join(base_output_dir, profile_identifier)
41
+ end
42
+
43
+ def output_file_name
44
+ File.join(output_file_directory, base_output_file_name)
45
+ end
46
+
47
+ def read_interaction
48
+ self.class.read_interaction(group_metadata)
49
+ end
50
+
51
+ def profile_identifier
52
+ Naming.snake_case_for_profile(group_metadata)
53
+ end
54
+
55
+ def test_id
56
+ "davinci_plan_net_#{group_metadata.reformatted_version}_#{profile_identifier}_read_test"
57
+ end
58
+
59
+ def class_name
60
+ "#{Naming.upper_camel_case_for_profile(group_metadata)}ReadTest"
61
+ end
62
+
63
+ def module_name
64
+ "DaVinciPlanNet#{group_metadata.reformatted_version.upcase}"
65
+ end
66
+
67
+ def resource_type
68
+ group_metadata.resource
69
+ end
70
+
71
+ def conformance_expectation
72
+ read_interaction[:expectation]
73
+ end
74
+
75
+ def generate
76
+ FileUtils.mkdir_p(output_file_directory)
77
+ File.open(output_file_name, 'w') { |f| f.write(output) }
78
+
79
+ group_metadata.add_test(
80
+ id: test_id,
81
+ file_name: base_output_file_name
82
+ )
83
+ end
84
+ end
85
+ end
86
+ end
@@ -0,0 +1,92 @@
1
+ require_relative 'naming'
2
+ require_relative 'special_cases'
3
+
4
+ module DaVinciPlanNetTestKit
5
+ class Generator
6
+ class ReferenceResolutionTestGenerator
7
+ class << self
8
+ def generate(ig_metadata, base_output_dir)
9
+ ig_metadata.groups
10
+ .reject { |group| SpecialCases.exclude_group? group }
11
+ .each { |group| new(group, base_output_dir).generate }
12
+ end
13
+ end
14
+
15
+ attr_accessor :group_metadata, :base_output_dir
16
+
17
+ def initialize(group_metadata, base_output_dir)
18
+ self.group_metadata = group_metadata
19
+ self.base_output_dir = base_output_dir
20
+ end
21
+
22
+ def template
23
+ @template ||= File.read(File.join(__dir__, 'templates', 'reference_resolution.rb.erb'))
24
+ end
25
+
26
+ def output
27
+ @output ||= ERB.new(template).result(binding)
28
+ end
29
+
30
+ def base_output_file_name
31
+ "#{class_name.underscore}.rb"
32
+ end
33
+
34
+ def output_file_directory
35
+ File.join(base_output_dir, profile_identifier)
36
+ end
37
+
38
+ def output_file_name
39
+ File.join(output_file_directory, base_output_file_name)
40
+ end
41
+
42
+ def profile_identifier
43
+ Naming.snake_case_for_profile(group_metadata)
44
+ end
45
+
46
+ def test_id
47
+ "davinci_plan_net_#{group_metadata.reformatted_version}_#{profile_identifier}_reference_resolution_test"
48
+ end
49
+
50
+ def class_name
51
+ "#{Naming.upper_camel_case_for_profile(group_metadata)}ReferenceResolutionTest"
52
+ end
53
+
54
+ def module_name
55
+ "DaVinciPlanNet#{group_metadata.reformatted_version.upcase}"
56
+ end
57
+
58
+ def resource_type
59
+ group_metadata.resource
60
+ end
61
+
62
+ def resource_collection_string
63
+ 'scratch_resources[:all]'
64
+ end
65
+
66
+ def must_support_references
67
+ group_metadata.must_supports[:elements]
68
+ .select { |element| element[:types]&.include?('Reference') }
69
+ end
70
+
71
+ def must_support_reference_list_string
72
+ must_support_references
73
+ .map { |element| "#{' ' * 8}* #{resource_type}.#{element[:path]}" }
74
+ .uniq
75
+ .sort
76
+ .join("\n")
77
+ end
78
+
79
+ def generate
80
+ return if must_support_references.empty?
81
+
82
+ FileUtils.mkdir_p(output_file_directory)
83
+ File.open(output_file_name, 'w') { |f| f.write(output) }
84
+
85
+ group_metadata.add_test(
86
+ id: test_id,
87
+ file_name: base_output_file_name
88
+ )
89
+ end
90
+ end
91
+ end
92
+ end
@@ -0,0 +1,42 @@
1
+ module DaVinciPlanNetTestKit
2
+ class Generator
3
+ class ResourceListGenerator
4
+ class << self
5
+ def generate(ig_metadata, base_output_dir)
6
+ @ig_metadata = ig_metadata
7
+
8
+ FileUtils.mkdir_p(base_output_dir)
9
+ File.open(File.join(base_output_dir, base_output_file_name), 'w') { |f| f.write(output) }
10
+ end
11
+
12
+ def resource_list
13
+ @ig_metadata.groups.map(&:resource).uniq
14
+ end
15
+
16
+ def resource_list_string
17
+ resource_list.map { |resource| " '#{resource}'" }.join(",\n")
18
+ end
19
+
20
+ def module_name
21
+ "DaVinciPlanNet#{@ig_metadata.reformatted_version.upcase}"
22
+ end
23
+
24
+ def read_interaction(group_metadata)
25
+ group_metadata.interactions.find { |interaction| interaction[:code] == 'read' }
26
+ end
27
+
28
+ def template
29
+ @template ||= File.read(File.join(__dir__, 'templates', 'resource_list.rb.erb'))
30
+ end
31
+
32
+ def output
33
+ ERB.new(template).result(binding)
34
+ end
35
+
36
+ def base_output_file_name
37
+ "resource_list.rb"
38
+ end
39
+ end
40
+ end
41
+ end
42
+ end
@@ -0,0 +1,194 @@
1
+ require_relative 'naming'
2
+ require_relative 'special_cases'
3
+
4
+ module DaVinciPlanNetTestKit
5
+ class Generator
6
+ class ReverseChainSearchTestGenerator
7
+ class << self
8
+ def generate(ig_metadata, examples_hash, base_output_dir)
9
+ examples_hash.keys.each do |group|
10
+ examples_hash[group].each do |rev_chain_example|
11
+ group_to_add_to = ig_metadata.groups.find { |ig_meta_group| ig_meta_group.name == "plannet_#{group}"}
12
+ new(group_to_add_to, group_to_add_to.searches.first, base_output_dir, rev_chain_example).generate
13
+ end
14
+ end
15
+ end
16
+ end
17
+
18
+ attr_accessor :group_metadata, :search_metadata, :base_output_dir, :source_resource, :target_param, :constraining_param
19
+
20
+ def initialize(group_metadata, search_metadata, base_output_dir, rev_chain_example)
21
+ self.group_metadata = group_metadata
22
+ self.search_metadata = search_metadata
23
+ self.base_output_dir = base_output_dir
24
+ self.source_resource = rev_chain_example["source_resource"]
25
+ self.target_param = rev_chain_example["target_param"]
26
+ self.constraining_param = rev_chain_example["constraining_param"]
27
+ end
28
+
29
+ def template
30
+ @template ||= File.read(File.join(__dir__, 'templates', 'reverse_chain_search.rb.erb'))
31
+ end
32
+
33
+ def output
34
+ @output ||= ERB.new(template).result(binding)
35
+ end
36
+
37
+ def base_output_file_name
38
+ "#{class_name.underscore}.rb"
39
+ end
40
+
41
+ def output_file_directory
42
+ File.join(base_output_dir, profile_identifier.downcase)
43
+ end
44
+
45
+ def output_file_name
46
+ File.join(output_file_directory, base_output_file_name)
47
+ end
48
+
49
+ def profile_identifier
50
+ Naming.snake_case_for_profile(group_metadata)
51
+ end
52
+
53
+ def test_id
54
+ "davinci_plan_net_#{group_metadata.reformatted_version}_#{profile_identifier}_reverse_chain_#{search_identifier}_search_test"
55
+ end
56
+
57
+ def search_identifier
58
+ "#{source_resource}_#{target_param}_#{constraining_param}".gsub(/[-:]/, '_').underscore.gsub("organization_affiliation", "org_affil")
59
+ end
60
+
61
+ def search_title
62
+ search_identifier.camelize
63
+ end
64
+
65
+ def class_name
66
+ "#{Naming.upper_camel_case_for_profile(group_metadata)}ReverseChain#{search_title}SearchTest"
67
+ end
68
+
69
+ def module_name
70
+ "DaVinciPlanNet#{group_metadata.reformatted_version.upcase}"
71
+ end
72
+
73
+ def resource_type
74
+ group_metadata.resource
75
+ end
76
+
77
+ def search_params
78
+ @search_params ||=
79
+ search_metadata[:names].map do |name|
80
+ {
81
+ name: name,
82
+ path: search_definition(name)[:path]
83
+ }
84
+ end
85
+ end
86
+
87
+ def first_search?
88
+ group_metadata.searches.first == search_metadata
89
+ end
90
+
91
+ def fixed_value_search?
92
+ #TODO
93
+ false
94
+ end
95
+
96
+ def fixed_value_search_param_name
97
+ #TODO
98
+ end
99
+
100
+ def a_or_an(name)
101
+ ['a','e','i','o','u'].include?(name.first.downcase) ? "an #{name}" : "a #{name}"
102
+ end
103
+
104
+ def search_param_names
105
+ search_params.map { |param| param[:name] }
106
+ end
107
+
108
+ def search_param_names_array
109
+ array_of_strings(search_param_names)
110
+ end
111
+
112
+ def path_for_value(path)
113
+ path == 'class' ? 'local_class' : path
114
+ end
115
+
116
+ def required_comparators_for_param(name)
117
+ search_definition(name)[:comparators].select { |_comparator, expectation| expectation == 'SHALL' }
118
+ end
119
+
120
+ def required_comparators
121
+ @required_comparators ||=
122
+ search_param_names.each_with_object({}) do |name, comparators|
123
+ required_comparators = required_comparators_for_param(name)
124
+ comparators[name] = required_comparators if required_comparators.present?
125
+ end
126
+ end
127
+
128
+ def search_definition(name)
129
+ group_metadata.search_definitions[name.to_sym]
130
+ end
131
+
132
+ def saves_delayed_references?
133
+ first_search? && group_metadata.delayed_references.present?
134
+ end
135
+
136
+ def possible_status_search?
137
+ !search_metadata[:names].include?('status') && group_metadata.search_definitions.key?(:status)
138
+ end
139
+
140
+ def token_search_params
141
+ @token_search_params ||=
142
+ search_param_names.select do |name|
143
+ ['Identifier', 'CodeableConcept', 'Coding'].include? group_metadata.search_definitions[name.to_sym][:type]
144
+ end
145
+ end
146
+
147
+ def token_search_params_string
148
+ array_of_strings(token_search_params)
149
+ end
150
+
151
+ def required_comparators_string
152
+ array_of_strings(required_comparators.keys)
153
+ end
154
+
155
+ def array_of_strings(array)
156
+ quoted_strings = array.map { |element| "'#{element}'" }
157
+ "[#{quoted_strings.join(', ')}]"
158
+ end
159
+
160
+ def input_name
161
+ "#{search_identifier}_input"
162
+ end
163
+
164
+ def search_properties
165
+ {}.tap do |properties|
166
+ properties[:fixed_value_search] = 'true' if fixed_value_search?
167
+ properties[:resource_type] = "'#{resource_type}'"
168
+ properties[:search_param_names] = []
169
+ properties[:input_name] = "'#{input_name}'"
170
+ properties[:reverse_chain_param] = "'#{constraining_param}'"
171
+ properties[:reverse_chain_target] = "'#{target_param}'"
172
+ properties[:possible_status_search] = 'true' if possible_status_search?
173
+ properties[:additional_resource_type] = "'#{source_resource}'"
174
+ end
175
+ end
176
+
177
+ def search_test_properties_string
178
+ search_properties
179
+ .map { |key, value| "#{' ' * 10}#{key}: #{value}" }
180
+ .join(",\n")
181
+ end
182
+
183
+ def generate
184
+ FileUtils.mkdir_p(output_file_directory)
185
+ File.open(output_file_name, 'w') { |f| f.write(output) }
186
+
187
+ group_metadata.add_test(
188
+ id: test_id,
189
+ file_name: base_output_file_name
190
+ )
191
+ end
192
+ end
193
+ end
194
+ end
@@ -0,0 +1,204 @@
1
+ require_relative 'naming'
2
+ require_relative 'special_cases'
3
+
4
+ module DaVinciPlanNetTestKit
5
+ class Generator
6
+ class RevincludeSearchTestGenerator
7
+ class << self
8
+ def generate(ig_metadata, base_output_dir)
9
+ ig_metadata.groups
10
+ .reject { |group| SpecialCases.exclude_group? group }
11
+ .select { |group| !group.revincludes.empty? }
12
+ .each do |group|
13
+ group.revincludes.each { |revinclude| new(group, group.searches.first, base_output_dir, revinclude).generate }
14
+ end
15
+ end
16
+ end
17
+
18
+ attr_accessor :group_metadata, :search_metadata, :base_output_dir, :revinclude_param
19
+
20
+ def initialize(group_metadata, search_metadata, base_output_dir, revinclude_param)
21
+ self.group_metadata = group_metadata
22
+ self.search_metadata = search_metadata
23
+ self.base_output_dir = base_output_dir
24
+ self.revinclude_param = revinclude_param
25
+ end
26
+
27
+ def template
28
+ @template ||= File.read(File.join(__dir__, 'templates', 'revinclude_search.rb.erb'))
29
+ end
30
+
31
+ def output
32
+ @output ||= ERB.new(template).result(binding)
33
+ end
34
+
35
+ def base_output_file_name
36
+ "#{class_name.underscore}.rb"
37
+ end
38
+
39
+ def output_file_directory
40
+ File.join(base_output_dir, profile_identifier.downcase)
41
+ end
42
+
43
+ def output_file_name
44
+ File.join(output_file_directory, base_output_file_name)
45
+ end
46
+
47
+ def profile_identifier
48
+ Naming.snake_case_for_profile(group_metadata)
49
+ end
50
+
51
+ def test_id
52
+ "davinci_plan_net_#{group_metadata.reformatted_version}_revinclude_#{profile_identifier}_#{search_identifier}_search_test"
53
+ end
54
+
55
+ def search_identifier
56
+ revinclude_param.gsub(/[-:]/, '_').underscore
57
+ end
58
+
59
+ def search_title
60
+ search_identifier.camelize
61
+ end
62
+
63
+ def class_name
64
+ "#{Naming.upper_camel_case_for_profile(group_metadata)}Revinclude#{search_title}SearchTest"
65
+ end
66
+
67
+ def module_name
68
+ "DaVinciPlanNet#{group_metadata.reformatted_version.upcase}"
69
+ end
70
+
71
+ def resource_type
72
+ group_metadata.resource
73
+ end
74
+
75
+ def search_params
76
+ @search_params ||=
77
+ search_metadata[:names].map do |name|
78
+ {
79
+ name: name,
80
+ path: search_definition(name)[:path]
81
+ }
82
+ end
83
+ end
84
+
85
+ def first_search?
86
+ group_metadata.searches.first == search_metadata
87
+ end
88
+
89
+ def fixed_value_search?
90
+ #TODO
91
+ false
92
+ end
93
+
94
+ def fixed_value_search_param_name
95
+ #TODO
96
+ end
97
+
98
+ def revinclude_param_string
99
+ "_revinclude=#{revinclude_param}"
100
+ end
101
+
102
+ def revinclude_param_resource
103
+ revinclude_param.split(/:/)[0]
104
+ end
105
+
106
+ def rev_param_sp
107
+ revinclude_param.split(/:/)[1]
108
+ end
109
+
110
+ def search_param_names
111
+ search_params.map { |param| param[:name] }
112
+ end
113
+
114
+ def search_param_names_array
115
+ array_of_strings(search_param_names)
116
+ end
117
+
118
+ def path_for_value(path)
119
+ path == 'class' ? 'local_class' : path
120
+ end
121
+
122
+ def required_comparators_for_param(name)
123
+ search_definition(name)[:comparators].select { |_comparator, expectation| expectation == 'SHALL' }
124
+ end
125
+
126
+ def required_comparators
127
+ @required_comparators ||=
128
+ search_param_names.each_with_object({}) do |name, comparators|
129
+ required_comparators = required_comparators_for_param(name)
130
+ comparators[name] = required_comparators if required_comparators.present?
131
+ end
132
+ end
133
+
134
+ def search_definition(name)
135
+ group_metadata.search_definitions[name.to_sym]
136
+ end
137
+
138
+ def saves_delayed_references?
139
+ first_search? && group_metadata.delayed_references.present?
140
+ end
141
+
142
+ def possible_status_search?
143
+ !search_metadata[:names].include?('status') && group_metadata.search_definitions.key?(:status)
144
+ end
145
+
146
+ def token_search_params
147
+ @token_search_params ||=
148
+ search_param_names.select do |name|
149
+ ['Identifier', 'CodeableConcept', 'Coding'].include? group_metadata.search_definitions[name.to_sym][:type]
150
+ end
151
+ end
152
+
153
+ def token_search_params_string
154
+ array_of_strings(token_search_params)
155
+ end
156
+
157
+ def required_comparators_string
158
+ array_of_strings(required_comparators.keys)
159
+ end
160
+
161
+ def array_of_strings(array)
162
+ quoted_strings = array.map { |element| "'#{element}'" }
163
+ "[#{quoted_strings.join(', ')}]"
164
+ end
165
+
166
+ def a_or_an(name)
167
+ ['a','e','i','o','u'].include?(name.first.downcase) ? "an #{name}" : "a #{name}"
168
+ end
169
+
170
+ def input_name
171
+ "#{search_identifier}_input"
172
+ end
173
+
174
+ def search_properties
175
+ {}.tap do |properties|
176
+ properties[:fixed_value_search] = 'true' if fixed_value_search?
177
+ properties[:resource_type] = "'#{resource_type}'"
178
+ properties[:search_param_names] = []
179
+ properties[:input_name] = "'#{input_name}'"
180
+ properties[:possible_status_search] = 'true' if possible_status_search?
181
+ properties[:revinclude_param] = "'#{revinclude_param}'"
182
+ properties[:rev_param_sp] = "'#{rev_param_sp}'"
183
+ properties[:additional_resource_type] = "'#{revinclude_param_resource}'"
184
+ end
185
+ end
186
+
187
+ def search_test_properties_string
188
+ search_properties
189
+ .map { |key, value| "#{' ' * 10}#{key}: #{value}" }
190
+ .join(",\n")
191
+ end
192
+
193
+ def generate
194
+ FileUtils.mkdir_p(output_file_directory)
195
+ File.open(output_file_name, 'w') { |f| f.write(output) }
196
+
197
+ group_metadata.add_test(
198
+ id: test_id,
199
+ file_name: base_output_file_name
200
+ )
201
+ end
202
+ end
203
+ end
204
+ end