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
data/lib/cancer_registry_reporting_test_kit/igs/package/xml/StructureDefinition-us-ph-patient.sch
ADDED
@@ -0,0 +1,217 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
3
|
+
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
4
|
+
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
5
|
+
<!--
|
6
|
+
This file contains just the constraints for the profile USCorePatientProfile
|
7
|
+
It includes the base constraints for the resource as well.
|
8
|
+
Because of the way that schematrons and containment work,
|
9
|
+
you may need to use this schematron fragment to build a,
|
10
|
+
single schematron that validates contained resources (if you have any)
|
11
|
+
-->
|
12
|
+
<sch:pattern>
|
13
|
+
<sch:title>f:Patient</sch:title>
|
14
|
+
<sch:rule context="f:Patient">
|
15
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race']) <= 1">extension with URL = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-race': maximum cardinality of 'extension' is 1</sch:assert>
|
16
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity']) <= 1">extension with URL = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-ethnicity': maximum cardinality of 'extension' is 1</sch:assert>
|
17
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex']) <= 1">extension with URL = 'http://hl7.org/fhir/us/core/StructureDefinition/us-core-birthsex': maximum cardinality of 'extension' is 1</sch:assert>
|
18
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/patient-birthPlace']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/patient-birthPlace': maximum cardinality of 'extension' is 1</sch:assert>
|
19
|
+
<sch:assert test="count(f:birthDate) >= 1">birthDate: minimum cardinality of 'birthDate' is 1</sch:assert>
|
20
|
+
<sch:assert test="count(f:address) >= 1">address: minimum cardinality of 'address' is 1</sch:assert>
|
21
|
+
</sch:rule>
|
22
|
+
</sch:pattern>
|
23
|
+
<sch:pattern>
|
24
|
+
<sch:title>f:Patient/f:identifier</sch:title>
|
25
|
+
<sch:rule context="f:Patient/f:identifier">
|
26
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
27
|
+
</sch:rule>
|
28
|
+
</sch:pattern>
|
29
|
+
<sch:pattern>
|
30
|
+
<sch:title>f:Patient/f:identifier/f:extension</sch:title>
|
31
|
+
<sch:rule context="f:Patient/f:identifier/f:extension">
|
32
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
33
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
34
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
35
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
36
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
37
|
+
</sch:rule>
|
38
|
+
</sch:pattern>
|
39
|
+
<sch:pattern>
|
40
|
+
<sch:title>f:Patient/f:name</sch:title>
|
41
|
+
<sch:rule context="f:Patient/f:name">
|
42
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
43
|
+
</sch:rule>
|
44
|
+
</sch:pattern>
|
45
|
+
<sch:pattern>
|
46
|
+
<sch:title>f:Patient/f:name/f:extension</sch:title>
|
47
|
+
<sch:rule context="f:Patient/f:name/f:extension">
|
48
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
49
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
50
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
51
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
52
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
53
|
+
</sch:rule>
|
54
|
+
</sch:pattern>
|
55
|
+
<sch:pattern>
|
56
|
+
<sch:title>f:Patient/f:telecom</sch:title>
|
57
|
+
<sch:rule context="f:Patient/f:telecom">
|
58
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
59
|
+
</sch:rule>
|
60
|
+
</sch:pattern>
|
61
|
+
<sch:pattern>
|
62
|
+
<sch:title>f:Patient/f:telecom/f:extension</sch:title>
|
63
|
+
<sch:rule context="f:Patient/f:telecom/f:extension">
|
64
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
65
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
66
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
67
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
68
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
69
|
+
</sch:rule>
|
70
|
+
</sch:pattern>
|
71
|
+
<sch:pattern>
|
72
|
+
<sch:title>f:Patient/f:gender</sch:title>
|
73
|
+
<sch:rule context="f:Patient/f:gender">
|
74
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
75
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
76
|
+
<sch:assert test="count(f:value) <= 1">value: maximum cardinality of 'value' is 1</sch:assert>
|
77
|
+
</sch:rule>
|
78
|
+
</sch:pattern>
|
79
|
+
<sch:pattern>
|
80
|
+
<sch:title>f:Patient/f:gender/f:extension</sch:title>
|
81
|
+
<sch:rule context="f:Patient/f:gender/f:extension">
|
82
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
83
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
84
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
85
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
86
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
87
|
+
</sch:rule>
|
88
|
+
</sch:pattern>
|
89
|
+
<sch:pattern>
|
90
|
+
<sch:title>f:Patient/f:birthDate</sch:title>
|
91
|
+
<sch:rule context="f:Patient/f:birthDate">
|
92
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
93
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
94
|
+
<sch:assert test="count(f:value) <= 1">value: maximum cardinality of 'value' is 1</sch:assert>
|
95
|
+
</sch:rule>
|
96
|
+
</sch:pattern>
|
97
|
+
<sch:pattern>
|
98
|
+
<sch:title>f:Patient/f:birthDate/f:extension</sch:title>
|
99
|
+
<sch:rule context="f:Patient/f:birthDate/f:extension">
|
100
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
101
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
102
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
103
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
104
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
105
|
+
</sch:rule>
|
106
|
+
</sch:pattern>
|
107
|
+
<sch:pattern>
|
108
|
+
<sch:title>f:Patient/f:address</sch:title>
|
109
|
+
<sch:rule context="f:Patient/f:address">
|
110
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
111
|
+
</sch:rule>
|
112
|
+
</sch:pattern>
|
113
|
+
<sch:pattern>
|
114
|
+
<sch:title>f:Patient/f:address/f:extension</sch:title>
|
115
|
+
<sch:rule context="f:Patient/f:address/f:extension">
|
116
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
117
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
118
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
119
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
120
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
121
|
+
</sch:rule>
|
122
|
+
</sch:pattern>
|
123
|
+
<sch:pattern>
|
124
|
+
<sch:title>f:Patient/f:contact</sch:title>
|
125
|
+
<sch:rule context="f:Patient/f:contact">
|
126
|
+
<sch:assert test="count(f:relationship) >= 1">relationship: minimum cardinality of 'relationship' is 1</sch:assert>
|
127
|
+
<sch:assert test="count(f:relationship) <= 1">relationship: maximum cardinality of 'relationship' is 1</sch:assert>
|
128
|
+
</sch:rule>
|
129
|
+
</sch:pattern>
|
130
|
+
<sch:pattern>
|
131
|
+
<sch:title>f:Patient/f:contact/f:name</sch:title>
|
132
|
+
<sch:rule context="f:Patient/f:contact/f:name">
|
133
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
134
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
135
|
+
<sch:assert test="count(f:use) <= 1">use: maximum cardinality of 'use' is 1</sch:assert>
|
136
|
+
<sch:assert test="count(f:text) <= 1">text: maximum cardinality of 'text' is 1</sch:assert>
|
137
|
+
<sch:assert test="count(f:family) <= 1">family: maximum cardinality of 'family' is 1</sch:assert>
|
138
|
+
<sch:assert test="count(f:period) <= 1">period: maximum cardinality of 'period' is 1</sch:assert>
|
139
|
+
</sch:rule>
|
140
|
+
</sch:pattern>
|
141
|
+
<sch:pattern>
|
142
|
+
<sch:title>f:Patient/f:contact/f:name/f:extension</sch:title>
|
143
|
+
<sch:rule context="f:Patient/f:contact/f:name/f:extension">
|
144
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
145
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
146
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
147
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
148
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
149
|
+
</sch:rule>
|
150
|
+
</sch:pattern>
|
151
|
+
<sch:pattern>
|
152
|
+
<sch:title>f:Patient/f:contact/f:telecom</sch:title>
|
153
|
+
<sch:rule context="f:Patient/f:contact/f:telecom">
|
154
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
155
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
156
|
+
<sch:assert test="count(f:system) <= 1">system: maximum cardinality of 'system' is 1</sch:assert>
|
157
|
+
<sch:assert test="count(f:value) <= 1">value: maximum cardinality of 'value' is 1</sch:assert>
|
158
|
+
<sch:assert test="count(f:use) <= 1">use: maximum cardinality of 'use' is 1</sch:assert>
|
159
|
+
<sch:assert test="count(f:rank) <= 1">rank: maximum cardinality of 'rank' is 1</sch:assert>
|
160
|
+
<sch:assert test="count(f:period) <= 1">period: maximum cardinality of 'period' is 1</sch:assert>
|
161
|
+
</sch:rule>
|
162
|
+
</sch:pattern>
|
163
|
+
<sch:pattern>
|
164
|
+
<sch:title>f:Patient/f:contact/f:telecom/f:extension</sch:title>
|
165
|
+
<sch:rule context="f:Patient/f:contact/f:telecom/f:extension">
|
166
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
167
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
168
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
169
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
170
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
171
|
+
</sch:rule>
|
172
|
+
</sch:pattern>
|
173
|
+
<sch:pattern>
|
174
|
+
<sch:title>f:Patient/f:contact/f:address</sch:title>
|
175
|
+
<sch:rule context="f:Patient/f:contact/f:address">
|
176
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
177
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
178
|
+
<sch:assert test="count(f:use) <= 1">use: maximum cardinality of 'use' is 1</sch:assert>
|
179
|
+
<sch:assert test="count(f:type) <= 1">type: maximum cardinality of 'type' is 1</sch:assert>
|
180
|
+
<sch:assert test="count(f:text) <= 1">text: maximum cardinality of 'text' is 1</sch:assert>
|
181
|
+
<sch:assert test="count(f:city) <= 1">city: maximum cardinality of 'city' is 1</sch:assert>
|
182
|
+
<sch:assert test="count(f:district) <= 1">district: maximum cardinality of 'district' is 1</sch:assert>
|
183
|
+
<sch:assert test="count(f:state) <= 1">state: maximum cardinality of 'state' is 1</sch:assert>
|
184
|
+
<sch:assert test="count(f:postalCode) <= 1">postalCode: maximum cardinality of 'postalCode' is 1</sch:assert>
|
185
|
+
<sch:assert test="count(f:country) <= 1">country: maximum cardinality of 'country' is 1</sch:assert>
|
186
|
+
<sch:assert test="count(f:period) <= 1">period: maximum cardinality of 'period' is 1</sch:assert>
|
187
|
+
</sch:rule>
|
188
|
+
</sch:pattern>
|
189
|
+
<sch:pattern>
|
190
|
+
<sch:title>f:Patient/f:contact/f:address/f:extension</sch:title>
|
191
|
+
<sch:rule context="f:Patient/f:contact/f:address/f:extension">
|
192
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
193
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
194
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
195
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
196
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
197
|
+
</sch:rule>
|
198
|
+
</sch:pattern>
|
199
|
+
<sch:pattern>
|
200
|
+
<sch:title>f:Patient/f:communication/f:language</sch:title>
|
201
|
+
<sch:rule context="f:Patient/f:communication/f:language">
|
202
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
203
|
+
<sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason']) <= 1">extension with URL = 'http://hl7.org/fhir/StructureDefinition/data-absent-reason': maximum cardinality of 'extension' is 1</sch:assert>
|
204
|
+
<sch:assert test="count(f:text) <= 1">text: maximum cardinality of 'text' is 1</sch:assert>
|
205
|
+
</sch:rule>
|
206
|
+
</sch:pattern>
|
207
|
+
<sch:pattern>
|
208
|
+
<sch:title>f:Patient/f:communication/f:language/f:extension</sch:title>
|
209
|
+
<sch:rule context="f:Patient/f:communication/f:language/f:extension">
|
210
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
211
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
212
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
213
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
214
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
215
|
+
</sch:rule>
|
216
|
+
</sch:pattern>
|
217
|
+
</sch:schema>
|
@@ -0,0 +1,36 @@
|
|
1
|
+
<?xml version="1.0" encoding="UTF-8"?>
|
2
|
+
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
|
3
|
+
<sch:ns prefix="f" uri="http://hl7.org/fhir"/>
|
4
|
+
<sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
|
5
|
+
<!--
|
6
|
+
This file contains just the constraints for the profile Extension
|
7
|
+
It includes the base constraints for the resource as well.
|
8
|
+
Because of the way that schematrons and containment work,
|
9
|
+
you may need to use this schematron fragment to build a,
|
10
|
+
single schematron that validates contained resources (if you have any)
|
11
|
+
-->
|
12
|
+
<sch:pattern>
|
13
|
+
<sch:title>f:Extension</sch:title>
|
14
|
+
<sch:rule context="f:Extension">
|
15
|
+
<sch:assert test="count(f:extension[@url = 'TribeName']) >= 1">extension with URL = 'TribeName': minimum cardinality of 'extension' is 1</sch:assert>
|
16
|
+
<sch:assert test="count(f:extension[@url = 'TribeName']) <= 1">extension with URL = 'TribeName': maximum cardinality of 'extension' is 1</sch:assert>
|
17
|
+
<sch:assert test="count(f:extension[@url = 'EnrolledTribeMember']) <= 1">extension with URL = 'EnrolledTribeMember': maximum cardinality of 'extension' is 1</sch:assert>
|
18
|
+
<sch:assert test="count(f:value[x]) <= 0">value[x]: maximum cardinality of 'value[x]' is 0</sch:assert>
|
19
|
+
</sch:rule>
|
20
|
+
</sch:pattern>
|
21
|
+
<sch:pattern>
|
22
|
+
<sch:title>f:Extension/f:extension</sch:title>
|
23
|
+
<sch:rule context="f:Extension/f:extension">
|
24
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
25
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
26
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
27
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
28
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
29
|
+
<sch:assert test="count(f:id) <= 1">id: maximum cardinality of 'id' is 1</sch:assert>
|
30
|
+
<sch:assert test="count(f:url) >= 1">url: minimum cardinality of 'url' is 1</sch:assert>
|
31
|
+
<sch:assert test="count(f:url) <= 1">url: maximum cardinality of 'url' is 1</sch:assert>
|
32
|
+
<sch:assert test="count(f:value[x]) >= 1">value[x]: minimum cardinality of 'value[x]' is 1</sch:assert>
|
33
|
+
<sch:assert test="count(f:value[x]) <= 1">value[x]: maximum cardinality of 'value[x]' is 1</sch:assert>
|
34
|
+
</sch:rule>
|
35
|
+
</sch:pattern>
|
36
|
+
</sch:schema>
|
@@ -0,0 +1,71 @@
|
|
1
|
+
require_relative 'version'
|
2
|
+
|
3
|
+
module CancerRegistryReportingTestKit
|
4
|
+
class Metadata < Inferno::TestKit
|
5
|
+
id :cancer_registry_reporting_test_kit
|
6
|
+
title 'Central Cancer Registry Reporting IG Test Kit'
|
7
|
+
description <<~DESCRIPTION
|
8
|
+
|
9
|
+
The Central Cancer Registry Reporting (CCRR) Test Kit is a testing tool for Health IT systems
|
10
|
+
seeking to meet the requirements of the STU 1.0.0 version of the HL7® FHIR®
|
11
|
+
[Central Cancer Registry Reporting IG](https://hl7.org/fhir/us/central-cancer-registry-reporting/STU1/).
|
12
|
+
|
13
|
+
<!-- break -->
|
14
|
+
|
15
|
+
This test kit currently contains suites that verify the conformance of systems playing the following roles:
|
16
|
+
- **Health Data Exchange App (HDEA) Report Generator**: Verifies that the Health IT system can generate
|
17
|
+
conformant and complete reports to send to a cancer registry.
|
18
|
+
- **Electronic Health Record (EHR) Data Source**: Verifies that the Health IT system can respond to queries
|
19
|
+
for the data needed to create a cancer registry report.
|
20
|
+
|
21
|
+
## Status
|
22
|
+
|
23
|
+
These tests are a **DRAFT** intended to allow CCRR IG implementers to
|
24
|
+
perform preliminary checks of their implementations against the IG's requirements and provide feedback
|
25
|
+
on the tests. Future versions of these tests may validate other requirements and may change how these
|
26
|
+
are tested.
|
27
|
+
|
28
|
+
## Known Limitations
|
29
|
+
|
30
|
+
This test kit does not currently include test suites for all actors and all capabilities defined by the CCRR IG.
|
31
|
+
Out of scope areas of the IG include the Cancer Registry and Trusted Third Party actors and details related to the use of the
|
32
|
+
[MedMorph framework](https://hl7.org/fhir/us/medmorph/STU1/) by all actors to coordinate reporting triggering,
|
33
|
+
report content, and report delivery requirements.
|
34
|
+
|
35
|
+
The existing HDEA and EHR suites focus on report content and do not currently test most details of
|
36
|
+
the report exchange workflow. The following areas are not tested:
|
37
|
+
- EHR requirements around authentication and authorization and the use of Subscriptions to provide
|
38
|
+
notifications to HDEAs.
|
39
|
+
- HDEA requirements around the gathering of report contents from EHRs and the delivery of completed reports
|
40
|
+
using FHIR APIs.
|
41
|
+
|
42
|
+
For additional details on suite-specific limitations, see the suite documention in the running tests or the
|
43
|
+
corresponding content in the source repository ([EHR suite limitations](https://github.com/inferno-framework/cancer-registry-reporting-test-kit/blob/main/lib/cancer_registry_reporting_test_kit/docs/ehr_suite_description.md#current-limitations),
|
44
|
+
[HDEA suite limitations](https://github.com/inferno-framework/cancer-registry-reporting-test-kit/blob/main/lib/cancer_registry_reporting_test_kit/docs/hdea_suite_description.md#current-limitations))
|
45
|
+
|
46
|
+
## Repository and Resources
|
47
|
+
|
48
|
+
The Central Cancer Registry Reporting Test Kit can be [downloaded](https://github.com/inferno-framework/cancer-registry-reporting-test-kit/releases)
|
49
|
+
from its [GitHub repository](https://github.com/inferno-framework/cancer-registry-reporting-test-kit).
|
50
|
+
|
51
|
+
## Providing Feedback and Reporting Issues
|
52
|
+
|
53
|
+
We welcome feedback on the tests, including but not limited to the following areas:
|
54
|
+
- Validation logic, such as potential bugs, lax checks, and unexpected failures.
|
55
|
+
- Requirements coverage, such as requirements that have been missed, tests that necessitate features that the
|
56
|
+
IG does not require, or other issues with the interpretation of the IG’s requirements.
|
57
|
+
- User experience, such as confusing or missing information in the test UI.
|
58
|
+
|
59
|
+
Please report any issues with this set of tests in the [issues section](https://github.com/inferno-framework/cancer-registry-reporting-test-kit/issues)
|
60
|
+
of the repository.
|
61
|
+
|
62
|
+
DESCRIPTION
|
63
|
+
suite_ids [:ccrr_v100_report_generation, :ccrr_ehr]
|
64
|
+
tags []
|
65
|
+
last_updated LAST_UPDATED
|
66
|
+
version VERSION
|
67
|
+
maturity 'Low'
|
68
|
+
authors ['MITRE Inferno Team']
|
69
|
+
repo 'https://github.com/inferno-framework/cancer-registry-reporting-test-kit'
|
70
|
+
end
|
71
|
+
end
|
@@ -0,0 +1,263 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require_relative 'fhir_resource_navigation'
|
4
|
+
require_relative 'bundle_parse'
|
5
|
+
|
6
|
+
module CancerRegistryReportingTestKit
|
7
|
+
module MustSupportTest
|
8
|
+
extend Forwardable
|
9
|
+
include FHIRResourceNavigation
|
10
|
+
include HDEABundleParse
|
11
|
+
|
12
|
+
def_delegators 'self.class', :metadata
|
13
|
+
|
14
|
+
def all_scratch_resources
|
15
|
+
scratch_resources[:all]
|
16
|
+
end
|
17
|
+
|
18
|
+
def perform_must_support_test(resources)
|
19
|
+
skip_if resources.blank?, "No #{resource_type} resources were found"
|
20
|
+
|
21
|
+
missing_elements(resources)
|
22
|
+
missing_slices(resources)
|
23
|
+
missing_extensions(resources)
|
24
|
+
|
25
|
+
handle_must_support_choices if metadata.must_supports[:choices].present?
|
26
|
+
|
27
|
+
skip_if (missing_elements + missing_slices + missing_extensions).present?,
|
28
|
+
"Could not find #{missing_must_support_strings.join(', ')} in the #{resources.length} " \
|
29
|
+
"provided #{resource_type} resource(s)"
|
30
|
+
end
|
31
|
+
|
32
|
+
def handle_must_support_choices
|
33
|
+
missing_elements.delete_if do |element|
|
34
|
+
choices = metadata.must_supports[:choices].find { |choice| choice[:paths]&.include?(element[:path]) }
|
35
|
+
is_any_choice_supported?(choices)
|
36
|
+
end
|
37
|
+
|
38
|
+
missing_extensions.delete_if do |extension|
|
39
|
+
choices = metadata.must_supports[:choices].find { |choice| choice[:extension_ids]&.include?(extension[:id]) }
|
40
|
+
is_any_choice_supported?(choices)
|
41
|
+
end
|
42
|
+
|
43
|
+
missing_slices.delete_if do |slice|
|
44
|
+
choices = metadata.must_supports[:choices].find { |choice| choice[:slice_names]&.include?(slice[:name]) }
|
45
|
+
is_any_choice_supported?(choices)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def is_any_choice_supported?(choices)
|
50
|
+
choices.present? &&
|
51
|
+
(
|
52
|
+
choices[:paths]&.any? { |path| missing_elements.none? { |element| element[:path] == path } } ||
|
53
|
+
choices[:extension_ids]&.any? do |extension_id|
|
54
|
+
missing_extensions.none? do |extension|
|
55
|
+
extension[:id] == extension_id
|
56
|
+
end
|
57
|
+
end ||
|
58
|
+
choices[:slice_names]&.any? { |slice_name| missing_slices.none? { |slice| slice[:name] == slice_name } }
|
59
|
+
)
|
60
|
+
end
|
61
|
+
|
62
|
+
def missing_must_support_strings
|
63
|
+
missing_elements.map { |element_definition| missing_element_string(element_definition) } +
|
64
|
+
missing_slices.map { |slice_definition| slice_definition[:slice_id] } +
|
65
|
+
missing_extensions.map { |extension_definition| extension_definition[:id] }
|
66
|
+
end
|
67
|
+
|
68
|
+
def missing_element_string(element_definition)
|
69
|
+
if element_definition[:fixed_value].present?
|
70
|
+
"#{element_definition[:path]}:#{element_definition[:fixed_value]}"
|
71
|
+
else
|
72
|
+
element_definition[:path]
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def exclude_uscdi_only_test?
|
77
|
+
config.options[:exclude_uscdi_only_test] == true
|
78
|
+
end
|
79
|
+
|
80
|
+
def must_support_extensions
|
81
|
+
if exclude_uscdi_only_test?
|
82
|
+
metadata.must_supports[:extensions].reject { |extension| extension[:uscdi_only] }
|
83
|
+
else
|
84
|
+
metadata.must_supports[:extensions]
|
85
|
+
end
|
86
|
+
end
|
87
|
+
|
88
|
+
def missing_extensions(resources = [])
|
89
|
+
@missing_extensions ||=
|
90
|
+
must_support_extensions.select do |extension_definition|
|
91
|
+
resources.none? do |resource|
|
92
|
+
path = extension_definition[:path]
|
93
|
+
|
94
|
+
if path == 'extension'
|
95
|
+
resource.extension.any? { |extension| extension.url == extension_definition[:url] }
|
96
|
+
else
|
97
|
+
extension = find_a_value_at(resource, path) do |el|
|
98
|
+
el.url == extension_definition[:url]
|
99
|
+
end
|
100
|
+
|
101
|
+
extension.present?
|
102
|
+
end
|
103
|
+
end
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
def must_support_elements
|
108
|
+
if exclude_uscdi_only_test?
|
109
|
+
metadata.must_supports[:elements].reject { |element| element[:uscdi_only] }
|
110
|
+
else
|
111
|
+
metadata.must_supports[:elements]
|
112
|
+
end
|
113
|
+
end
|
114
|
+
|
115
|
+
def missing_elements(resources = [])
|
116
|
+
@missing_elements ||= find_missing_elements(resources, must_support_elements)
|
117
|
+
@missing_elements
|
118
|
+
end
|
119
|
+
|
120
|
+
def find_missing_elements(resources, must_support_elements)
|
121
|
+
must_support_elements.select do |element_definition|
|
122
|
+
resources.none? do |resource|
|
123
|
+
path = element_definition[:path]
|
124
|
+
ms_extension_urls = must_support_extensions.select { |ex| ex[:path] == "#{path}.extension" }
|
125
|
+
.map { |ex| ex[:url] }
|
126
|
+
|
127
|
+
value_found = find_a_value_at(resource, path) do |value|
|
128
|
+
if value.instance_of?(CancerRegistryReportingTestKit::PrimitiveType) && ms_extension_urls.present?
|
129
|
+
urls = value.extension&.map(&:url)
|
130
|
+
has_ms_extension = (urls & ms_extension_urls).present?
|
131
|
+
end
|
132
|
+
|
133
|
+
unless has_ms_extension
|
134
|
+
value = value.value if value.instance_of?(CancerRegistryReportingTestKit::PrimitiveType)
|
135
|
+
value_without_extensions =
|
136
|
+
value.respond_to?(:to_hash) ? value.to_hash.except('extension') : value
|
137
|
+
end
|
138
|
+
|
139
|
+
(has_ms_extension || value_without_extensions.present? || value_without_extensions == false) &&
|
140
|
+
(element_definition[:fixed_value].blank? || value == element_definition[:fixed_value])
|
141
|
+
end
|
142
|
+
# Note that false.present? => false, which is why we need to add this extra check
|
143
|
+
value_found.present? || value_found == false
|
144
|
+
end
|
145
|
+
end
|
146
|
+
end
|
147
|
+
|
148
|
+
def must_support_slices
|
149
|
+
if exclude_uscdi_only_test?
|
150
|
+
metadata.must_supports[:slices].reject { |slice| slice[:uscdi_only] }
|
151
|
+
else
|
152
|
+
metadata.must_supports[:slices]
|
153
|
+
end
|
154
|
+
end
|
155
|
+
|
156
|
+
def missing_slices(resources = [])
|
157
|
+
@missing_slices ||=
|
158
|
+
must_support_slices.select do |slice|
|
159
|
+
resources.none? do |resource|
|
160
|
+
path = slice[:path] # .delete_suffix('[x]')
|
161
|
+
find_slice(resource, path, slice[:discriminator]).present?
|
162
|
+
end
|
163
|
+
end
|
164
|
+
end
|
165
|
+
|
166
|
+
def find_slice(resource, path, discriminator)
|
167
|
+
find_a_value_at(resource, path) do |element|
|
168
|
+
case discriminator[:type]
|
169
|
+
when 'patternCodeableConcept'
|
170
|
+
coding_path = discriminator[:path].present? ? "#{discriminator[:path]}.coding" : 'coding'
|
171
|
+
find_a_value_at(element, coding_path) do |coding|
|
172
|
+
coding.code == discriminator[:code] && coding.system == discriminator[:system]
|
173
|
+
end
|
174
|
+
when 'patternCoding'
|
175
|
+
coding_path = discriminator[:path].present? ? discriminator[:path] : ''
|
176
|
+
find_a_value_at(element, coding_path) do |coding|
|
177
|
+
coding.code == discriminator[:code] && coding.system == discriminator[:system]
|
178
|
+
end
|
179
|
+
when 'patternIdentifier'
|
180
|
+
find_a_value_at(element, discriminator[:path]) { |identifier| identifier.system == discriminator[:system] }
|
181
|
+
when 'value'
|
182
|
+
values = discriminator[:values].map { |value| value.merge(path: value[:path].split('.')) }
|
183
|
+
find_slice_by_values(element, values)
|
184
|
+
when 'type'
|
185
|
+
case discriminator[:code]
|
186
|
+
when 'Date'
|
187
|
+
begin
|
188
|
+
Date.parse(element)
|
189
|
+
rescue ArgumentError
|
190
|
+
false
|
191
|
+
end
|
192
|
+
when 'DateTime'
|
193
|
+
begin
|
194
|
+
DateTime.parse(element)
|
195
|
+
rescue ArgumentError
|
196
|
+
false
|
197
|
+
end
|
198
|
+
when 'String'
|
199
|
+
element.is_a? String
|
200
|
+
else
|
201
|
+
if element.is_a? FHIR::Bundle::Entry
|
202
|
+
element.resource.is_a? FHIR.const_get(discriminator[:code])
|
203
|
+
else
|
204
|
+
element.is_a? FHIR.const_get(discriminator[:code])
|
205
|
+
end
|
206
|
+
end
|
207
|
+
when 'requiredBinding'
|
208
|
+
coding_path = discriminator[:path].present? ? "#{discriminator[:path]}.coding" : 'coding'
|
209
|
+
|
210
|
+
## SPECIAL CASE ##
|
211
|
+
# only checking ODH MS slices for codesystem, not codes, given large number of codes
|
212
|
+
if metadata.profile_url == 'http://hl7.org/fhir/us/odh/StructureDefinition/odh-UsualWork'
|
213
|
+
get_slice_by_codesystem(element, discriminator)
|
214
|
+
else
|
215
|
+
find_a_value_at(element, coding_path) do |coding|
|
216
|
+
discriminator[:values].any? { |value| value[:system] == coding.system && value[:code] == coding.code }
|
217
|
+
end
|
218
|
+
end
|
219
|
+
end
|
220
|
+
end
|
221
|
+
end
|
222
|
+
|
223
|
+
## special case ##
|
224
|
+
|
225
|
+
def get_slice_by_codesystem(element, discriminator)
|
226
|
+
find_a_value_at(element, '') do |coding|
|
227
|
+
discriminator[:values].any? { |value| coding.system.include? value[:system] }
|
228
|
+
end
|
229
|
+
end
|
230
|
+
|
231
|
+
## end special case ##
|
232
|
+
|
233
|
+
def find_slice_by_values(element, value_definitions)
|
234
|
+
path_prefixes = value_definitions.map { |value_definition| value_definition[:path].first }.uniq
|
235
|
+
Array.wrap(element).find do |el|
|
236
|
+
path_prefixes.all? do |path_prefix|
|
237
|
+
value_definitions_for_path =
|
238
|
+
value_definitions
|
239
|
+
.select { |value_definition| value_definition[:path].first == path_prefix }
|
240
|
+
.each { |value_definition| value_definition[:path].shift }
|
241
|
+
|
242
|
+
find_a_value_at(el, path_prefix) do |el_found|
|
243
|
+
child_element_value_definitions, current_element_value_definitions =
|
244
|
+
value_definitions_for_path.partition { |value_definition| value_definition[:path].present? }
|
245
|
+
|
246
|
+
current_element_values_match =
|
247
|
+
current_element_value_definitions
|
248
|
+
.all? { |value_definition| value_definition[:value].to_s == el_found.to_s }
|
249
|
+
|
250
|
+
child_element_values_match =
|
251
|
+
if child_element_value_definitions.present?
|
252
|
+
find_slice_by_values(el_found, child_element_value_definitions)
|
253
|
+
else
|
254
|
+
true
|
255
|
+
end
|
256
|
+
|
257
|
+
current_element_values_match && child_element_values_match
|
258
|
+
end
|
259
|
+
end
|
260
|
+
end
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|