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.
- checksums.yaml +7 -0
- data/LICENSE +201 -0
- data/config/presets/hdea_report_preset.json +14 -0
- data/config/presets/inferno_reference_server_preset.json.erb +84 -0
- data/lib/cancer_registry_reporting_test_kit/bundle_parse.rb +161 -0
- data/lib/cancer_registry_reporting_test_kit/docs/ehr_suite_description.md +134 -0
- data/lib/cancer_registry_reporting_test_kit/docs/hdea_suite_description.md +108 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/ehr_capability_statement/mcode_capability_statement_profile_support.rb +40 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/ehr_data_access_group.rb +131 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/medication_administration_must_support_test.rb +43 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/medication_administration_search_test.rb +51 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/medication_administration_validation_test.rb +41 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration/metadata.yml +72 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_administration_group.rb +72 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/medication_request_must_support_test.rb +55 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/medication_request_search_test.rb +55 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/medication_request_validation_test.rb +38 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request/metadata.yml +94 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/medication_request_group.rb +73 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_cancer_condition_group.rb +73 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/metadata.yml +100 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/primary_cancer_condition_must_support_test.rb +50 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/primary_cancer_condition_search_test.rb +70 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/primary_condition/primary_cancer_condition_validation_test.rb +39 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/metadata.yml +99 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/radiotherapy_procedure_must_support_test.rb +46 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/radiotherapy_procedure_search_test.rb +51 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure/radiotherapy_procedure_validation_test.rb +37 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/radiotherapy_procedure_group.rb +83 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_cancer_condition_group.rb +68 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/metadata.yml +102 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/secondary_cancer_condition_must_support_test.rb +50 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/secondary_cancer_condition_search_test.rb +70 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/secondary_condition/secondary_cancer_condition_validation_test.rb +39 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_distant_metastases_category/metadata.yml +65 -0
- 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
- 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
- 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
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_distant_metastases_category_group.rb +74 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_primary_tumor_category/metadata.yml +64 -0
- 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
- 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
- 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
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_primary_tumor_category_group.rb +73 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_regional_nodes_category/metadata.yml +64 -0
- 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
- 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
- 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
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_regional_nodes_category_group.rb +73 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group/metadata.yml +68 -0
- 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
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group/tnm_stage_group_search_test.rb +69 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group/tnm_stage_group_validation_test.rb +39 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite/mcode_data_access_resources/tnm_stage_group_group.rb +72 -0
- data/lib/cancer_registry_reporting_test_kit/ehr_suite.rb +69 -0
- data/lib/cancer_registry_reporting_test_kit/fhir_resource_navigation.rb +174 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/group_generator.rb +47 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/group_metadata.rb +86 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/group_metadata_extractor.rb +205 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_loader.rb +78 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_metadata.rb +26 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_metadata_extractor.rb +78 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/ig_resources.rb +56 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/must_support_metadata_extractor.rb +399 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/must_support_test_generator.rb +134 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/naming.rb +168 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/special_cases.rb +43 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/templates/must_support.rb.erb +41 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/templates/validation.rb.erb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/terminology_binding_metadata_extractor.rb +118 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/validation_test_generator.rb +125 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator/value_extractor.rb +134 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_generator.rb +66 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/author_validation_test.rb +61 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/organization_metadata.yml +47 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/organization_must_support_test.rb +73 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_metadata.yml +51 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_must_support_test.rb +73 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_role_metadata.yml +48 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/author/practitioner_role_must_support_test.rb +66 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/bundle_resources_group.rb +213 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/ccrr_content_bundle_parse_and_validation_test.rb +67 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/allergy_intolerance/allergy_intolerance_must_support_test.rb +46 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/allergy_intolerance/allergy_intolerance_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/allergy_intolerance/metadata.yml +36 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/care_plan/care_plan_must_support_test.rb +48 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/care_plan/care_plan_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/care_plan/metadata.yml +50 -0
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/ccrr_content_bundle/metadata.yml +36 -0
- 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
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/central_cancer_registry_primary_cancer_condition/metadata.yml +86 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/composition/composition_must_support_test.rb +109 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/composition/composition_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/composition/metadata.yml +272 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/condition/condition_must_support_test.rb +45 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/condition/condition_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/condition/metadata.yml +33 -0
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_lab/diagnostic_report_lab_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_lab/metadata.yml +57 -0
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_note/diagnostic_report_note_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/diagnostic_report_note/metadata.yml +75 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/document_reference/document_reference_must_support_test.rb +57 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/document_reference/document_reference_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/document_reference/metadata.yml +68 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/encounter/encounter_must_support_test.rb +59 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/encounter/encounter_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/encounter/metadata.yml +73 -0
- 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
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_radiotherapy_course_summary/metadata.yml +59 -0
- 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
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_secondary_cancer_condition/metadata.yml +77 -0
- 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
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/mcode_tnm_stage_group/metadata.yml +46 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication/medication_must_support_test.rb +41 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication/medication_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication/metadata.yml +26 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_administration/medication_administration_must_support_test.rb +48 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_administration/medication_administration_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_administration/metadata.yml +48 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_request/medication_request_must_support_test.rb +57 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_request/medication_request_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_request/metadata.yml +86 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_statement/medication_statement_must_support_test.rb +41 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_statement/medication_statement_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/medication_statement/metadata.yml +26 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation/metadata.yml +26 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation/observation_must_support_test.rb +41 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation/observation_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation_lab/metadata.yml +53 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation_lab/observation_lab_must_support_test.rb +50 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/observation_lab/observation_lab_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/odh_usual_work/metadata.yml +81 -0
- 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
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/odh_usual_work/odh_usual_work_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/organization/metadata.yml +46 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/organization/organization_must_support_test.rb +55 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/organization/organization_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/patient/metadata.yml +51 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/patient/patient_must_support_test.rb +58 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/patient/patient_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner/metadata.yml +50 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner/practitioner_must_support_test.rb +55 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner/practitioner_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner_role/metadata.yml +47 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner_role/practitioner_role_must_support_test.rb +49 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/practitioner_role/practitioner_role_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/procedure/metadata.yml +37 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/procedure/procedure_must_support_test.rb +44 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/procedure/procedure_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/service_request/metadata.yml +26 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/service_request/service_request_must_support_test.rb +41 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/service_request/service_request_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/smokingstatus/metadata.yml +58 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/smokingstatus/smokingstatus_must_support_test.rb +47 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite/generated/v1.0.0/smokingstatus/smokingstatus_validation_test.rb +35 -0
- data/lib/cancer_registry_reporting_test_kit/hdea_suite.rb +80 -0
- data/lib/cancer_registry_reporting_test_kit/igs/README.md +21 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-cancer-related-medication-administration.json +1905 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-cancer-related-medication-request.json +3611 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-primary-cancer-condition.json +2246 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-radiotherapy-course-summary.json +2700 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-secondary-cancer-condition.json +2419 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-distant-metastases-category.json +2320 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-primary-tumor-category.json +2320 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-regional-nodes-category.json +2320 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-mcode-tnm-stage-group.json +2414 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-medicationstatement.profile.json +1578 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-observation.profile.json +3510 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-odh-UsualWork.json +7248 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-servicerequest.profile.json +3048 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-allergyintolerance.json +1842 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-careplan.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-condition.json +2154 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-diagnosticreport-lab.json +2002 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-diagnosticreport-note.json +2049 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-documentreference.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-encounter.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-medication.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-observation-lab.json +3153 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-organization.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-patient.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-practitioner.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-practitionerrole.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-procedure.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100/StructureDefinition-us-core-smokingstatus.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/ccrr_v100.tgz +0 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/.index.db +0 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/.index.json +4 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/CapabilityStatement-central-cancer-registry-reporting-ehr.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/ImplementationGuide-hl7.fhir.us.central-cancer-registry-reporting.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-cancer-encounter.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-cancer-patient.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-composition.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-content-bundle.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-plandefinition.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-ccrr-reporting-bundle.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-central-cancer-registry-primary-cancer-condition.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-central-cancer-registry-reporting-messageheader.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-us-ph-patient.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/StructureDefinition-us-ph-tribal-affiliation-extension.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/ValueSet-cancer-core-reportability-codes.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/AllergyIntolerance-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/BodyStructure-jenny-m-chest-wall-lymph-nodes-treatment-volume.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/BodyStructure-jenny-m-chest-wall-treatment-volume.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Bundle-ccrr-content-bundle-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Bundle-central-cancer-registry-reporting-specification-bundle-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Bundle-reporting-bundle-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Composition-ccrr-composition-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Condition-primary-cancer-condition-breast.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Encounter-encounter-cancer-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Endpoint-example-healthcare-endpoint.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Endpoint-example-ph-endpoint.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/MedicationAdministration-cancer-related-medication-administration-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/MessageHeader-messageheader-example-reportheader.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-cancer-stage-group-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-tnm-clinical-distant-metastases-category-cM0.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-tnm-clinical-primary-tumor-category-cT3.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Observation-tnm-clinical-regional-nodes-category-cN3.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Organization-example-healthcare-org.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Organization-example-pha-org.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Patient-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/PlanDefinition-plandefinition-central-cancer-registry-reporting-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Practitioner-1.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/example/Procedure-radiotherapy-example.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/openapi/central-cancer-registry-reporting-ehr.openapi.json +364 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/other/ig-r4.jsonX +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/other/spec.internals +293 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/other/validation-oo.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/other/validation-summary.json +1 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/package.json +30 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-cancer-encounter.sch +19 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-cancer-patient.sch +175 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-composition.sch +61 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-content-bundle.sch +12 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-plandefinition.sch +331 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-ccrr-reporting-bundle.sch +12 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-central-cancer-registry-primary-cancer-condition.sch +31 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-central-cancer-registry-reporting-messageheader.sch +27 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-us-ph-patient.sch +217 -0
- data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-us-ph-tribal-affiliation-extension.sch +36 -0
- data/lib/cancer_registry_reporting_test_kit/metadata.rb +71 -0
- data/lib/cancer_registry_reporting_test_kit/must_support_test.rb +263 -0
- data/lib/cancer_registry_reporting_test_kit/primitive_type.rb +7 -0
- data/lib/cancer_registry_reporting_test_kit/requirements/cancer-registry-reporting-test-kit_out_of_scope_requirements.csv +77 -0
- data/lib/cancer_registry_reporting_test_kit/requirements/cancer-registry-reporting-test-kit_requirements.csv +162 -0
- data/lib/cancer_registry_reporting_test_kit/requirements/generated/cancer-registry-reporting-test-kit_requirements_coverage.csv +161 -0
- data/lib/cancer_registry_reporting_test_kit/search_test.rb +897 -0
- data/lib/cancer_registry_reporting_test_kit/search_test_properties.rb +58 -0
- data/lib/cancer_registry_reporting_test_kit/validation_test.rb +68 -0
- data/lib/cancer_registry_reporting_test_kit/version.rb +6 -0
- data/lib/cancer_registry_reporting_test_kit.rb +6 -0
- data/lib/inferno_requirements_tools/ext/inferno_core/runnable.rb +22 -0
- data/lib/inferno_requirements_tools/tasks/requirements_coverage.rb +284 -0
- data/lib/requirements_config.yaml +22 -0
- metadata +341 -0
@@ -0,0 +1,161 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'fhir_resource_navigation'
|
4
|
+
|
5
|
+
module CancerRegistryReportingTestKit
|
6
|
+
module HDEABundleParse
|
7
|
+
extend Forwardable
|
8
|
+
include FHIRResourceNavigation
|
9
|
+
|
10
|
+
# Much of this is extremely custom fit to HDEA.
|
11
|
+
# HDEA Custom Components:
|
12
|
+
# - CODE_TO_URL_MAP, CODE_TO_MULTIPLE_ENTRY_RESOURCE_MAP, FIELD_TO_URL_MAP are nongenerated mappings specific to HDEA.
|
13
|
+
# - The `profile_from_resource_type()` method similarly assumes decisions between profiles are made via code. This is NOT what the IG suggests (instead verify by profile)
|
14
|
+
# - The `parse_bundle()` method assumes the bundle is a content bundle for hdea and thus starts with a composition resource. It also immediately yields unresolved references as an info message
|
15
|
+
# - The `look_for_references_in_resource()` method was designed to be flexible but with HDEA CCRR as the grounds for inspiration. It has not been tested on other bundles that include a composition.
|
16
|
+
# - Assumes references are of the form `ResourceType/ID`
|
17
|
+
|
18
|
+
def unresolved_references
|
19
|
+
@unresolved_references ||= []
|
20
|
+
end
|
21
|
+
|
22
|
+
def clear_unresolved_references
|
23
|
+
@unresolved_references = []
|
24
|
+
end
|
25
|
+
|
26
|
+
CODE_TO_URL_MAP = {
|
27
|
+
'363346000' => 'http://hl7.org/fhir/us/central-cancer-registry-reporting/StructureDefinition/central-cancer-registry-primary-cancer-condition',
|
28
|
+
'128462008' => 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-secondary-cancer-condition',
|
29
|
+
'21908-9' => 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-stage-group',
|
30
|
+
'1217123003' => 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-radiotherapy-course-summary',
|
31
|
+
'11450-4' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-condition',
|
32
|
+
'48765-2' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-allergyintolerance',
|
33
|
+
'74165-2' => 'http://hl7.org/fhir/us/odh/StructureDefinition/odh-UsualWork',
|
34
|
+
'47519-4' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-procedure',
|
35
|
+
'8716-3' => 'http://hl7.org/fhir/StructureDefinition/Observation',
|
36
|
+
'29762-2' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-smokingstatus'
|
37
|
+
}.freeze
|
38
|
+
|
39
|
+
CODE_TO_MULTIPLE_ENTRY_RESOURCE_MAP = {
|
40
|
+
'29549-3' => {
|
41
|
+
'MedicationAdministration' => 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-related-medication-administration', 'Medication' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication'
|
42
|
+
},
|
43
|
+
'10160-0' => {
|
44
|
+
'MedicationAdministration' => 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-related-medication-administration', 'MedicationStatement' => 'http://hl7.org/fhir/StructureDefinition/MedicationStatement', 'Medication' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication'
|
45
|
+
},
|
46
|
+
'30954-2' => { 'Observation' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-observation-lab',
|
47
|
+
'DiagnosticReport' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-lab' },
|
48
|
+
'28650-0' => { 'DocumentReference' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-documentreference',
|
49
|
+
'DiagnosticReport' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-diagnosticreport-note' },
|
50
|
+
'18776-5' => {
|
51
|
+
'MedicationRequest' => 'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-related-medication-request', 'Medication' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-medication', 'ServiceRequest' => 'http://hl7.org/fhir/StructureDefinition/ServiceRequest', 'CarePlan' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-careplan'
|
52
|
+
}
|
53
|
+
}.freeze
|
54
|
+
|
55
|
+
FIELD_TO_URL_MAP = {
|
56
|
+
'subject' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-patient',
|
57
|
+
'encounter' => 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-encounter',
|
58
|
+
'author' => ['http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitionerrole',
|
59
|
+
'http://hl7.org/fhir/us/core/StructureDefinition/us-core-practitioner', 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-organization']
|
60
|
+
}.freeze
|
61
|
+
|
62
|
+
# Method for translating received bundle into a hash of resources. Use for MS and Validation testing
|
63
|
+
def parse_bundle(bundle, index)
|
64
|
+
first_resource = bundle.entry.first.resource
|
65
|
+
if first_resource.is_a?(FHIR::Composition)
|
66
|
+
parsed_bundle = look_for_references_in_resource(first_resource, bundle)
|
67
|
+
parsed_bundle['http://hl7.org/fhir/us/central-cancer-registry-reporting/StructureDefinition/ccrr-content-bundle'] ||= []
|
68
|
+
parsed_bundle['http://hl7.org/fhir/us/central-cancer-registry-reporting/StructureDefinition/ccrr-content-bundle'].push(bundle)
|
69
|
+
parsed_bundle['http://hl7.org/fhir/us/central-cancer-registry-reporting/StructureDefinition/ccrr-composition'] ||= []
|
70
|
+
parsed_bundle['http://hl7.org/fhir/us/central-cancer-registry-reporting/StructureDefinition/ccrr-composition'].push(first_resource)
|
71
|
+
unless unresolved_references.empty?
|
72
|
+
warning "The following references did not resolve, the resources either do not exist in the bundle or are mislabeled: #{unresolved_references}"
|
73
|
+
end
|
74
|
+
current_bundle_unresolved_references = unresolved_references
|
75
|
+
clear_unresolved_references
|
76
|
+
[parsed_bundle, current_bundle_unresolved_references]
|
77
|
+
else
|
78
|
+
add_message('error', "Unable to parse bundle #{index + 1}: " \
|
79
|
+
"the first entry must be a Composition but got #{first_resource.resourceType}.")
|
80
|
+
[nil, nil]
|
81
|
+
end
|
82
|
+
end
|
83
|
+
|
84
|
+
# Helpers
|
85
|
+
def look_for_references_in_resource(resource, bundle)
|
86
|
+
resource_hash = {}
|
87
|
+
resource.to_hash.each_key do |key|
|
88
|
+
value = resource&.send(key.to_sym)
|
89
|
+
if value.is_a?(FHIR::Reference)
|
90
|
+
resource_hash[FIELD_TO_URL_MAP[key]] ||= []
|
91
|
+
referenced_resource = find_resource_in_bundle(value.reference, bundle)
|
92
|
+
unresolved_references << value.reference unless referenced_resource
|
93
|
+
if !resource_hash[FIELD_TO_URL_MAP[key]].include?(referenced_resource) && referenced_resource
|
94
|
+
resource_hash[FIELD_TO_URL_MAP[key]] << referenced_resource
|
95
|
+
end
|
96
|
+
elsif value.is_a?(Array) && value.all? { |elmt| elmt.is_a?(FHIR::Composition::Section) }
|
97
|
+
resource_hash.merge!(parse_sections(value, bundle))
|
98
|
+
elsif value.is_a?(Array) && value.all? { |elmt| elmt.is_a?(FHIR::Reference) }
|
99
|
+
resource_hash[FIELD_TO_URL_MAP[key]] ||= []
|
100
|
+
value.each do |val|
|
101
|
+
referenced_resource = find_resource_in_bundle(val.reference, bundle)
|
102
|
+
unresolved_references << val.reference unless referenced_resource
|
103
|
+
if !resource_hash[FIELD_TO_URL_MAP[key]].include?(referenced_resource) && referenced_resource
|
104
|
+
resource_hash[FIELD_TO_URL_MAP[key]] << referenced_resource
|
105
|
+
end
|
106
|
+
end
|
107
|
+
elsif value.is_a?(FHIR::Model)
|
108
|
+
resource_hash.merge!(look_for_references_in_resource(value, bundle))
|
109
|
+
elsif value.is_a?(Array) && value.all? { |elmt| elmt.is_a?(FHIR::Model) }
|
110
|
+
value.each { |val| resource_hash.merge!(look_for_references_in_resource(val, bundle)) }
|
111
|
+
end
|
112
|
+
end
|
113
|
+
resource_hash.reject { |_k, v| v.nil? || v&.empty? }
|
114
|
+
end
|
115
|
+
|
116
|
+
def parse_sections(sections, bundle)
|
117
|
+
sections.each_with_object({}) do |sec, hash|
|
118
|
+
code = sec.code.coding.first.code
|
119
|
+
if multiple_reference_types?(code)
|
120
|
+
sec.entry.each do |ref|
|
121
|
+
referenced_resource = find_resource_in_bundle(ref.reference, bundle)
|
122
|
+
if referenced_resource
|
123
|
+
hash[profile_from_resource_type(code, referenced_resource.resourceType)] ||= []
|
124
|
+
unless hash[profile_from_resource_type(code,
|
125
|
+
referenced_resource.resourceType)].include?(referenced_resource)
|
126
|
+
hash[profile_from_resource_type(code, referenced_resource.resourceType)] << referenced_resource
|
127
|
+
end
|
128
|
+
else
|
129
|
+
unresolved_references << ref.reference
|
130
|
+
end
|
131
|
+
end
|
132
|
+
else
|
133
|
+
resource_key = CODE_TO_URL_MAP[code]
|
134
|
+
hash[resource_key] ||= []
|
135
|
+
sec.entry.each do |ref|
|
136
|
+
referenced_resource = find_resource_in_bundle(ref.reference, bundle)
|
137
|
+
unresolved_references << ref.reference unless referenced_resource
|
138
|
+
if !hash[resource_key].include?(referenced_resource) && referenced_resource
|
139
|
+
hash[resource_key] << referenced_resource
|
140
|
+
end
|
141
|
+
end
|
142
|
+
end
|
143
|
+
end
|
144
|
+
end
|
145
|
+
|
146
|
+
def multiple_reference_types?(code)
|
147
|
+
CODE_TO_MULTIPLE_ENTRY_RESOURCE_MAP.keys.include?(code)
|
148
|
+
end
|
149
|
+
|
150
|
+
def profile_from_resource_type(code, resource_type)
|
151
|
+
CODE_TO_MULTIPLE_ENTRY_RESOURCE_MAP[code][resource_type]
|
152
|
+
end
|
153
|
+
|
154
|
+
## TODO: we may have to be more comprehensive with checks for references - TBD
|
155
|
+
def find_resource_in_bundle(reference, bundle)
|
156
|
+
bundle.entry.find do |res|
|
157
|
+
res.resource.id == reference.split('/').last && res.resource.resourceType == reference.split('/').first
|
158
|
+
end&.resource
|
159
|
+
end
|
160
|
+
end
|
161
|
+
end
|
@@ -0,0 +1,134 @@
|
|
1
|
+
## Overview
|
2
|
+
|
3
|
+
The Cancer Registry Reporting EHR Test Suite verifies the
|
4
|
+
conformance of EHRs to the STU 1.0.0 version of the HL7® FHIR®
|
5
|
+
[Central Cancer Registry Reporting IG](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/).
|
6
|
+
|
7
|
+
## Scope
|
8
|
+
|
9
|
+
The primary role of an EHR in the Central Cancer Registry Reporting IG workflow is to
|
10
|
+
|
11
|
+
> support the APIs as outlined in the [EHR Capability Statement](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/CapabilityStatement-central-cancer-registry-reporting-ehr.html)
|
12
|
+
> for the HDEA [(Health Data Exchange App)] to access patient data.
|
13
|
+
|
14
|
+
The requesting HDEA then uses that data to create a report for submission to a cancer registry.
|
15
|
+
|
16
|
+
These tests support that role by verifying that the EHR can support the specified
|
17
|
+
APIs and serve up the data needed to create [central cancer registry reports](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
18
|
+
that contain the full scope of must support profiles and elements.
|
19
|
+
Per the [EHR Capability Statement](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/CapabilityStatement-central-cancer-registry-reporting-ehr.html), this includes FHIR read and search APIs for:
|
20
|
+
- US Core STU 3.1.1 profiles indicated in the [Server CapabilityStatement](https://hl7.org/fhir/us/core/STU3.1.1/CapabilityStatement-us-core-server.html)
|
21
|
+
- A subset of mCODE profiles, including
|
22
|
+
- [mCODE Primary Cancer Condition Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-primary-cancer-condition.html)
|
23
|
+
- [mCODE Secondary Cancer Condition Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-secondary-cancer-condition.html)
|
24
|
+
- [mCODE Cancer Stage Group Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-stage-group.html)
|
25
|
+
- [mCODE TNM Distant Metastases Category Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-distant-metastases-category.html)
|
26
|
+
- [mCODE TNM Primary Tumor Category Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-primary-tumor-category.html)
|
27
|
+
- [mCODE TNM Regional Nodes Category Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-regional-nodes-category.html)
|
28
|
+
- [mCODE Cancer-Related Medication Request Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-cancer-related-medication-request.html)
|
29
|
+
- [mCODE Cancer-Related Administration Request Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-cancer-related-medication-administration.html)
|
30
|
+
- [mCODE Radiotherapy Course Summary Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-radiotherapy-course-summary.html)
|
31
|
+
|
32
|
+
## Test Methodology
|
33
|
+
|
34
|
+
Inferno will simulate a FHIR client using the search and read API required by the [EHR Capability Statement](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/CapabilityStatement-central-cancer-registry-reporting-ehr.html).
|
35
|
+
Through a combination of tester input and details returned by the searches it makes, Inferno will
|
36
|
+
attempt to search for and read resources conforming to each profile. This includes:
|
37
|
+
- Testing required search parameter combinations and verifying that the results returned are appropriate.
|
38
|
+
- For each must support element, observing an instance with that element populated.
|
39
|
+
- For each must support reference element, verifying that a populated reference can be resolved.
|
40
|
+
|
41
|
+
## Running the tests
|
42
|
+
|
43
|
+
### Quick Start
|
44
|
+
|
45
|
+
The minimal amount of information Inferno needs to run these tests includes the following inputs:
|
46
|
+
- **FHIR Endpoint**: URL of the EHR's FHIR endpoint.
|
47
|
+
- **OAuth Credentials / Access Token** (optional): If needed, a token that Inferno will include in the `Authorization`
|
48
|
+
HTTP header in the form `Bearer <input value>` on each request it makes to the system under test
|
49
|
+
- **Patient IDs**: Comma separated list of patient IDs. Inferno will use these when building searches.
|
50
|
+
|
51
|
+
### Demonstration
|
52
|
+
|
53
|
+
If you would like to try out the tests using the [Inferno Reference Server](https://inferno.healthit.gov/reference-server)
|
54
|
+
([code](https://github.com/inferno-framework/inferno-reference-server)) as the system under test,
|
55
|
+
use the "Inferno Reference Server" preset. Not all of the tests are expected to pass when run against the
|
56
|
+
Inferno Reference Server.
|
57
|
+
|
58
|
+
### Additional Input Details
|
59
|
+
|
60
|
+
Inferno needs tester input for the following profiles to assist in creating a search guaranteed to return
|
61
|
+
only instances that are intended to conform to the target profile. Inferno will use these values along
|
62
|
+
with the **Patient IDs** input to create search queries used by the tests. With the exception of the
|
63
|
+
**Implantable Device Type Code** input, missing values will result in these inputs will cause the corresponding
|
64
|
+
tests to skip.
|
65
|
+
- [US Core Implantable Device Profile](https://www.hl7.org/fhir/us/core/STU3.1.1/StructureDefinition-us-core-implantable-device.html) (optional): a list of codes unqiue to this profile in input **Implantable Device Type Code**.
|
66
|
+
- [mCODE Primary Cancer Condition Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-primary-cancer-condition.html): a `category` code unique to primary cancer conditions in input **Primary Cancer Condition category**, such as the one suggested in the mCODE query `GET [base]/Condition?category=http://snomed.info/sct|372087000`
|
67
|
+
- [mCODE Secondary Cancer Condition Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-secondary-cancer-condition.html): a `category` code unique to primary cancer conditions in input **Secondary Cancer Condition category**, such as the one suggested in the mCODE query `GET [base]/Condition?category=http://snomed.info/sct|128462008`
|
68
|
+
- [mCODE TNM Distant Metastases Category Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-distant-metastases-category.html): a `code` value unique to this profile in input **TNM Distant Metastases Category code**.
|
69
|
+
- [mCODE TNM Primary Tumor Category Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-primary-tumor-category.html): a `code` value unique to this profile in input **TNM Primary Tumor Category code**.
|
70
|
+
- [mCODE TNM Regional Nodes Category Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-regional-nodes-category.html): a `code` value unique to this profile in input **TNM Regional Nodes Category code**.
|
71
|
+
- [mCODE Cancer Stage Group Profile](http://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-tnm-stage-group.html): a `code` value unique to this profile in input **TNM Stage Group code**.
|
72
|
+
|
73
|
+
## Current Limitations
|
74
|
+
|
75
|
+
### HDEA Report generation and EHR data access differences
|
76
|
+
|
77
|
+
The CCRR IG includes several inconsistencies between its specification of EHR capabilities and HDEA
|
78
|
+
capabilities, including:
|
79
|
+
- The EHR Capability Statement points to the [US Core 3.1.1 Server Capability Statement](https://hl7.org/fhir/us/core/STU3.1.1/CapabilityStatement-us-core-server.html),
|
80
|
+
while the [CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
81
|
+
created by the HDEA uses [US Core 5.0.1](https://hl7.org/fhir/us/core/STU5.0.1/)
|
82
|
+
profiles, except for Condition which uses the US Core 3.1.1 profile.
|
83
|
+
- The EHR Capability Statement requires support for US Core APIs on resource types that are not
|
84
|
+
required to be in the [CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html),
|
85
|
+
either through a direct reference or through a reference from a must support element, e.g., the
|
86
|
+
US Core Immunization profile.
|
87
|
+
- The [CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
88
|
+
requires support for profiles that are not supported within the API, such as the Occupational Data for Health (ODH)
|
89
|
+
[Usual Work profile](http://hl7.org/fhir/us/odh/STU1.1/StructureDefinition-odh-UsualWork.html)
|
90
|
+
and the [Central Cancer Registry Reporting Primary Cancer Condition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-central-cancer-registry-primary-cancer-condition.html).
|
91
|
+
|
92
|
+
Currently this EHR suite and the HDEA suite test the requirements indicated in the IG despite the mismatch
|
93
|
+
and their potential to cause interoperability issues or extra implementation burden. Future versions of
|
94
|
+
the test kit may update this approach based on community feedback and IG updates.
|
95
|
+
|
96
|
+
### Instance gathering
|
97
|
+
|
98
|
+
For some of the profiles that EHRs must support, there is not a clear search that HDEAs can perform that
|
99
|
+
will be guaranteed to return all and only instances of interest for including in a cancer report that
|
100
|
+
also need to conform to the target profile. For example, the mCODE IG specifies
|
101
|
+
[certain queries](https://hl7.org/fhir/us/mcode/STU3/conformance-general.html#support-querying-mcode-conforming-resources)
|
102
|
+
that must be supported, e.g., `GET [base]/Observation?category=http://snomed.info/sct|385356007`
|
103
|
+
to retrieve all [Cancer Stage](https://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-cancer-stage.html)
|
104
|
+
instances. However, the corresponding profile data requirements don't always match, e.g., for
|
105
|
+
[Cancer Stage](https://hl7.org/fhir/us/mcode/STU3/StructureDefinition-mcode-cancer-stage.html), the `category`
|
106
|
+
element is not required or must support within that profile and there is no mention of that specific
|
107
|
+
SNOMED code referenced in the search, which suggests that it may not be something servers choose to support.
|
108
|
+
This causes challenges for testing because if Inferno cannot perform a search for which the server will return
|
109
|
+
only instances conformant to the target profile or otherwise filter those results down to just instances that
|
110
|
+
are intended to conform to the target profile, then Inferno will not be able to determine which errors to treat
|
111
|
+
as fatal and display and which are simply an indication that the instances is not relevant to the test.
|
112
|
+
|
113
|
+
For that reason, Inferno requires testers to provide additional information that allows Inferno to construct a
|
114
|
+
query that will return only instances that are intended to conform to the target profile. Any HDEA working
|
115
|
+
with an EHR would need to be aware of such queries to allow them to gather the instances needed to create a
|
116
|
+
[central cancer registry reports](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
117
|
+
and be confident of its completeness.
|
118
|
+
|
119
|
+
As this approach places additional constraints on tested systems beyond those present in the IG, future
|
120
|
+
versions of the test kit may update this approach or the requested details for each profile as details in
|
121
|
+
the IG are clarified.
|
122
|
+
|
123
|
+
### Limited authentication and authorization options
|
124
|
+
|
125
|
+
This test suite currently provides only one option for testers to adjust the requests that Inferno makes
|
126
|
+
so that the system under test can identify Inferno as the requestor. If the **Access Token** input is populated,
|
127
|
+
the provided value will be placed in the HTTP `Authorization` header with the prefix `Bearer `.
|
128
|
+
Support for Inferno to obtain bearer tokens using SMART on FHIR workflows or other auth schemes may be added
|
129
|
+
in the future based on community feedback.
|
130
|
+
|
131
|
+
### mCODE reference resolution tests
|
132
|
+
|
133
|
+
This test suite includes must support reference element resolution tests for US Core profiles, but not for mCODE
|
134
|
+
profiles.
|
@@ -0,0 +1,108 @@
|
|
1
|
+
## Overview
|
2
|
+
The Cancer Registry Reporting HDEA Report Creation Test Suite verifies the
|
3
|
+
conformance of systems to the report generation requirements for Health Data Exchange Apps (HDEAs)
|
4
|
+
in the STU 1.0.0 version of the HL7® FHIR®
|
5
|
+
[Central Cancer Registry Reporting IG](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/).
|
6
|
+
|
7
|
+
## Scope
|
8
|
+
|
9
|
+
This test suite focuses on the report creation portion of the HDEA's role in submitting reports to central cancer
|
10
|
+
registries. Specifically, these test verify that the HDEA can generate a set of conformant and complete
|
11
|
+
[Central Cancer Registry Reporting Content Bundles](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html).
|
12
|
+
|
13
|
+
Other aspects of the HDEAs role as defined
|
14
|
+
in the IG are currently out of scope for this suite, including:
|
15
|
+
- The use of FHIR APIs to gather instances from an EHR and the use of FHIR Subscriptions to receive notifications from the EHR.
|
16
|
+
- The use of FHIR APIs to transfer reports to an intermediary or cancer registry using the MedMorph framework.
|
17
|
+
- The use of MedMorph Knowledge Artifacts.
|
18
|
+
|
19
|
+
## Test Methodology
|
20
|
+
|
21
|
+
To verify that the system under test can produce conformant and complete cancer reports, Inferno asks
|
22
|
+
the tester to provide as input a set of [Central Cancer Registry Reporting Content Bundles](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
23
|
+
generated from the system under test. Inferno will check that each Bundle in the input contains a
|
24
|
+
[Central Cancer Registry Report Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-composition.html)
|
25
|
+
and that referenced instances are conformant to the profiles required by
|
26
|
+
the Composition profile. Additionally, to verify completeness the tests check for a populated example of each
|
27
|
+
must support element designated in the Bundle and Composition profiles as well as all profiles specified in
|
28
|
+
must support reference elements on the Composition profile.
|
29
|
+
|
30
|
+
## Running the tests
|
31
|
+
|
32
|
+
### Quick Start
|
33
|
+
|
34
|
+
The minimal amount of information Inferno needs to run these tests includes the following inputs:
|
35
|
+
- **Cancer Reports**: A comma-Separated list of one or more FHIR Central Cancer Registry Reporting
|
36
|
+
Content Bundles in JSON format generated by the system under test.
|
37
|
+
|
38
|
+
Testers will need to generate one or more reports using the system they are testing, paste them into
|
39
|
+
the input in Inferno and run the tests. Inferno will evaluate the reports and provide test results.
|
40
|
+
|
41
|
+
### Demonstration
|
42
|
+
|
43
|
+
If you would like to try out the tests using example data from the CCRR IG and referenced IGs, use
|
44
|
+
the "HDEA Demo Report" preset which was created by starting with the [Central Cancer Registry Reporting Composition - Example](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/Composition-ccrr-composition-example.json.html)
|
45
|
+
and adding additional sections and references to the Composition as well as adding entries with the referenced instances.
|
46
|
+
Not all of the tests are expected to pass when run against the demo report.
|
47
|
+
|
48
|
+
## Current Limitations
|
49
|
+
|
50
|
+
### HDEA Report generation and EHR data access differences
|
51
|
+
|
52
|
+
The CCRR IG includes several inconsistencies between its specification of EHR capabilities and HDEA
|
53
|
+
capabilities, including:
|
54
|
+
- The EHR Capability Statement points to the [US Core 3.1.1 Server Capability Statement](https://hl7.org/fhir/us/core/STU3.1.1/CapabilityStatement-us-core-server.html),
|
55
|
+
while the [CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
56
|
+
created by the HDEA uses [US Core 5.0.1](https://hl7.org/fhir/us/core/STU5.0.1/)
|
57
|
+
profiles, except for Condition which uses the US Core 3.1.1 profile.
|
58
|
+
- The EHR Capability Statement requires support for US Core APIs on resource types that are not
|
59
|
+
required to be in the [CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html),
|
60
|
+
either through a direct reference or through a reference from a must support element, e.g., the
|
61
|
+
US Core Immunization profile.
|
62
|
+
- The [CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
63
|
+
requires support for profiles that are not supported within the API, such as the Occupational Data for Health (ODH)
|
64
|
+
[Usual Work profile](http://hl7.org/fhir/us/odh/STU1.1/StructureDefinition-odh-UsualWork.html)
|
65
|
+
and the [Central Cancer Registry Reporting Primary Cancer Condition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-central-cancer-registry-primary-cancer-condition.html).
|
66
|
+
|
67
|
+
It is also worth noting that the [Central Cancer Registry Reporting Primary Cancer Condition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-central-cancer-registry-primary-cancer-condition.html) leverages the [Cancer Disease Status Evidence Type Extension](http://hl7.org/fhir/us/mcode/STU4/StructureDefinition-mcode-cancer-disease-status-evidence-type.html). This element is marked must support in the profile despite being restricted for use within only Observations (not Condidtions). This means that validation and must support tests for this resource cannot both pass at once.
|
68
|
+
|
69
|
+
|
70
|
+
Currently this HDEA suite and the EHR suite test the requirements indicated in the IG despite the mismatch
|
71
|
+
and their potential to cause interoperability issues or extra implementation burden. Future versions of
|
72
|
+
the test kit may update this approach based on community feedback and IG updates.
|
73
|
+
|
74
|
+
### Extra Bundle entries
|
75
|
+
|
76
|
+
This test suite currently only checks for the presence of instances referenced from the
|
77
|
+
[CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html) and their conformance to the required profiles based on their section.
|
78
|
+
The tests do not check that
|
79
|
+
- Instances recursively referenced from these instances are also present in the Bundle (a warning is
|
80
|
+
logged that lists unresolved references).
|
81
|
+
- Recursively referenced instances that are present in the Bundle conform to the profile(s) required
|
82
|
+
by the referencing element(s).
|
83
|
+
- All must support elements for recursively referenced profiles are demonstrated.
|
84
|
+
|
85
|
+
For example the [US Core Encounter profile](https://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-encounter.html)
|
86
|
+
is referenced from the must support `encounter` element in the [CCRR Composition](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/StructureDefinition-ccrr-content-bundle.html)
|
87
|
+
and the [US Core Encounter profile](https://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-encounter.html)
|
88
|
+
requires support for the [US Core Practitioner profile](https://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-practitioner.html)
|
89
|
+
on the `participant.individual` element. This test suite does not currently test that in a
|
90
|
+
Bundle where `participant.individual` is demonstrated referencing a Practitioner that the referenced
|
91
|
+
instance is also present in the Bundle and that it conforms to the [US Core Practitioner profile](https://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-practitioner.html).
|
92
|
+
Must support elements for the [US Core Practitioner profile](https://hl7.org/fhir/us/core/STU5.0.1/StructureDefinition-us-core-practitioner.html)
|
93
|
+
also do not need to be demonstrated currently.
|
94
|
+
|
95
|
+
The CPDS IG does not explicitly require that the above requirements are met, but some or all of them are likely
|
96
|
+
to be necessary or helpful in practical applications of report exchange. Future versions
|
97
|
+
of this test suite may update this approach based on community feedback and IG updates.
|
98
|
+
|
99
|
+
### Usual Work MS Slice check by Code System
|
100
|
+
|
101
|
+
The [ODH Usual Work](http://hl7.org/fhir/us/odh/STU1.1/StructureDefinition-odh-UsualWork.html) profile includes must support slices which are bound to code systems containing large sets of codes. Given the size of these code systems, the presence of these slices is verified by checking only the code system itself, instead of the code and code system together.
|
102
|
+
|
103
|
+
### No API-based Submission
|
104
|
+
|
105
|
+
The CCRR IG refers to the MedMorph framework for submission which uses FHIR Messaging. Currently, this test suite
|
106
|
+
does not support submission of reports using this standards-based approach and instead requires manual provision of
|
107
|
+
the reports using Inferno inputs. Future versions may include support for FHIR Messaging or other approaches
|
108
|
+
to submission.
|
@@ -0,0 +1,40 @@
|
|
1
|
+
# rubocop:disable Lint/RedundantCopDisableDirective
|
2
|
+
# rubocop:disable Layout/HeredocIndentation
|
3
|
+
module CancerRegistryReportingTestKit
|
4
|
+
class MCodeCapabilityStatementProfileSupport < Inferno::Test
|
5
|
+
title 'Capability Statement lists support for required mCODE Profiles'
|
6
|
+
description <<~DESCRIPTION
|
7
|
+
This test verifies that the list of implemented profiles in the server's CapabilityStatement
|
8
|
+
includes the [required mCODE profiles](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/spec.html#mcode-fhir-ig-usage).
|
9
|
+
DESCRIPTION
|
10
|
+
id :ccrr_mcode_capability_statement_profile_support
|
11
|
+
|
12
|
+
uses_request :capability_statement
|
13
|
+
run do
|
14
|
+
assert_resource_type(:capability_statement)
|
15
|
+
capability_statement = resource
|
16
|
+
|
17
|
+
supported_profiles = capability_statement.rest&.flat_map do |rest|
|
18
|
+
rest.resource.flat_map do |resource|
|
19
|
+
# Remove trailing version from canonical url
|
20
|
+
resource.supportedProfile&.map { |profile| profile.split('|').first }
|
21
|
+
end.compact
|
22
|
+
end&.uniq || []
|
23
|
+
|
24
|
+
required_profiles = config.options[:required_profiles]
|
25
|
+
|
26
|
+
missing_profiles = required_profiles - supported_profiles
|
27
|
+
|
28
|
+
missing_profiles_list =
|
29
|
+
missing_profiles
|
30
|
+
.map { |resource| "`#{resource}`" }
|
31
|
+
.join(', ')
|
32
|
+
|
33
|
+
assert missing_profiles.empty?,
|
34
|
+
'The CapabilityStatement does not list support for the following ' \
|
35
|
+
"profiles: #{missing_profiles_list}"
|
36
|
+
end
|
37
|
+
end
|
38
|
+
end
|
39
|
+
# rubocop:enable Layout/HeredocIndentation
|
40
|
+
# rubocop:enable Lint/RedundantCopDisableDirective
|
@@ -0,0 +1,131 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'inferno/dsl/oauth_credentials'
|
4
|
+
require 'us_core_test_kit'
|
5
|
+
|
6
|
+
require_relative 'ehr_capability_statement/mcode_capability_statement_profile_support'
|
7
|
+
require_relative 'mcode_data_access_resources/primary_cancer_condition_group'
|
8
|
+
require_relative 'mcode_data_access_resources/secondary_cancer_condition_group'
|
9
|
+
require_relative 'mcode_data_access_resources/medication_request_group'
|
10
|
+
require_relative 'mcode_data_access_resources/medication_administration_group'
|
11
|
+
require_relative 'mcode_data_access_resources/medication_administration/medication_administration_must_support_test'
|
12
|
+
require_relative 'mcode_data_access_resources/tnm_distant_metastases_category_group'
|
13
|
+
require_relative 'mcode_data_access_resources/tnm_primary_tumor_category_group'
|
14
|
+
require_relative 'mcode_data_access_resources/tnm_regional_nodes_category_group'
|
15
|
+
require_relative 'mcode_data_access_resources/tnm_stage_group_group'
|
16
|
+
require_relative 'mcode_data_access_resources/radiotherapy_procedure_group'
|
17
|
+
|
18
|
+
module CancerRegistryReportingTestKit
|
19
|
+
class EHRDataAccessGroup < Inferno::TestGroup
|
20
|
+
id :ccrr_ehr_data_access
|
21
|
+
title 'EHR Data Access Group'
|
22
|
+
short_description 'Verify that cancer patient data are available via US Core and mCODE APIs.'
|
23
|
+
description %(
|
24
|
+
During these tests, Inferno will simulate a FHIR client and verify that it can use the EHR's FHIR APIs
|
25
|
+
to access patient data including both the [US Core](http://hl7.org/fhir/us/core/STU3.1.1/index.html)
|
26
|
+
as well as [mCODE](https://hl7.org/fhir/us/mcode/STU3/index.html) data as specified by the
|
27
|
+
[Central Cancer Registry IG v1.0.0](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/).
|
28
|
+
)
|
29
|
+
|
30
|
+
M_CODE_PROFILES = {
|
31
|
+
'Condition' => [
|
32
|
+
'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-secondary-cancer-condition',
|
33
|
+
'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-primary-cancer-condition'
|
34
|
+
].freeze,
|
35
|
+
'MedicationAdministration' => ['http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-related-medication-administration'].freeze,
|
36
|
+
'MedicationRequest' => ['http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-cancer-related-medication-request'].freeze,
|
37
|
+
'Observation' => [
|
38
|
+
'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-stage-group',
|
39
|
+
'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-distant-metastases-category',
|
40
|
+
'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-primary-tumor-category',
|
41
|
+
'http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-tnm-regional-nodes-category'
|
42
|
+
].freeze,
|
43
|
+
'Procedure' => ['http://hl7.org/fhir/us/mcode/StructureDefinition/mcode-radiotherapy-course-summary'].freeze
|
44
|
+
}.freeze
|
45
|
+
|
46
|
+
input :url,
|
47
|
+
title: 'FHIR Endpoint',
|
48
|
+
description: 'URL of the EHR\'s FHIR endpoint'
|
49
|
+
|
50
|
+
input :smart_credentials,
|
51
|
+
title: 'OAuth Credentials',
|
52
|
+
type: :oauth_credentials,
|
53
|
+
optional: true
|
54
|
+
|
55
|
+
fhir_client do
|
56
|
+
url :url
|
57
|
+
oauth_credentials :smart_credentials
|
58
|
+
end
|
59
|
+
|
60
|
+
verifies_requirements 'hl7.fhir.us.central-cancer-registry-reporting_1.0.0@1',
|
61
|
+
'hl7.fhir.us.central-cancer-registry-reporting_1.0.0@31',
|
62
|
+
'hl7.fhir.us.central-cancer-registry-reporting_1.0.0@54',
|
63
|
+
'hl7.fhir.us.mcode_3.0.0@107',
|
64
|
+
'hl7.fhir.us.mcode_3.0.0@108',
|
65
|
+
'hl7.fhir.us.mcode_3.0.0@109',
|
66
|
+
'hl7.fhir.us.mcode_3.0.0@110'
|
67
|
+
|
68
|
+
group from: :us_core_v311_capability_statement do
|
69
|
+
test from: :ccrr_mcode_capability_statement_profile_support do
|
70
|
+
config(
|
71
|
+
options: { required_profiles: [M_CODE_PROFILES.values].flatten }
|
72
|
+
)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
group do
|
77
|
+
title 'US Core FHIR API'
|
78
|
+
id :ccrr_us_core_fhir_api
|
79
|
+
|
80
|
+
verifies_requirements 'hl7.fhir.us.central-cancer-registry-reporting_1.0.0@34',
|
81
|
+
'hl7.fhir.us.central-cancer-registry-reporting_1.0.0@43'
|
82
|
+
group from: :us_core_v311_patient, title: 'Patient'
|
83
|
+
group from: :us_core_v311_allergy_intolerance, title: 'AllergyIntolerance'
|
84
|
+
group from: :us_core_v311_care_plan, title: 'CarePlan'
|
85
|
+
group from: :us_core_v311_care_team, title: 'CareTeam'
|
86
|
+
group from: :us_core_v311_condition, title: 'Condition'
|
87
|
+
group from: :us_core_v311_device, title: 'Device'
|
88
|
+
group from: :us_core_v311_diagnostic_report_note, title: 'DiagnosticReport for Report and Note Exchange'
|
89
|
+
group from: :us_core_v311_diagnostic_report_lab, title: 'DiagnosticReport for Laboratory Results Reporting'
|
90
|
+
group from: :us_core_v311_document_reference, title: 'DocumentReference'
|
91
|
+
group from: :us_core_v311_goal, title: 'Goal'
|
92
|
+
group from: :us_core_v311_immunization, title: 'Immunization'
|
93
|
+
group from: :us_core_v311_medication_request, title: 'MedicationRequest'
|
94
|
+
group from: :us_core_v311_smokingstatus, title: 'Smoking Status Observation'
|
95
|
+
group from: :us_core_v311_pediatric_weight_for_height, title: 'Pediatric Weight for Height Observation'
|
96
|
+
group from: :us_core_v311_observation_lab, title: 'Laboratory Result Observation'
|
97
|
+
group from: :us_core_v311_pediatric_bmi_for_age, title: 'Pediatric BMI for Age Observation'
|
98
|
+
group from: :us_core_v311_pulse_oximetry, title: 'Pulse Oximetry Observation'
|
99
|
+
group from: :us_core_v311_head_circumference, title: 'Pediatric Head Occipital-frontal Circumference Percentile Observation'
|
100
|
+
group from: :us_core_v311_bodyheight, title: 'Body Height Observation'
|
101
|
+
group from: :us_core_v311_bodytemp, title: 'Body Temperature Observation'
|
102
|
+
group from: :us_core_v311_bp, title: 'Blood Pressure Observation'
|
103
|
+
group from: :us_core_v311_bodyweight, title: 'Body Weight Observation'
|
104
|
+
group from: :us_core_v311_heartrate, title: 'Heart Rate Observation'
|
105
|
+
group from: :us_core_v311_resprate, title: 'Respiratory Rate Observation'
|
106
|
+
group from: :us_core_v311_procedure, title: 'Procedure'
|
107
|
+
group from: :us_core_v311_encounter, title: 'Encounter'
|
108
|
+
group from: :us_core_v311_organization, title: 'Organization'
|
109
|
+
group from: :us_core_v311_practitioner, title: 'Practitioner'
|
110
|
+
group from: :us_core_v311_provenance, title: 'Provenance'
|
111
|
+
group from: :us_core_311_data_absent_reason, title: 'Missing Data'
|
112
|
+
end
|
113
|
+
|
114
|
+
group do
|
115
|
+
title 'mCODE FHIR API'
|
116
|
+
id :ccrr_mcode_fhir_api
|
117
|
+
|
118
|
+
verifies_requirements 'hl7.fhir.us.central-cancer-registry-reporting_1.0.0@35'
|
119
|
+
|
120
|
+
group from: :ccrr_ehr_primary_cancer_condition
|
121
|
+
group from: :ccrr_ehr_secondary_cancer_condition
|
122
|
+
group from: :ccrr_ehr_medication_request
|
123
|
+
group from: :ccrr_ehr_medication_administration
|
124
|
+
group from: :ccrr_ehr_tnm_distant_metastases_category
|
125
|
+
group from: :ccrr_ehr_tnm_primary_tumor_category
|
126
|
+
group from: :ccrr_ehr_tnm_regional_nodes_category
|
127
|
+
group from: :ccrr_ehr_tnm_stage_group
|
128
|
+
group from: :ccrr_ehr_radiotherapy_procedure
|
129
|
+
end
|
130
|
+
end
|
131
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative '../../../must_support_test'
|
4
|
+
|
5
|
+
module CancerRegistryReportingTestKit
|
6
|
+
class MedicationAdministrationMustSupportTest < Inferno::Test
|
7
|
+
include USCoreTestKit::MustSupportTest
|
8
|
+
|
9
|
+
title 'All must support elements are provided in the mCODE Cancer-Related MedicationAdministration 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 MedicationAdministration resources
|
13
|
+
found previously for the following must support elements:
|
14
|
+
|
15
|
+
* MedicationAdministration.effective[x]
|
16
|
+
* MedicationAdministration.extension:treatmentIntent
|
17
|
+
* MedicationAdministration.medication[x]
|
18
|
+
* MedicationAdministration.reasonCode
|
19
|
+
* MedicationAdministration.reasonReference
|
20
|
+
* MedicationAdministration.status
|
21
|
+
* MedicationAdministration.statusReason
|
22
|
+
* MedicationAdministration.subject
|
23
|
+
)
|
24
|
+
|
25
|
+
id :ccrr_medication_administration_must_support_test
|
26
|
+
|
27
|
+
def resource_type
|
28
|
+
'MedicationAdministration'
|
29
|
+
end
|
30
|
+
|
31
|
+
def self.metadata
|
32
|
+
@metadata ||= HdeaGenerator::GroupMetadata.new(YAML.load_file(File.join(__dir__, 'metadata.yml'), aliases: true))
|
33
|
+
end
|
34
|
+
|
35
|
+
def scratch_resources
|
36
|
+
scratch[:medication_administration_resources] ||= {}
|
37
|
+
end
|
38
|
+
|
39
|
+
run do
|
40
|
+
perform_must_support_test(all_scratch_resources)
|
41
|
+
end
|
42
|
+
end
|
43
|
+
end
|