cancer_registry_reporting_test_kit 0.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (262) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE +201 -0
  3. data/config/presets/hdea_report_preset.json +14 -0
  4. data/config/presets/inferno_reference_server_preset.json.erb +84 -0
  5. data/lib/cancer_registry_reporting_test_kit/bundle_parse.rb +161 -0
  6. data/lib/cancer_registry_reporting_test_kit/docs/ehr_suite_description.md +134 -0
  7. data/lib/cancer_registry_reporting_test_kit/docs/hdea_suite_description.md +108 -0
  8. data/lib/cancer_registry_reporting_test_kit/ehr_suite/ehr_capability_statement/mcode_capability_statement_profile_support.rb +40 -0
  9. data/lib/cancer_registry_reporting_test_kit/ehr_suite/ehr_data_access_group.rb +131 -0
  10. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/medication_administration_must_support_test.rb +43 -0
  11. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/medication_administration_search_test.rb +51 -0
  12. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/medication_administration_validation_test.rb +41 -0
  13. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/metadata.yml +72 -0
  14. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration_group.rb +72 -0
  15. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/medication_request_must_support_test.rb +55 -0
  16. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/medication_request_search_test.rb +55 -0
  17. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/medication_request_validation_test.rb +38 -0
  18. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/metadata.yml +94 -0
  19. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request_group.rb +73 -0
  20. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_cancer_condition_group.rb +73 -0
  21. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/metadata.yml +100 -0
  22. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/primary_cancer_condition_must_support_test.rb +50 -0
  23. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/primary_cancer_condition_search_test.rb +70 -0
  24. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/primary_cancer_condition_validation_test.rb +39 -0
  25. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/metadata.yml +99 -0
  26. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/radiotherapy_procedure_must_support_test.rb +46 -0
  27. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/radiotherapy_procedure_search_test.rb +51 -0
  28. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/radiotherapy_procedure_validation_test.rb +37 -0
  29. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure_group.rb +83 -0
  30. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_cancer_condition_group.rb +68 -0
  31. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/metadata.yml +102 -0
  32. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/secondary_cancer_condition_must_support_test.rb +50 -0
  33. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/secondary_cancer_condition_search_test.rb +70 -0
  34. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/secondary_cancer_condition_validation_test.rb +39 -0
  35. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_distant_metastases_category/metadata.yml +65 -0
  36. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_distant_metastases_category/tnm_distant_metastases_category_must_support_test.rb +44 -0
  37. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_distant_metastases_category/tnm_distant_metastases_category_search_test.rb +69 -0
  38. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_distant_metastases_category/tnm_distant_metastases_category_validation_test.rb +39 -0
  39. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_distant_metastases_category_group.rb +74 -0
  40. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_primary_tumor_category/metadata.yml +64 -0
  41. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_primary_tumor_category/tnm_primary_tumor_category_must_support_test.rb +44 -0
  42. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_primary_tumor_category/tnm_primary_tumor_category_search_test.rb +69 -0
  43. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_primary_tumor_category/tnm_primary_tumor_category_validation_test.rb +39 -0
  44. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_primary_tumor_category_group.rb +73 -0
  45. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_regional_nodes_category/metadata.yml +64 -0
  46. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_regional_nodes_category/tnm_regional_nodes_category_must_support_test.rb +44 -0
  47. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_regional_nodes_category/tnm_regional_nodes_category_search_test.rb +69 -0
  48. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_regional_nodes_category/tnm_regional_nodes_category_validation_test.rb +39 -0
  49. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_regional_nodes_category_group.rb +73 -0
  50. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group/metadata.yml +68 -0
  51. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group/tnm_stage_group_must_support_test.rb +45 -0
  52. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group/tnm_stage_group_search_test.rb +69 -0
  53. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group/tnm_stage_group_validation_test.rb +39 -0
  54. data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group_group.rb +72 -0
  55. data/lib/cancer_registry_reporting_test_kit/ehr_suite.rb +69 -0
  56. data/lib/cancer_registry_reporting_test_kit/fhir_resource_navigation.rb +174 -0
  57. data/lib/cancer_registry_reporting_test_kit/hdea_generator/group_generator.rb +47 -0
  58. data/lib/cancer_registry_reporting_test_kit/hdea_generator/group_metadata.rb +86 -0
  59. data/lib/cancer_registry_reporting_test_kit/hdea_generator/group_metadata_extractor.rb +205 -0
  60. data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_loader.rb +78 -0
  61. data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_metadata.rb +26 -0
  62. data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_metadata_extractor.rb +78 -0
  63. data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_resources.rb +56 -0
  64. data/lib/cancer_registry_reporting_test_kit/hdea_generator/must_support_metadata_extractor.rb +399 -0
  65. data/lib/cancer_registry_reporting_test_kit/hdea_generator/must_support_test_generator.rb +134 -0
  66. data/lib/cancer_registry_reporting_test_kit/hdea_generator/naming.rb +168 -0
  67. data/lib/cancer_registry_reporting_test_kit/hdea_generator/special_cases.rb +43 -0
  68. data/lib/cancer_registry_reporting_test_kit/hdea_generator/templates/must_support.rb.erb +41 -0
  69. data/lib/cancer_registry_reporting_test_kit/hdea_generator/templates/validation.rb.erb +35 -0
  70. data/lib/cancer_registry_reporting_test_kit/hdea_generator/terminology_binding_metadata_extractor.rb +118 -0
  71. data/lib/cancer_registry_reporting_test_kit/hdea_generator/validation_test_generator.rb +125 -0
  72. data/lib/cancer_registry_reporting_test_kit/hdea_generator/value_extractor.rb +134 -0
  73. data/lib/cancer_registry_reporting_test_kit/hdea_generator.rb +66 -0
  74. data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/author_validation_test.rb +61 -0
  75. data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/organization_metadata.yml +47 -0
  76. data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/organization_must_support_test.rb +73 -0
  77. data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_metadata.yml +51 -0
  78. data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_must_support_test.rb +73 -0
  79. data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_role_metadata.yml +48 -0
  80. data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_role_must_support_test.rb +66 -0
  81. data/lib/cancer_registry_reporting_test_kit/hdea_suite/bundle_resources_group.rb +213 -0
  82. data/lib/cancer_registry_reporting_test_kit/hdea_suite/ccrr_content_bundle_parse_and_validation_test.rb +67 -0
  83. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/allergy_intolerance/allergy_intolerance_must_support_test.rb +46 -0
  84. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/allergy_intolerance/allergy_intolerance_validation_test.rb +35 -0
  85. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/allergy_intolerance/metadata.yml +36 -0
  86. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/care_plan/care_plan_must_support_test.rb +48 -0
  87. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/care_plan/care_plan_validation_test.rb +35 -0
  88. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/care_plan/metadata.yml +50 -0
  89. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/ccrr_content_bundle/ccrr_content_bundle_must_support_test.rb +43 -0
  90. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/ccrr_content_bundle/metadata.yml +36 -0
  91. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/central_cancer_registry_primary_cancer_condition/central_cancer_registry_primary_cancer_condition_must_support_test.rb +59 -0
  92. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/central_cancer_registry_primary_cancer_condition/central_cancer_registry_primary_cancer_condition_validation_test.rb +35 -0
  93. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/central_cancer_registry_primary_cancer_condition/metadata.yml +86 -0
  94. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/composition/composition_must_support_test.rb +109 -0
  95. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/composition/composition_validation_test.rb +35 -0
  96. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/composition/metadata.yml +272 -0
  97. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/condition/condition_must_support_test.rb +45 -0
  98. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/condition/condition_validation_test.rb +35 -0
  99. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/condition/metadata.yml +33 -0
  100. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_lab/diagnostic_report_lab_must_support_test.rb +49 -0
  101. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_lab/diagnostic_report_lab_validation_test.rb +35 -0
  102. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_lab/metadata.yml +57 -0
  103. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_note/diagnostic_report_note_must_support_test.rb +53 -0
  104. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_note/diagnostic_report_note_validation_test.rb +35 -0
  105. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_note/metadata.yml +75 -0
  106. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/document_reference/document_reference_must_support_test.rb +57 -0
  107. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/document_reference/document_reference_validation_test.rb +35 -0
  108. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/document_reference/metadata.yml +68 -0
  109. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/encounter/encounter_must_support_test.rb +59 -0
  110. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/encounter/encounter_validation_test.rb +35 -0
  111. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/encounter/metadata.yml +73 -0
  112. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_radiotherapy_course_summary/mcode_radiotherapy_course_summary_must_support_test.rb +52 -0
  113. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_radiotherapy_course_summary/mcode_radiotherapy_course_summary_validation_test.rb +35 -0
  114. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_radiotherapy_course_summary/metadata.yml +59 -0
  115. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_secondary_cancer_condition/mcode_secondary_cancer_condition_must_support_test.rb +56 -0
  116. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_secondary_cancer_condition/mcode_secondary_cancer_condition_validation_test.rb +35 -0
  117. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_secondary_cancer_condition/metadata.yml +77 -0
  118. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_tnm_stage_group/mcode_tnm_stage_group_must_support_test.rb +48 -0
  119. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_tnm_stage_group/mcode_tnm_stage_group_validation_test.rb +35 -0
  120. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_tnm_stage_group/metadata.yml +46 -0
  121. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication/medication_must_support_test.rb +41 -0
  122. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication/medication_validation_test.rb +35 -0
  123. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication/metadata.yml +26 -0
  124. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_administration/medication_administration_must_support_test.rb +48 -0
  125. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_administration/medication_administration_validation_test.rb +35 -0
  126. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_administration/metadata.yml +48 -0
  127. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_request/medication_request_must_support_test.rb +57 -0
  128. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_request/medication_request_validation_test.rb +35 -0
  129. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_request/metadata.yml +86 -0
  130. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_statement/medication_statement_must_support_test.rb +41 -0
  131. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_statement/medication_statement_validation_test.rb +35 -0
  132. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_statement/metadata.yml +26 -0
  133. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation/metadata.yml +26 -0
  134. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation/observation_must_support_test.rb +41 -0
  135. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation/observation_validation_test.rb +35 -0
  136. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation_lab/metadata.yml +53 -0
  137. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation_lab/observation_lab_must_support_test.rb +50 -0
  138. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation_lab/observation_lab_validation_test.rb +35 -0
  139. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/odh_usual_work/metadata.yml +81 -0
  140. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/odh_usual_work/odh_usual_work_must_support_test.rb +49 -0
  141. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/odh_usual_work/odh_usual_work_validation_test.rb +35 -0
  142. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/organization/metadata.yml +46 -0
  143. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/organization/organization_must_support_test.rb +55 -0
  144. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/organization/organization_validation_test.rb +35 -0
  145. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/patient/metadata.yml +51 -0
  146. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/patient/patient_must_support_test.rb +58 -0
  147. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/patient/patient_validation_test.rb +35 -0
  148. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner/metadata.yml +50 -0
  149. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner/practitioner_must_support_test.rb +55 -0
  150. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner/practitioner_validation_test.rb +35 -0
  151. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner_role/metadata.yml +47 -0
  152. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner_role/practitioner_role_must_support_test.rb +49 -0
  153. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner_role/practitioner_role_validation_test.rb +35 -0
  154. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/procedure/metadata.yml +37 -0
  155. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/procedure/procedure_must_support_test.rb +44 -0
  156. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/procedure/procedure_validation_test.rb +35 -0
  157. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/service_request/metadata.yml +26 -0
  158. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/service_request/service_request_must_support_test.rb +41 -0
  159. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/service_request/service_request_validation_test.rb +35 -0
  160. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/smokingstatus/metadata.yml +58 -0
  161. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/smokingstatus/smokingstatus_must_support_test.rb +47 -0
  162. data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/smokingstatus/smokingstatus_validation_test.rb +35 -0
  163. data/lib/cancer_registry_reporting_test_kit/hdea_suite.rb +80 -0
  164. data/lib/cancer_registry_reporting_test_kit/igs/README.md +21 -0
  165. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-cancer-related-medication-administration.json +1905 -0
  166. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-cancer-related-medication-request.json +3611 -0
  167. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-primary-cancer-condition.json +2246 -0
  168. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-radiotherapy-course-summary.json +2700 -0
  169. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-secondary-cancer-condition.json +2419 -0
  170. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-distant-metastases-category.json +2320 -0
  171. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-primary-tumor-category.json +2320 -0
  172. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-regional-nodes-category.json +2320 -0
  173. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-stage-group.json +2414 -0
  174. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-medicationstatement.profile.json +1578 -0
  175. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-observation.profile.json +3510 -0
  176. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-odh-UsualWork.json +7248 -0
  177. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-servicerequest.profile.json +3048 -0
  178. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-allergyintolerance.json +1842 -0
  179. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-careplan.json +1 -0
  180. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-condition.json +2154 -0
  181. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-diagnosticreport-lab.json +2002 -0
  182. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-diagnosticreport-note.json +2049 -0
  183. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-documentreference.json +1 -0
  184. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-encounter.json +1 -0
  185. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-medication.json +1 -0
  186. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-observation-lab.json +3153 -0
  187. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-organization.json +1 -0
  188. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-patient.json +1 -0
  189. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-practitioner.json +1 -0
  190. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-practitionerrole.json +1 -0
  191. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-procedure.json +1 -0
  192. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-smokingstatus.json +1 -0
  193. data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100.tgz +0 -0
  194. data/lib/cancer_registry_reporting_test_kit/igs/package/.index.db +0 -0
  195. data/lib/cancer_registry_reporting_test_kit/igs/package/.index.json +4 -0
  196. data/lib/cancer_registry_reporting_test_kit/igs/package/CapabilityStatement-central-cancer-registry-reporting-ehr.json +1 -0
  197. data/lib/cancer_registry_reporting_test_kit/igs/package/ImplementationGuide-hl7.fhir.us.central-cancer-registry-reporting.json +1 -0
  198. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-cancer-encounter.json +1 -0
  199. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-cancer-patient.json +1 -0
  200. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-composition.json +1 -0
  201. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-content-bundle.json +1 -0
  202. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-plandefinition.json +1 -0
  203. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-reporting-bundle.json +1 -0
  204. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-central-cancer-registry-primary-cancer-condition.json +1 -0
  205. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-central-cancer-registry-reporting-messageheader.json +1 -0
  206. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-us-ph-patient.json +1 -0
  207. data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-us-ph-tribal-affiliation-extension.json +1 -0
  208. data/lib/cancer_registry_reporting_test_kit/igs/package/ValueSet-cancer-core-reportability-codes.json +1 -0
  209. data/lib/cancer_registry_reporting_test_kit/igs/package/example/AllergyIntolerance-example.json +1 -0
  210. data/lib/cancer_registry_reporting_test_kit/igs/package/example/BodyStructure-jenny-m-chest-wall-lymph-nodes-treatment-volume.json +1 -0
  211. data/lib/cancer_registry_reporting_test_kit/igs/package/example/BodyStructure-jenny-m-chest-wall-treatment-volume.json +1 -0
  212. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Bundle-ccrr-content-bundle-example.json +1 -0
  213. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Bundle-central-cancer-registry-reporting-specification-bundle-example.json +1 -0
  214. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Bundle-reporting-bundle-example.json +1 -0
  215. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Composition-ccrr-composition-example.json +1 -0
  216. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Condition-primary-cancer-condition-breast.json +1 -0
  217. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Encounter-encounter-cancer-example.json +1 -0
  218. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Endpoint-example-healthcare-endpoint.json +1 -0
  219. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Endpoint-example-ph-endpoint.json +1 -0
  220. data/lib/cancer_registry_reporting_test_kit/igs/package/example/MedicationAdministration-cancer-related-medication-administration-example.json +1 -0
  221. data/lib/cancer_registry_reporting_test_kit/igs/package/example/MessageHeader-messageheader-example-reportheader.json +1 -0
  222. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-cancer-stage-group-example.json +1 -0
  223. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-tnm-clinical-distant-metastases-category-cM0.json +1 -0
  224. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-tnm-clinical-primary-tumor-category-cT3.json +1 -0
  225. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-tnm-clinical-regional-nodes-category-cN3.json +1 -0
  226. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Organization-example-healthcare-org.json +1 -0
  227. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Organization-example-pha-org.json +1 -0
  228. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Patient-example.json +1 -0
  229. data/lib/cancer_registry_reporting_test_kit/igs/package/example/PlanDefinition-plandefinition-central-cancer-registry-reporting-example.json +1 -0
  230. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Practitioner-1.json +1 -0
  231. data/lib/cancer_registry_reporting_test_kit/igs/package/example/Procedure-radiotherapy-example.json +1 -0
  232. data/lib/cancer_registry_reporting_test_kit/igs/package/openapi/central-cancer-registry-reporting-ehr.openapi.json +364 -0
  233. data/lib/cancer_registry_reporting_test_kit/igs/package/other/ig-r4.jsonX +1 -0
  234. data/lib/cancer_registry_reporting_test_kit/igs/package/other/spec.internals +293 -0
  235. data/lib/cancer_registry_reporting_test_kit/igs/package/other/validation-oo.json +1 -0
  236. data/lib/cancer_registry_reporting_test_kit/igs/package/other/validation-summary.json +1 -0
  237. data/lib/cancer_registry_reporting_test_kit/igs/package/package.json +30 -0
  238. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-cancer-encounter.sch +19 -0
  239. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-cancer-patient.sch +175 -0
  240. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-composition.sch +61 -0
  241. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-content-bundle.sch +12 -0
  242. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-plandefinition.sch +331 -0
  243. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-reporting-bundle.sch +12 -0
  244. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-central-cancer-registry-primary-cancer-condition.sch +31 -0
  245. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-central-cancer-registry-reporting-messageheader.sch +27 -0
  246. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-us-ph-patient.sch +217 -0
  247. data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-us-ph-tribal-affiliation-extension.sch +36 -0
  248. data/lib/cancer_registry_reporting_test_kit/metadata.rb +71 -0
  249. data/lib/cancer_registry_reporting_test_kit/must_support_test.rb +263 -0
  250. data/lib/cancer_registry_reporting_test_kit/primitive_type.rb +7 -0
  251. data/lib/cancer_registry_reporting_test_kit/requirements/cancer-registry-reporting-test-kit_out_of_scope_requirements.csv +77 -0
  252. data/lib/cancer_registry_reporting_test_kit/requirements/cancer-registry-reporting-test-kit_requirements.csv +162 -0
  253. data/lib/cancer_registry_reporting_test_kit/requirements/generated/cancer-registry-reporting-test-kit_requirements_coverage.csv +161 -0
  254. data/lib/cancer_registry_reporting_test_kit/search_test.rb +897 -0
  255. data/lib/cancer_registry_reporting_test_kit/search_test_properties.rb +58 -0
  256. data/lib/cancer_registry_reporting_test_kit/validation_test.rb +68 -0
  257. data/lib/cancer_registry_reporting_test_kit/version.rb +6 -0
  258. data/lib/cancer_registry_reporting_test_kit.rb +6 -0
  259. data/lib/inferno_requirements_tools/ext/inferno_core/runnable.rb +22 -0
  260. data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +284 -0
  261. data/lib/requirements_config.yaml +22 -0
  262. metadata +341 -0
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../search_test'
4
+ require_relative '../../../hdea_generator/group_metadata'
5
+
6
+ module CancerRegistryReportingTestKit
7
+ class TNMPrimaryTumorCategorySearchTest < Inferno::Test
8
+ include CancerRegistryReportingTestKit::SearchTest
9
+
10
+ title 'Server returns valid results for Observation search by patient + code'
11
+ description %(
12
+ A server SHALL support searching by
13
+ patient + code on the Observation resource. This test
14
+ will pass if resources are returned and match the search criteria. If
15
+ none are returned, the test is skipped.
16
+
17
+ Because this is the first search of the sequence, resources in the
18
+ response will be used for subsequent tests.
19
+
20
+ Additionally, this test will check that GET and POST search methods
21
+ return the same number of results.
22
+ )
23
+
24
+ id :ccrr_tnm_primary_tumor_category_search_test
25
+ input :patient_ids,
26
+ title: 'Patient IDs',
27
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
28
+
29
+ input :tnm_primary_tumor_category_code,
30
+ title: 'TNM Primary Tumor Category code',
31
+ description: %(
32
+ `Observation.code` value that distinguishes TNM Primary Tumor Category instances from other
33
+ Observations. Used as a search parameter value when searching for Observation instances to
34
+ check for conformance to the TNM Primary Tumor Category Observation profile.
35
+ ),
36
+ optional: true
37
+
38
+ def self.properties
39
+ @properties ||= CancerRegistryReportingTestKit::SearchTestProperties.new(
40
+ first_search: true,
41
+ fixed_value_search: false,
42
+ resource_type: 'Observation',
43
+ search_param_names: %w[patient code],
44
+ possible_status_search: true,
45
+ token_search_params: ['code'],
46
+ test_reference_variants: true,
47
+ test_post_search: false
48
+ )
49
+ end
50
+
51
+ def self.metadata
52
+ @metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
53
+ end
54
+
55
+ def scratch_resources
56
+ scratch[:tnm_primary_tumor_category_resources] ||= {}
57
+ end
58
+
59
+ run do
60
+ skip_if tnm_primary_tumor_category_code.blank?,
61
+ 'Provide a code search value for TNM Primary Tumor Categories in the ' \
62
+ '**TNM Primary Tumor Category code** input to run these tests.'
63
+
64
+ # manual params must be in the same order as the param names
65
+ @manual_search_params = [tnm_primary_tumor_category_code]
66
+ run_search_test
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../validation_test'
4
+
5
+ module CancerRegistryReportingTestKit
6
+ class TNMPrimaryTumorCategoryValidationTest < Inferno::Test
7
+ include CancerRegistryReportingTestKit::ValidationTest
8
+
9
+ id :ccrr_tnm_primary_tumor_category_validation_test
10
+ title 'Observation resources returned during previous tests conform to the TNM Primary Tumor Category profile'
11
+ description %(
12
+ This test verifies resources returned from the first search conform to
13
+ the TNM Primary Tumor Category profile.
14
+ Systems must demonstrate at least one valid example in order to pass this test.
15
+
16
+ It verifies the presence of mandatory elements and that elements with
17
+ required bindings contain appropriate values. CodeableConcept element
18
+ bindings will fail if none of their codings have a code/system belonging
19
+ to the bound ValueSet. Quantity, Coding, and code element bindings will
20
+ fail if their code/system are not found in the valueset.
21
+
22
+ )
23
+
24
+ def resource_type
25
+ 'Observation'
26
+ end
27
+
28
+ def scratch_resources
29
+ scratch[:tnm_primary_tumor_category_resources] ||= {}
30
+ end
31
+
32
+ run do
33
+ perform_validation_test(scratch_resources[:all] || [],
34
+ 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-primary-tumor-category',
35
+ '3.0.0',
36
+ skip_if_empty: true)
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'tnm_primary_tumor_category/tnm_primary_tumor_category_search_test'
4
+ require_relative 'tnm_primary_tumor_category/tnm_primary_tumor_category_must_support_test'
5
+ require_relative 'tnm_primary_tumor_category/tnm_primary_tumor_category_validation_test'
6
+
7
+ module CancerRegistryReportingTestKit
8
+ class EHRTNMPrimaryTumorCategoryTests < Inferno::TestGroup
9
+ title 'mCODE TNM Primary Tumor Category'
10
+ description %(
11
+ # Background
12
+ The mCODE TNM Primary Tumor Category group verifies that the system under test is
13
+ able to provide correct responses for TNM Primary Tumor Category Observation queries. These queries
14
+ return resources conforming to the [mCODE TNM Primary Tumor Category Profile](https://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-primary-tumor-category.html)
15
+ as specified in the mCODE v3.0.0 Implementation Guide.
16
+
17
+ # Testing Methodology
18
+ ## Searching
19
+ This test sequence will first perform each required search associated
20
+ with this resource. This sequence will perform searches with the
21
+ following parameters:
22
+
23
+ * patient + code
24
+
25
+ ### Search Parameters
26
+ The first search uses values from the **Patient IDs** and
27
+ **TNM Primary Tumor Category code** inputs as provided by the tester.
28
+ Any subsequent searches will look for its parameter values
29
+ from the results of the first search. For example, the `identifier`
30
+ search in the patient sequence is performed by looking for an existing
31
+ `Patient.identifier` from any of the resources returned in the first
32
+ search. If a value cannot be found this way, the search is skipped.
33
+
34
+ ### Search Validation
35
+ Inferno will retrieve up to the first 20 bundle pages of the reply for
36
+ Observation resources and save them for subsequent tests. Each of
37
+ these resources is then checked to see if it matches the searched
38
+ parameters in accordance with [FHIR search
39
+ guidelines](https://www.hl7.org/fhir/search.html). The test will fail,
40
+ for example, if a Patient search for `gender=male` returns a `female`
41
+ patient.
42
+
43
+
44
+ ## Must Support
45
+ Each profile contains elements marked as "must support". This test
46
+ sequence expects to see each of these elements at least once. If at
47
+ least one cannot be found, the test will fail. The test will look
48
+ through the Observation resources found in the first test for these
49
+ elements.
50
+
51
+ ## Profile Validation
52
+ Each resource returned from the first search is expected to conform to
53
+ the [mCODE TNM Primary Tumor Category Profile](https://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-primary-tumor-category.html).
54
+ Each element is checked against terminology binding and cardinality requirements.
55
+
56
+ Elements with a required binding are validated against their bound
57
+ ValueSet. If the code/system in the element is not part of the ValueSet,
58
+ then the test will fail.
59
+ )
60
+ id :ccrr_ehr_tnm_primary_tumor_category
61
+ run_as_group
62
+
63
+ def self.metadata
64
+ @metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(
65
+ File.join(__dir__, 'tnm_primary_tumor_category',
66
+ 'metadata.yml'), aliases: true
67
+ ))
68
+ end
69
+ test from: :ccrr_tnm_primary_tumor_category_search_test
70
+ test from: :ccrr_tnm_primary_tumor_category_validation_test
71
+ test from: :ccrr_tnm_primary_tumor_category_must_support_test
72
+ end
73
+ end
@@ -0,0 +1,64 @@
1
+ ---
2
+ :name: mcode_tnm_regional_nodes_category
3
+ :class_name: McodeTnmRegionalNodesCategorySequence
4
+ :version: v1.0.0
5
+ :reformatted_version: v100
6
+ :resource: Observation
7
+ :profile_url: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-regional-nodes-category
8
+ :profile_name: TNM Regional Nodes Category Profile
9
+ :profile_version: 3.0.0
10
+ :title: Observation TNM Regional Nodes Category
11
+ :short_description: Verify support for the server capabilities required by the TNM
12
+ Regional Nodes Category Profile.
13
+ :must_supports:
14
+ :extensions: []
15
+ :slices: []
16
+ :elements:
17
+ - :path: status
18
+ - :path: code
19
+ - :path: subject
20
+ :types:
21
+ - Reference
22
+ :target_profiles:
23
+ - http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-patient
24
+ - :path: focus
25
+ :types:
26
+ - Reference
27
+ :target_profiles:
28
+ - http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-primary-cancer-condition
29
+ - :path: effective[x]
30
+ - :path: value[x]
31
+ - :path: method
32
+ :mandatory_elements:
33
+ - Observation.status
34
+ - Observation.code
35
+ - Observation.method
36
+ - Observation.component.code
37
+ :tests: []
38
+ :id: ccrr_v100_mcode_tnm_regional_nodes_category
39
+ :file_name: mcode_tnm_regional_nodes_category_group.rb
40
+ :searches:
41
+ - :expectation: SHALL
42
+ :names:
43
+ - patient
44
+ - code
45
+ :search_definitions:
46
+ :patient:
47
+ :paths:
48
+ - subject
49
+ :full_paths:
50
+ - Observation.subject
51
+ :comparators: {}
52
+ :values: []
53
+ :type: Reference
54
+ :contains_multiple: false
55
+ :multiple_or: MAY
56
+ :code:
57
+ :paths:
58
+ - code
59
+ :full_paths:
60
+ - Observation.code
61
+ :comparators: {}
62
+ :type: CodeableConcept
63
+ :contains_multiple: true
64
+ :multiple_or: MAY
@@ -0,0 +1,44 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../must_support_test'
4
+
5
+ module CancerRegistryReportingTestKit
6
+ class TNMRegionalNodesCategoryMustSupportTest < Inferno::Test
7
+ include CancerRegistryReportingTestKit::MustSupportTest
8
+
9
+ title 'All must support elements are provided in the mCODE TNM Regional Nodes Category Observation resources returned'
10
+ description %(
11
+ CCRR EHRs SHALL be capable of populating all data elements as
12
+ part of the query results. This test will look through the Observation resources
13
+ found previously for the following must support elements:
14
+
15
+ * Observation.category
16
+ * Observation.code
17
+ * Observation.effective[x]
18
+ * Observation.focus
19
+ * Observation.method
20
+ * Observation.performer
21
+ * Observation.status
22
+ * Observation.subject
23
+ * Observation.value[x]
24
+ )
25
+
26
+ id :ccrr_tnm_regional_nodes_category_must_support_test
27
+
28
+ def resource_type
29
+ 'Observation'
30
+ end
31
+
32
+ def self.metadata
33
+ @metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
34
+ end
35
+
36
+ def scratch_resources
37
+ scratch[:tnm_regional_nodes_category_resources] ||= {}
38
+ end
39
+
40
+ run do
41
+ perform_must_support_test(all_scratch_resources)
42
+ end
43
+ end
44
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../search_test'
4
+ require_relative '../../../hdea_generator/group_metadata'
5
+
6
+ module CancerRegistryReportingTestKit
7
+ class TNMRegionalNodesCategorySearchTest < Inferno::Test
8
+ include CancerRegistryReportingTestKit::SearchTest
9
+
10
+ title 'Server returns valid results for Observation search by patient + code'
11
+ description %(
12
+ A server SHALL support searching by
13
+ patient + code on the Observation resource. This test
14
+ will pass if resources are returned and match the search criteria. If
15
+ none are returned, the test is skipped.
16
+
17
+ Because this is the first search of the sequence, resources in the
18
+ response will be used for subsequent tests.
19
+
20
+ Additionally, this test will check that GET and POST search methods
21
+ return the same number of results.
22
+ )
23
+
24
+ id :ccrr_tnm_regional_nodes_category_search_test
25
+ input :patient_ids,
26
+ title: 'Patient IDs',
27
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
28
+
29
+ input :tnm_regional_nodes_category_code,
30
+ title: 'TNM Regional Nodes Category code',
31
+ description: %(
32
+ `Observation.code` value that distinguishes TNM Regional Nodes Category instances from other
33
+ Observations. Used as a search parameter value when searching for Observation instances to check
34
+ for conformance to the TNM Regional Nodes Category Observation profile.
35
+ ),
36
+ optional: true
37
+
38
+ def self.properties
39
+ @properties ||= CancerRegistryReportingTestKit::SearchTestProperties.new(
40
+ first_search: true,
41
+ fixed_value_search: false,
42
+ resource_type: 'Observation',
43
+ search_param_names: %w[patient code],
44
+ possible_status_search: true,
45
+ token_search_params: ['code'],
46
+ test_reference_variants: true,
47
+ test_post_search: false
48
+ )
49
+ end
50
+
51
+ def self.metadata
52
+ @metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
53
+ end
54
+
55
+ def scratch_resources
56
+ scratch[:tnm_regional_nodes_category_resources] ||= {}
57
+ end
58
+
59
+ run do
60
+ skip_if tnm_regional_nodes_category_code.blank?,
61
+ 'Provide a code search value for TNM Regional Nodes Categories in the ' \
62
+ '**TNM Regional Nodes Category code** input to run these tests.'
63
+
64
+ # manual params must be in the same order as the param names
65
+ @manual_search_params = [tnm_regional_nodes_category_code]
66
+ run_search_test
67
+ end
68
+ end
69
+ end
@@ -0,0 +1,39 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../validation_test'
4
+
5
+ module CancerRegistryReportingTestKit
6
+ class TNMRegionalNodesCategoryValidationTest < Inferno::Test
7
+ include CancerRegistryReportingTestKit::ValidationTest
8
+
9
+ id :ccrr_tnm_regional_nodes_category_validation_test
10
+ title 'Observation resources returned during previous tests conform to the mCODE TNM Regional Nodes Category profile'
11
+ description %(
12
+ This test verifies resources returned from the first search conform to
13
+ the [mCODE TNM Regional Nodes Category Profile](https://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-regional-nodes-category.html).
14
+ Systems must demonstrate at least one valid example in order to pass this test.
15
+
16
+ It verifies the presence of mandatory elements and that elements with
17
+ required bindings contain appropriate values. CodeableConcept element
18
+ bindings will fail if none of their codings have a code/system belonging
19
+ to the bound ValueSet. Quantity, Coding, and code element bindings will
20
+ fail if their code/system are not found in the valueset.
21
+
22
+ )
23
+
24
+ def resource_type
25
+ 'Observation'
26
+ end
27
+
28
+ def scratch_resources
29
+ scratch[:tnm_regional_nodes_category_resources] ||= {}
30
+ end
31
+
32
+ run do
33
+ perform_validation_test(scratch_resources[:all] || [],
34
+ 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-regional-nodes-category',
35
+ '3.0.0',
36
+ skip_if_empty: true)
37
+ end
38
+ end
39
+ end
@@ -0,0 +1,73 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'tnm_regional_nodes_category/tnm_regional_nodes_category_search_test'
4
+ require_relative 'tnm_regional_nodes_category/tnm_regional_nodes_category_must_support_test'
5
+ require_relative 'tnm_regional_nodes_category/tnm_regional_nodes_category_validation_test'
6
+
7
+ module CancerRegistryReportingTestKit
8
+ class EHRTNMRegionalNodeasCategoryTests < Inferno::TestGroup
9
+ title 'mCODE TNM Regional Nodes Category'
10
+ description %(
11
+ # Background
12
+ The mCODE TNM Regional Nodes Category group verifies that the system under test is
13
+ able to provide correct responses for mCODE TNM Regional Nodes Category Observation queries. These queries
14
+ return resources conforming to the [mCODE TNM Regional Nodes Category Profile](https://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-regional-nodes-category.html)
15
+ as specified in the mCODE v3.0.0 Implementation Guide.
16
+
17
+ # Testing Methodology
18
+ ## Searching
19
+ This test sequence will first perform each required search associated
20
+ with this resource. This sequence will perform searches with the
21
+ following parameters:
22
+
23
+ * patient + code
24
+
25
+ ### Search Parameters
26
+ The first search uses values from the **Patient IDs** and
27
+ **TNM Regional Nodes Category code** inputs as provided by the tester.
28
+ Any subsequent searches will look for its parameter values
29
+ from the results of the first search. For example, the `identifier`
30
+ search in the patient sequence is performed by looking for an existing
31
+ `Patient.identifier` from any of the resources returned in the first
32
+ search. If a value cannot be found this way, the search is skipped.
33
+
34
+ ### Search Validation
35
+ Inferno will retrieve up to the first 20 bundle pages of the reply for
36
+ Observation resources and save them for subsequent tests. Each of
37
+ these resources is then checked to see if it matches the searched
38
+ parameters in accordance with [FHIR search
39
+ guidelines](https://www.hl7.org/fhir/search.html). The test will fail,
40
+ for example, if a Patient search for `gender=male` returns a `female`
41
+ patient.
42
+
43
+
44
+ ## Must Support
45
+ Each profile contains elements marked as "must support". This test
46
+ sequence expects to see each of these elements at least once. If at
47
+ least one cannot be found, the test will fail. The test will look
48
+ through the Observation resources found in the first test for these
49
+ elements.
50
+
51
+ ## Profile Validation
52
+ Each resource returned from the first search is expected to conform to
53
+ the [mCODE TNM Regional Nodes Category Profile](https://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-regional-nodes-category.html).
54
+ Each element is checked against terminology binding and cardinality requirements.
55
+
56
+ Elements with a required binding are validated against their bound
57
+ ValueSet. If the code/system in the element is not part of the ValueSet,
58
+ then the test will fail.
59
+ )
60
+ id :ccrr_ehr_tnm_regional_nodes_category
61
+ run_as_group
62
+
63
+ def self.metadata
64
+ @metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(
65
+ File.join(__dir__, 'tnm_regional_nodes_category',
66
+ 'metadata.yml'), aliases: true
67
+ ))
68
+ end
69
+ test from: :ccrr_tnm_regional_nodes_category_search_test
70
+ test from: :ccrr_tnm_regional_nodes_category_validation_test
71
+ test from: :ccrr_tnm_regional_nodes_category_must_support_test
72
+ end
73
+ end
@@ -0,0 +1,68 @@
1
+ ---
2
+ :name: mcode_tnm_stage_group
3
+ :class_name: McodeTnmStageGroupSequence
4
+ :version: v1.0.0
5
+ :reformatted_version: v100
6
+ :resource: Observation
7
+ :profile_url: http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-stage-group
8
+ :profile_name: TNM Stage Group Profile
9
+ :profile_version: 3.0.0
10
+ :title: Observation TNM Stage Group
11
+ :short_description: Verify support for the server capabilities required by the TNM
12
+ Stage Group Profile.
13
+ :must_supports:
14
+ :extensions: []
15
+ :slices: []
16
+ :elements:
17
+ - :path: status
18
+ - :path: code
19
+ - :path: subject
20
+ :types:
21
+ - Reference
22
+ :target_profiles:
23
+ - http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-patient
24
+ - :path: focus
25
+ :types:
26
+ - Reference
27
+ :target_profiles:
28
+ - http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-primary-cancer-condition
29
+ - :path: effective[x]
30
+ - :path: value[x]
31
+ - :path: method
32
+ - :path: hasMember
33
+ :types:
34
+ - Reference
35
+ :mandatory_elements:
36
+ - Observation.status
37
+ - Observation.code
38
+ - Observation.focus
39
+ - Observation.method
40
+ - Observation.component.code
41
+ :tests: []
42
+ :id: ccrr_v100_mcode_tnm_stage_group
43
+ :file_name: mcode_tnm_stage_group_group.rb
44
+ :searches:
45
+ - :expectation: SHALL
46
+ :names:
47
+ - patient
48
+ - code
49
+ :search_definitions:
50
+ :patient:
51
+ :paths:
52
+ - subject
53
+ :full_paths:
54
+ - Observation.subject
55
+ :comparators: {}
56
+ :values: []
57
+ :type: Reference
58
+ :contains_multiple: false
59
+ :multiple_or: MAY
60
+ :code:
61
+ :paths:
62
+ - code
63
+ :full_paths:
64
+ - Observation.code
65
+ :comparators: {}
66
+ :type: CodeableConcept
67
+ :contains_multiple: true
68
+ :multiple_or: MAY
@@ -0,0 +1,45 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../must_support_test'
4
+
5
+ module CancerRegistryReportingTestKit
6
+ class TNMStageGroupMustSupportTest < Inferno::Test
7
+ include CancerRegistryReportingTestKit::MustSupportTest
8
+
9
+ title 'All must support elements are provided in the mCODE TNM Stage Group Observation resources returned'
10
+ description %(
11
+ CCRR EHRs SHALL be capable of populating all data elements as
12
+ part of the query results. This test will look through the Observation resources
13
+ found previously for the following must support elements:
14
+
15
+ * Observation.category
16
+ * Observation.code
17
+ * Observation.effective[x]
18
+ * Observation.focus
19
+ * Observation.hasMember
20
+ * Observation.method
21
+ * Observation.performer
22
+ * Observation.status
23
+ * Observation.subject
24
+ * Observation.value[x]
25
+ )
26
+
27
+ id :ccrr_tnm_stage_group_must_support_test
28
+
29
+ def resource_type
30
+ 'Observation'
31
+ end
32
+
33
+ def self.metadata
34
+ @metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
35
+ end
36
+
37
+ def scratch_resources
38
+ scratch[:tnm_stage_group_resources] ||= {}
39
+ end
40
+
41
+ run do
42
+ perform_must_support_test(all_scratch_resources)
43
+ end
44
+ end
45
+ end
@@ -0,0 +1,69 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative '../../../search_test'
4
+ require_relative '../../../hdea_generator/group_metadata'
5
+
6
+ module CancerRegistryReportingTestKit
7
+ class TNMStageGroupSearchTest < Inferno::Test
8
+ include CancerRegistryReportingTestKit::SearchTest
9
+
10
+ title 'Server returns valid results for Observation search by patient + code'
11
+ description %(
12
+ A server SHALL support searching by
13
+ patient + code on the Observation resource. This test
14
+ will pass if resources are returned and match the search criteria. If
15
+ none are returned, the test is skipped.
16
+
17
+ Because this is the first search of the sequence, resources in the
18
+ response will be used for subsequent tests.
19
+
20
+ Additionally, this test will check that GET and POST search methods
21
+ return the same number of results.
22
+ )
23
+
24
+ id :ccrr_tnm_stage_group_search_test
25
+ input :patient_ids,
26
+ title: 'Patient IDs',
27
+ description: 'Comma separated list of patient IDs that in sum contain all MUST SUPPORT elements'
28
+
29
+ input :tnm_stage_group_code,
30
+ title: 'TNM Stage Group code',
31
+ description: %(
32
+ `Observation.code` value that distinguishes TNM Stage Group instances from other Observations. Used as
33
+ a search parameter value when searching for Observation instances to check for conformance to the
34
+ TNM Stage Group Observation profile.
35
+ ),
36
+ optional: true
37
+
38
+ def self.properties
39
+ @properties ||= CancerRegistryReportingTestKit::SearchTestProperties.new(
40
+ first_search: true,
41
+ fixed_value_search: false,
42
+ resource_type: 'Observation',
43
+ search_param_names: %w[patient code],
44
+ possible_status_search: true,
45
+ token_search_params: ['code'],
46
+ test_reference_variants: true,
47
+ test_post_search: false
48
+ )
49
+ end
50
+
51
+ def self.metadata
52
+ @metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
53
+ end
54
+
55
+ def scratch_resources
56
+ scratch[:tnm_stage_group_resources] ||= {}
57
+ end
58
+
59
+ run do
60
+ skip_if tnm_stage_group_code.blank?,
61
+ 'Provide a code search value for TNM Stage Groups in the ' \
62
+ '**TNM Stage Group code** input to run these tests.'
63
+
64
+ # manual params must be in the same order as the param names
65
+ @manual_search_params = [tnm_stage_group_code]
66
+ run_search_test
67
+ end
68
+ end
69
+ end