au_ps_inferno 0.1.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/lib/au_ps_inferno/generator/constants.rb +61 -0
- data/lib/au_ps_inferno/generator/generator.rb +76 -0
- data/lib/au_ps_inferno/generator/generator_group_based_metadata_module.rb +113 -0
- data/lib/au_ps_inferno/generator/ig_resources_extractor.rb +149 -0
- data/lib/au_ps_inferno/generator/metadata_manager.rb +608 -0
- data/lib/au_ps_inferno/generator/naming.rb +52 -0
- data/lib/au_ps_inferno/generator/sections_validation_group_generator.rb +182 -0
- data/lib/au_ps_inferno/generator/test_file_generator.rb +77 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_bundle_instance.rb +56 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_bundle_must_support_conformance/suite_au_ps_bundle_instance_au_ps_bundle_must_support_conformance_bundle_must_support_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_bundle_must_support_conformance.rb +16 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_attester/suite_au_ps_bundle_instance_au_ps_composition_attester_attester_party_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_attester/suite_au_ps_bundle_instance_au_ps_composition_attester_attester_party_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_attester/suite_au_ps_bundle_instance_au_ps_composition_attester_attester_party_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_attester.rb +26 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_author/suite_au_ps_bundle_instance_au_ps_composition_author_author_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_author/suite_au_ps_bundle_instance_au_ps_composition_author_author_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_author/suite_au_ps_bundle_instance_au_ps_composition_author_author_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_author/suite_au_ps_bundle_instance_au_ps_composition_author_author_resource_type_is_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_author.rb +28 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_custodian/suite_au_ps_bundle_instance_au_ps_composition_custodian_custodian_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_custodian/suite_au_ps_bundle_instance_au_ps_composition_custodian_custodian_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_custodian/suite_au_ps_bundle_instance_au_ps_composition_custodian_custodian_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_custodian.rb +26 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_mandatory_sections/composition_mandatory_sections_mandatory_sections_entry_profiles.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_mandatory_sections/suite_au_ps_bundle_instance_au_ps_composition_mandatory_sections_sections_shall_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_mandatory_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_mandatory_ms_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_ms_subelements_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_optional_ms_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_optional_ms_slices.rb +22 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_must_support_conformance.rb +28 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_optional_sections/suite_au_ps_bundle_instance_au_ps_composition_optional_sections_optional_sections_entry_profiles.rb +22 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_optional_sections/suite_au_ps_bundle_instance_au_ps_composition_optional_sections_sections_may_populated.rb +24 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_optional_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_recommended_sections/composition_recommended_sections_recommended_sections_entry_profiles.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_recommended_sections/suite_au_ps_bundle_instance_au_ps_composition_recommended_sections_sections_should_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_recommended_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_subject/suite_au_ps_bundle_instance_au_ps_composition_subject_subject_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_subject/suite_au_ps_bundle_instance_au_ps_composition_subject_subject_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_subject/suite_au_ps_bundle_instance_au_ps_composition_subject_subject_ms_subelements_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_subject/suite_au_ps_bundle_instance_au_ps_composition_subject_subject_resource_type_is_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_subject.rb +28 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_undefined_sections/suite_au_ps_bundle_instance_au_ps_composition_undefined_sections_sections_may_undefined.rb +24 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/au_ps_composition_undefined_sections.rb +18 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/bundle_validation/suite_au_ps_bundle_instance_bundle_validation_bundle_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/bundle_validation/suite_au_ps_bundle_instance_bundle_validation_bundle_valid_ips.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_bundle_instance/bundle_validation.rb +20 -0
- data/lib/au_ps_inferno/suite/au_ps_retrieve_cs_group/au_ps_cs_is_valid_test.rb +21 -0
- data/lib/au_ps_inferno/suite/au_ps_retrieve_cs_group/au_ps_cs_supports_au_ps_profiles.rb +40 -0
- data/lib/au_ps_inferno/suite/au_ps_retrieve_cs_group/au_ps_cs_supports_ips_recommended_ops.rb +19 -0
- data/lib/au_ps_inferno/suite/au_ps_retrieve_cs_group/au_ps_retrieve_cs_group.rb +47 -0
- data/lib/au_ps_inferno/suite/au_ps_v100.rb +39 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_bundle_must_support_conformance/bundle_must_support_conformance_bundle_must_support_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_bundle_must_support_conformance.rb +16 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_attester/composition_attester_attester_party_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_attester/composition_attester_attester_party_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_attester/composition_attester_attester_party_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_attester.rb +26 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_author/composition_author_author_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_author/composition_author_author_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_author/composition_author_author_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_author/composition_author_author_resource_type_is_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_author.rb +28 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_custodian/composition_custodian_custodian_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_custodian/composition_custodian_custodian_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_custodian/composition_custodian_custodian_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_custodian.rb +26 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_mandatory_sections/composition_mandatory_sections_mandatory_sections_entry_profiles.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_mandatory_sections/composition_mandatory_sections_sections_shall_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_mandatory_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_mandatory_ms_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_ms_subelements_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_optional_ms_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_optional_ms_slices.rb +22 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_must_support_conformance.rb +28 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_optional_sections/composition_optional_sections_optional_sections_entry_profiles.rb +22 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_optional_sections/composition_optional_sections_sections_may_populated.rb +24 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_optional_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_recommended_sections/composition_recommended_sections_recommended_sections_entry_profiles.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_recommended_sections/composition_recommended_sections_sections_should_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_recommended_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_subject/composition_subject_subject_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_subject/composition_subject_subject_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_subject/composition_subject_subject_ms_subelements_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_subject/composition_subject_subject_resource_type_is_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_subject.rb +28 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_undefined_sections/composition_undefined_sections_sections_may_undefined.rb +24 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/au_ps_composition_undefined_sections.rb +18 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/bundle_validation/suite_generate_au_ps_using_ips_summary_validation_tests_bundle_validation_bundle_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/bundle_validation/suite_generate_au_ps_using_ips_summary_validation_tests_bundle_validation_bundle_valid_ips.rb +21 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/bundle_validation.rb +20 -0
- data/lib/au_ps_inferno/suite/generate_au_ps_using_ips_summary_validation_tests/generate_au_ps_using_ips_summary_validation_tests.rb +56 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_bundle_must_support_conformance/bundle_must_support_conformance_bundle_must_support_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_bundle_must_support_conformance.rb +16 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_attester/composition_attester_attester_party_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_attester/composition_attester_attester_party_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_attester/composition_attester_attester_party_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_attester.rb +26 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_author/composition_author_author_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_author/composition_author_author_resource_type_is_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_author/suite_retrieve_au_ps_bundle_validation_tests_au_ps_composition_author_author_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_author/suite_retrieve_au_ps_bundle_validation_tests_au_ps_composition_author_author_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_author.rb +28 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_custodian/composition_custodian_custodian_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_custodian/composition_custodian_custodian_ms_subelements.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_custodian/suite_retrieve_au_ps_bundle_validation_tests_au_ps_composition_custodian_custodian_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_custodian.rb +26 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_mandatory_sections/composition_mandatory_sections_mandatory_sections_entry_profiles.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_mandatory_sections/composition_mandatory_sections_sections_shall_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_mandatory_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_mandatory_ms_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_ms_subelements_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_optional_ms_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_must_support_conformance/composition_must_support_conformance_composition_optional_ms_slices.rb +22 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_must_support_conformance.rb +28 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_optional_sections/composition_optional_sections_optional_sections_entry_profiles.rb +22 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_optional_sections/composition_optional_sections_sections_may_populated.rb +24 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_optional_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_recommended_sections/composition_recommended_sections_recommended_sections_entry_profiles.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_recommended_sections/composition_recommended_sections_sections_should_populated.rb +22 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_recommended_sections.rb +20 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_subject/composition_subject_subject_ms_identifier_slices.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_subject/composition_subject_subject_ms_subelements_populated.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_subject/composition_subject_subject_resource_type_is_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_subject/suite_retrieve_au_ps_bundle_validation_tests_au_ps_composition_subject_subject_ms_elements.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_subject.rb +28 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_undefined_sections/composition_undefined_sections_sections_may_undefined.rb +24 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/au_ps_composition_undefined_sections.rb +18 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/bundle_validation/suite_retrieve_au_ps_bundle_validation_tests_bundle_validation_bundle_valid.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/bundle_validation/suite_retrieve_au_ps_bundle_validation_tests_bundle_validation_bundle_valid_ips.rb +21 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/bundle_validation.rb +20 -0
- data/lib/au_ps_inferno/suite/retrieve_au_ps_bundle_validation_tests/retrieve_au_ps_bundle_validation_tests.rb +56 -0
- data/lib/au_ps_inferno/utils/attester/basic_test_attester_identifier_slices.rb +74 -0
- data/lib/au_ps_inferno/utils/attester/basic_test_attester_message_helpers.rb +16 -0
- data/lib/au_ps_inferno/utils/attester/basic_test_attester_module.rb +14 -0
- data/lib/au_ps_inferno/utils/attester/basic_test_attester_resource.rb +54 -0
- data/lib/au_ps_inferno/utils/author/basic_test_author_module.rb +12 -0
- data/lib/au_ps_inferno/utils/author/basic_test_author_resource.rb +32 -0
- data/lib/au_ps_inferno/utils/author/basic_test_author_tests.rb +24 -0
- data/lib/au_ps_inferno/utils/basic_test/bundle_module.rb +87 -0
- data/lib/au_ps_inferno/utils/basic_test/capability_operations_module.rb +37 -0
- data/lib/au_ps_inferno/utils/basic_test/composition_elements_and_slices_module.rb +98 -0
- data/lib/au_ps_inferno/utils/basic_test/composition_section_check_resources_ms_elements_module.rb +197 -0
- data/lib/au_ps_inferno/utils/basic_test/composition_section_read_issues_helpers_module.rb +66 -0
- data/lib/au_ps_inferno/utils/basic_test/composition_section_read_module.rb +127 -0
- data/lib/au_ps_inferno/utils/basic_test/composition_subelements_module.rb +84 -0
- data/lib/au_ps_inferno/utils/basic_test/ms_elements_populated_helpers_module.rb +38 -0
- data/lib/au_ps_inferno/utils/basic_test/ms_elements_populated_module.rb +71 -0
- data/lib/au_ps_inferno/utils/basic_test/ms_identifier_slices_module.rb +61 -0
- data/lib/au_ps_inferno/utils/basic_test/ms_sub_elements_populated_module.rb +128 -0
- data/lib/au_ps_inferno/utils/basic_test/paths_module.rb +26 -0
- data/lib/au_ps_inferno/utils/basic_test/resolve_path_debug_module.rb +45 -0
- data/lib/au_ps_inferno/utils/basic_test/resolve_resource_type_module.rb +52 -0
- data/lib/au_ps_inferno/utils/basic_test/resource_helpers_module.rb +129 -0
- data/lib/au_ps_inferno/utils/basic_test/scratch_bundle_entries_module.rb +30 -0
- data/lib/au_ps_inferno/utils/basic_test/section_bundle_validation_module.rb +70 -0
- data/lib/au_ps_inferno/utils/basic_test_class.rb +56 -0
- data/lib/au_ps_inferno/utils/basic_test_contants_module.rb +32 -0
- data/lib/au_ps_inferno/utils/basic_test_with_url.rb +8 -0
- data/lib/au_ps_inferno/utils/basic_validate_bundle_test.rb +43 -0
- data/lib/au_ps_inferno/utils/bundle_decorator.rb +81 -0
- data/lib/au_ps_inferno/utils/bundle_entry_decorator.rb +19 -0
- data/lib/au_ps_inferno/utils/bundle_is_valid_class.rb +31 -0
- data/lib/au_ps_inferno/utils/capability_statement_decorator.rb +20 -0
- data/lib/au_ps_inferno/utils/composition_decorator.rb +56 -0
- data/lib/au_ps_inferno/utils/composition_utils/boolean_and_stats.rb +28 -0
- data/lib/au_ps_inferno/utils/composition_utils.rb +29 -0
- data/lib/au_ps_inferno/utils/custodian/basic_test_custodian_identifier_slices.rb +47 -0
- data/lib/au_ps_inferno/utils/custodian/basic_test_custodian_module.rb +14 -0
- data/lib/au_ps_inferno/utils/custodian/basic_test_custodian_resource.rb +32 -0
- data/lib/au_ps_inferno/utils/custodian/basic_test_custodian_tests.rb +19 -0
- data/lib/au_ps_inferno/utils/inferno_suite_generator_compat.rb +7 -0
- data/lib/au_ps_inferno/utils/ips_bundle_is_valid_class.rb +15 -0
- data/lib/au_ps_inferno/utils/ips_retrieve_bundle_test_class.rb +17 -0
- data/lib/au_ps_inferno/utils/ips_summary_valid_bundle_class.rb +15 -0
- data/lib/au_ps_inferno/utils/metadata_manager.rb +58 -0
- data/lib/au_ps_inferno/utils/retrieve_bundle_test_class.rb +81 -0
- data/lib/au_ps_inferno/utils/rich_message_class.rb +23 -0
- data/lib/au_ps_inferno/utils/rich_validation_message.rb +42 -0
- data/lib/au_ps_inferno/utils/section_decorator.rb +23 -0
- data/lib/au_ps_inferno/utils/section_names_mapping.rb +31 -0
- data/lib/au_ps_inferno/utils/section_test_class.rb +18 -0
- data/lib/au_ps_inferno/utils/section_test_module.rb +16 -0
- data/lib/au_ps_inferno/utils/structure_definition_decorator.rb +28 -0
- data/lib/au_ps_inferno/utils/subject/basic_test_subject_module.rb +12 -0
- data/lib/au_ps_inferno/utils/subject/basic_test_subject_patient_ms_other_tests.rb +15 -0
- data/lib/au_ps_inferno/utils/subject/basic_test_subject_resource.rb +21 -0
- data/lib/au_ps_inferno/utils/summary_valid_bundle_class.rb +84 -0
- data/lib/au_ps_inferno/utils/validator_helpers.rb +92 -0
- data/lib/au_ps_inferno/version.rb +6 -0
- data/lib/au_ps_inferno.rb +3 -0
- metadata +310 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: fd7ab5a88c5bbe96574996354c088806de73490d210c03a0329580336d71b380
|
|
4
|
+
data.tar.gz: 17ed059f795f6544e865b8184bf22b9fde671d8702ca6d22b45eed05177f4c01
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: b083d7c4f47fdba7a4d566365d9008435f2a55d4b18debf4411df6b58f0cb1326f366dcf16e2f497f4c0e284d82eca95a7d42a372251be0f6285a90bade19b5d
|
|
7
|
+
data.tar.gz: 45c676d1c0f3f8dd0e15de165e173770d8869884cdb1f462ad7f550544df5532f7deca86aef12e0b609dec59f2d6133877a547666d36686e326ad8e4a79c848a
|
data/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "{}"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright {yyyy} {name of copyright owner}
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Generator
|
|
4
|
+
# Constants used by the test generator for AU PS (Australian Patient Summary) Inferno.
|
|
5
|
+
module Constants
|
|
6
|
+
# Required AU PS FHIR profile URLs. Resources using these profiles must be present
|
|
7
|
+
# for a valid patient summary.
|
|
8
|
+
# @return [Array<String>]
|
|
9
|
+
REQUIRED_PROFILES = %w[
|
|
10
|
+
http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-bundle
|
|
11
|
+
http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-composition
|
|
12
|
+
http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-patient
|
|
13
|
+
http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-condition
|
|
14
|
+
http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-allergyintolerance
|
|
15
|
+
http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-medicationstatement
|
|
16
|
+
http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-medicationrequest
|
|
17
|
+
].freeze
|
|
18
|
+
|
|
19
|
+
# Mapping from resource/profile (resourceType|profileUrl) to
|
|
20
|
+
# an array of filters which restrict entries
|
|
21
|
+
# for that resource type in section validation.
|
|
22
|
+
#
|
|
23
|
+
# Each filter is a hash specifying a FHIRPath 'path' and required 'value'.
|
|
24
|
+
# The value can be a single value or an array of possible values.
|
|
25
|
+
#
|
|
26
|
+
# @return [Hash{String => Array<Hash{String => Object}>}]
|
|
27
|
+
RESOURCES_FILTERS_MAPPING = {
|
|
28
|
+
'Observation|http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-diagnosticresult-path' => [
|
|
29
|
+
{ 'path' => 'category.coding.code', 'value' => 'laboratory' }
|
|
30
|
+
],
|
|
31
|
+
'Observation|http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-results-radiology-uv-ips' => [
|
|
32
|
+
{ 'path' => 'category.coding.code', 'value' => 'imaging' }
|
|
33
|
+
],
|
|
34
|
+
'Observation|http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pregnancy-status-uv-ips' => [
|
|
35
|
+
{ 'path' => 'code.coding.code', 'value' => '82810-3' }
|
|
36
|
+
],
|
|
37
|
+
'Observation|http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-pregnancy-outcome-uv-ips' => [
|
|
38
|
+
{
|
|
39
|
+
'path' => 'code.coding.code',
|
|
40
|
+
'value' => %w[
|
|
41
|
+
11636-8
|
|
42
|
+
11637-6
|
|
43
|
+
11638-4
|
|
44
|
+
11639-2
|
|
45
|
+
11640-0
|
|
46
|
+
11612-9
|
|
47
|
+
11613-7
|
|
48
|
+
11614-5
|
|
49
|
+
33065-4
|
|
50
|
+
]
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
'Observation|http://hl7.org.au/fhir/ps/StructureDefinition/au-ps-smokingstatus' => [
|
|
54
|
+
{ 'path' => 'code.coding.code', 'value' => '1747861000168109' }
|
|
55
|
+
],
|
|
56
|
+
'Observation|http://hl7.org/fhir/uv/ips/StructureDefinition/Observation-alcoholuse-uv-ips' => [
|
|
57
|
+
{ 'path' => 'code.coding.code', 'value' => '74013-4' }
|
|
58
|
+
]
|
|
59
|
+
}.freeze
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'fhir_models'
|
|
4
|
+
require 'fileutils'
|
|
5
|
+
require 'yaml'
|
|
6
|
+
require_relative '../utils/inferno_suite_generator_compat'
|
|
7
|
+
|
|
8
|
+
require_relative 'ig_resources_extractor'
|
|
9
|
+
require_relative 'metadata_manager'
|
|
10
|
+
require_relative 'naming'
|
|
11
|
+
require_relative 'sections_validation_group_generator'
|
|
12
|
+
require_relative 'test_file_generator'
|
|
13
|
+
require_relative 'generator_group_based_metadata_module'
|
|
14
|
+
|
|
15
|
+
# Generator for test suites targeting AU PS and IPS implementation guides.
|
|
16
|
+
#
|
|
17
|
+
# This class automates extraction and persistence of IG resource metadata for use in test suite
|
|
18
|
+
# generation, including support for additional FHIR resource folders.
|
|
19
|
+
#
|
|
20
|
+
# @example Basic usage
|
|
21
|
+
# generator = Generator.new('/path/to/ig')
|
|
22
|
+
# generator.generate
|
|
23
|
+
#
|
|
24
|
+
# @example With extra folder containing additional FHIR resources (e.g. extra StructureDefinitions)
|
|
25
|
+
# generator = Generator.new('/path/to/ig', additional_resources_path: 'path/to/extra-ig-resources')
|
|
26
|
+
# generator.generate
|
|
27
|
+
#
|
|
28
|
+
class Generator
|
|
29
|
+
SyntheticCapability = Struct.new(
|
|
30
|
+
:type, :interaction, :operation, :searchParam, :searchInclude, :searchRevInclude, :extension
|
|
31
|
+
)
|
|
32
|
+
|
|
33
|
+
include Naming
|
|
34
|
+
include GeneratorGroupBasedMetadataModule
|
|
35
|
+
|
|
36
|
+
def initialize(ig_path, additional_resources_path: nil)
|
|
37
|
+
register_inferno_suite_generator_config
|
|
38
|
+
@resources_manager = IGResourcesExtractor.new(
|
|
39
|
+
ig_path,
|
|
40
|
+
additional_resources_path: additional_resources_path
|
|
41
|
+
)
|
|
42
|
+
@metadata = MetadataManager.new(@resources_manager.ig_resources)
|
|
43
|
+
@new_metadata = build_new_metadata
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
def generate
|
|
47
|
+
@resources_manager.extract
|
|
48
|
+
save_metadata_to_version_folder
|
|
49
|
+
update_ig_version_rb(@resources_manager.ig_version)
|
|
50
|
+
end
|
|
51
|
+
|
|
52
|
+
private
|
|
53
|
+
|
|
54
|
+
def update_ig_version_rb(version)
|
|
55
|
+
return if version.nil? || version.empty?
|
|
56
|
+
|
|
57
|
+
version_rb_path = File.expand_path(File.join('lib', 'au_ps_inferno', 'version.rb'))
|
|
58
|
+
content = File.read(version_rb_path)
|
|
59
|
+
updated = content.gsub(/IG_VERSION = '.*'/) { "IG_VERSION = '#{version}'" }
|
|
60
|
+
if updated == content
|
|
61
|
+
puts "Warning: IG_VERSION pattern not found in #{version_rb_path}; version was not updated."
|
|
62
|
+
return
|
|
63
|
+
end
|
|
64
|
+
File.write(version_rb_path, updated)
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def save_metadata_to_version_folder
|
|
68
|
+
metadata_path = File.join(File.expand_path(File.join('lib', 'au_ps_inferno')), 'metadata.yaml')
|
|
69
|
+
FileUtils.mkdir_p(File.dirname(metadata_path))
|
|
70
|
+
@metadata.initiate_build
|
|
71
|
+
old_metadata = @metadata.metadata_to_dump
|
|
72
|
+
new_metadata = @new_metadata&.to_hash || {}
|
|
73
|
+
merged_metadata = merge_metadata_values(old_metadata, new_metadata)
|
|
74
|
+
File.write(metadata_path, YAML.dump(merged_metadata))
|
|
75
|
+
end
|
|
76
|
+
end
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
class Generator
|
|
4
|
+
# Module for building group-based metadata
|
|
5
|
+
module GeneratorGroupBasedMetadataModule
|
|
6
|
+
private
|
|
7
|
+
|
|
8
|
+
def build_new_metadata
|
|
9
|
+
config_keeper = Registry.get(:config_keeper)
|
|
10
|
+
return nil unless config_keeper
|
|
11
|
+
|
|
12
|
+
ig_resources = InfernoSuiteGenerator::Generator::IGLoader.new(config_keeper.ig_deps_path).load
|
|
13
|
+
if ig_resources.cs_resources.present?
|
|
14
|
+
return InfernoSuiteGenerator::Generator::IGMetadataExtractor.new(ig_resources).extract
|
|
15
|
+
end
|
|
16
|
+
|
|
17
|
+
build_new_metadata_without_capability_statement(ig_resources, config_keeper)
|
|
18
|
+
end
|
|
19
|
+
|
|
20
|
+
def build_new_metadata_without_capability_statement(ig_resources, config_keeper)
|
|
21
|
+
ig_metadata = build_ig_metadata_base(config_keeper)
|
|
22
|
+
groups = synthetic_profile_groups(ig_resources, ig_metadata)
|
|
23
|
+
ig_metadata.groups = groups
|
|
24
|
+
ig_metadata.postprocess_groups(ig_resources)
|
|
25
|
+
ig_metadata
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def build_ig_metadata_base(config_keeper)
|
|
29
|
+
ig_metadata = InfernoSuiteGenerator::Generator::IGMetadata.new
|
|
30
|
+
ig_metadata.ig_version = "v#{config_keeper.version}"
|
|
31
|
+
ig_metadata.ig_id = config_keeper.id
|
|
32
|
+
ig_metadata.ig_title = config_keeper.title
|
|
33
|
+
ig_metadata.ig_module_name_prefix = config_keeper.module_name_prefix
|
|
34
|
+
ig_metadata.ig_test_id_prefix = config_keeper.test_id_prefix
|
|
35
|
+
ig_metadata
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def synthetic_profile_groups(ig_resources, ig_metadata)
|
|
39
|
+
au_ps_profiles(ig_resources).filter_map do |profile|
|
|
40
|
+
capability = synthetic_resource_capability(profile)
|
|
41
|
+
InfernoSuiteGenerator::Generator::GroupMetadataExtractor.new(
|
|
42
|
+
capability, profile.url, ig_metadata, ig_resources
|
|
43
|
+
).group_metadata
|
|
44
|
+
rescue StandardError => e
|
|
45
|
+
warn "Skipping profile #{profile.url}: #{e.message}"
|
|
46
|
+
nil
|
|
47
|
+
end
|
|
48
|
+
end
|
|
49
|
+
|
|
50
|
+
def au_ps_profiles(ig_resources)
|
|
51
|
+
ig_resources
|
|
52
|
+
.get_resources_by_type('StructureDefinition')
|
|
53
|
+
.select { |profile| profile.url.to_s.start_with?('http://hl7.org.au/fhir/ps/StructureDefinition/') }
|
|
54
|
+
.reject { |profile| profile.type == 'Extension' || profile.snapshot.blank? }
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def synthetic_resource_capability(profile)
|
|
58
|
+
SyntheticCapability.new(
|
|
59
|
+
type: profile.type,
|
|
60
|
+
interaction: [],
|
|
61
|
+
operation: [],
|
|
62
|
+
searchParam: [],
|
|
63
|
+
searchInclude: [],
|
|
64
|
+
searchRevInclude: [],
|
|
65
|
+
extension: []
|
|
66
|
+
)
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def register_inferno_suite_generator_config
|
|
70
|
+
return if Registry.get(:config_keeper)
|
|
71
|
+
|
|
72
|
+
config_path = inferno_suite_generator_config_path
|
|
73
|
+
return unless config_path
|
|
74
|
+
|
|
75
|
+
keeper = InfernoSuiteGenerator::Generator::GeneratorConfigKeeper.new([config_path])
|
|
76
|
+
Registry.register(:config_keeper, keeper)
|
|
77
|
+
rescue StandardError => e
|
|
78
|
+
warn "Failed to register inferno_suite_generator config: #{e.message}"
|
|
79
|
+
nil
|
|
80
|
+
end
|
|
81
|
+
|
|
82
|
+
def inferno_suite_generator_config_path
|
|
83
|
+
config_paths = [
|
|
84
|
+
File.expand_path('../../../inferno_suite_generator.config.json', __dir__),
|
|
85
|
+
File.expand_path('../../../../inferno_suite_generator.config.json', __dir__)
|
|
86
|
+
]
|
|
87
|
+
config_paths.find { |path| File.exist?(path) }
|
|
88
|
+
end
|
|
89
|
+
|
|
90
|
+
def merge_metadata_values(old_value, new_value)
|
|
91
|
+
return old_value if new_value.nil?
|
|
92
|
+
return new_value if old_value.nil?
|
|
93
|
+
|
|
94
|
+
if old_value.is_a?(Hash) && new_value.is_a?(Hash)
|
|
95
|
+
merge_metadata_hashes(old_value, new_value)
|
|
96
|
+
elsif old_value.is_a?(Array) && new_value.is_a?(Array)
|
|
97
|
+
merge_metadata_arrays(old_value, new_value)
|
|
98
|
+
else
|
|
99
|
+
old_value
|
|
100
|
+
end
|
|
101
|
+
end
|
|
102
|
+
|
|
103
|
+
def merge_metadata_hashes(old_hash, new_hash)
|
|
104
|
+
(old_hash.keys | new_hash.keys).to_h do |key|
|
|
105
|
+
[key, merge_metadata_values(old_hash[key], new_hash[key])]
|
|
106
|
+
end
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def merge_metadata_arrays(old_array, new_array)
|
|
110
|
+
old_array + new_array.reject { |item| old_array.include?(item) }
|
|
111
|
+
end
|
|
112
|
+
end
|
|
113
|
+
end
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'zlib'
|
|
4
|
+
require 'rubygems/package'
|
|
5
|
+
require 'fhir_models'
|
|
6
|
+
|
|
7
|
+
class Generator
|
|
8
|
+
# Extracts FHIR resources from an Implementation Guide (IG) package archive
|
|
9
|
+
# and optionally from a folder of additional JSON resources.
|
|
10
|
+
#
|
|
11
|
+
# Reads a .tar.gz (or .tgz) package, parses JSON entries that represent FHIR
|
|
12
|
+
# resources (excluding OpenAPI JSON), and populates {#ig_resources} with
|
|
13
|
+
# FHIR model instances. If +additional_resources_path+ is set, all +.json+
|
|
14
|
+
# files from that folder (and subfolders) are loaded after the package,
|
|
15
|
+
# so you can supply missing StructureDefinitions, SearchParameters, etc.
|
|
16
|
+
#
|
|
17
|
+
# @example
|
|
18
|
+
# extractor = IGResourcesExtractor.new('path/to/package.tar.gz')
|
|
19
|
+
# extractor.extract
|
|
20
|
+
# extractor.ig_resources # => [FHIR::Patient, ...]
|
|
21
|
+
#
|
|
22
|
+
# @example With additional folder
|
|
23
|
+
# extractor = IGResourcesExtractor.new('path/to/package.tar.gz', additional_resources_path: 'path/to/extra')
|
|
24
|
+
# extractor.extract
|
|
25
|
+
class IGResourcesExtractor
|
|
26
|
+
# @return [Array<FHIR::Model>] FHIR resources extracted from the IG package and optional folder
|
|
27
|
+
attr_reader :ig_resources, :ig_version
|
|
28
|
+
|
|
29
|
+
# @param ig_path [String] Path to the IG package file (.tar.gz or .tgz)
|
|
30
|
+
# @param additional_resources_path [String, nil] Optional path to a folder of JSON FHIR resources
|
|
31
|
+
# (e.g. StructureDefinition, SearchParameter) to load in addition to the package.
|
|
32
|
+
def initialize(ig_path, additional_resources_path: nil)
|
|
33
|
+
@ig_path = ig_path
|
|
34
|
+
@additional_resources_path = additional_resources_path
|
|
35
|
+
@ig_resources = []
|
|
36
|
+
@ig_version = nil
|
|
37
|
+
end
|
|
38
|
+
|
|
39
|
+
# Processes the package archive and optional folder, and populates {#ig_resources}.
|
|
40
|
+
# Handles gzip/tar errors and prints messages to stdout on failure.
|
|
41
|
+
#
|
|
42
|
+
# @return [void]
|
|
43
|
+
def extract
|
|
44
|
+
process_package_archive
|
|
45
|
+
load_additional_resources_from_folder if @additional_resources_path
|
|
46
|
+
end
|
|
47
|
+
|
|
48
|
+
private
|
|
49
|
+
|
|
50
|
+
# Opens the gzipped tar archive and iterates over tar entries.
|
|
51
|
+
# @return [void]
|
|
52
|
+
def process_package_archive
|
|
53
|
+
Zlib::GzipReader.open(@ig_path) do |gz|
|
|
54
|
+
Gem::Package::TarReader.new(gz) { |tar| process_tar(tar) }
|
|
55
|
+
end
|
|
56
|
+
rescue Zlib::GzipFile::Error => e
|
|
57
|
+
puts_archive_error('gzip', e)
|
|
58
|
+
rescue Gem::Package::TarInvalidError => e
|
|
59
|
+
puts_archive_error('tar', e)
|
|
60
|
+
rescue StandardError => e
|
|
61
|
+
puts "Error processing archive at #{@ig_path}: #{e.message}"
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
# @param format_type [String] e.g. "gzip" or "tar"
|
|
65
|
+
# @param error [StandardError] the raised exception
|
|
66
|
+
# @return [void]
|
|
67
|
+
def puts_archive_error(format_type, error)
|
|
68
|
+
msg = "The file at #{@ig_path} is not a valid #{format_type} archive."
|
|
69
|
+
puts "Error: #{msg} Please ensure it is a valid .tar.gz or .tgz archive."
|
|
70
|
+
puts "Error details: #{error.message}"
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
# @param tar [Gem::Package::TarReader]
|
|
74
|
+
# @return [void]
|
|
75
|
+
def process_tar(tar)
|
|
76
|
+
tar.each do |entry|
|
|
77
|
+
if entry.file? && entry.full_name.delete_prefix('./') == 'package/package.json'
|
|
78
|
+
extract_ig_version(entry)
|
|
79
|
+
next
|
|
80
|
+
end
|
|
81
|
+
next unless relevant_json_entry?(entry)
|
|
82
|
+
|
|
83
|
+
collect_resource_from_entry(entry)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
87
|
+
# @param entry [Gem::Package::TarReader::Entry]
|
|
88
|
+
# @return [void]
|
|
89
|
+
def extract_ig_version(entry)
|
|
90
|
+
json = JSON.parse(entry.read)
|
|
91
|
+
@ig_version = json['version']&.to_s
|
|
92
|
+
rescue StandardError => e
|
|
93
|
+
puts "Error reading IG version from package.json: #{e.message}"
|
|
94
|
+
end
|
|
95
|
+
|
|
96
|
+
# @param entry [Gem::Package::TarReader::Entry]
|
|
97
|
+
# @return [Boolean] true if entry is a JSON file and not an OpenAPI JSON
|
|
98
|
+
def relevant_json_entry?(entry)
|
|
99
|
+
entry.file? &&
|
|
100
|
+
entry.full_name.end_with?('.json') &&
|
|
101
|
+
!entry.full_name.end_with?('.openapi.json')
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Parses entry content as JSON and appends a FHIR resource to {#ig_resources} if valid.
|
|
105
|
+
# @param entry [Gem::Package::TarReader::Entry]
|
|
106
|
+
# @return [void]
|
|
107
|
+
def collect_resource_from_entry(entry)
|
|
108
|
+
content = entry.read
|
|
109
|
+
json = JSON.parse(content)
|
|
110
|
+
return unless json.is_a?(Hash) && json['resourceType']
|
|
111
|
+
|
|
112
|
+
@ig_resources << FHIR.from_contents(content)
|
|
113
|
+
rescue StandardError => e
|
|
114
|
+
puts "Error processing #{entry.full_name}: #{e.message}"
|
|
115
|
+
end
|
|
116
|
+
|
|
117
|
+
# Loads all .json files from {#additional_resources_path} (and subfolders) into {#ig_resources}.
|
|
118
|
+
# Skips OpenAPI JSON files. Same validation as package entries: must be a Hash with resourceType.
|
|
119
|
+
# @return [void]
|
|
120
|
+
def load_additional_resources_from_folder
|
|
121
|
+
path = File.expand_path(@additional_resources_path)
|
|
122
|
+
unless File.directory?(path)
|
|
123
|
+
puts "Error: additional resources path is not a directory: #{path}"
|
|
124
|
+
return
|
|
125
|
+
end
|
|
126
|
+
|
|
127
|
+
Dir.glob(File.join(path, '**', '*.json')).each do |file_path|
|
|
128
|
+
next if file_path.end_with?('.openapi.json')
|
|
129
|
+
|
|
130
|
+
collect_resource_from_file(file_path)
|
|
131
|
+
end
|
|
132
|
+
end
|
|
133
|
+
|
|
134
|
+
# @param file_path [String] Absolute path to a JSON file
|
|
135
|
+
# @return [void]
|
|
136
|
+
def collect_resource_from_file(file_path)
|
|
137
|
+
content = File.read(file_path)
|
|
138
|
+
json = JSON.parse(content)
|
|
139
|
+
return unless json.is_a?(Hash) && json['resourceType']
|
|
140
|
+
|
|
141
|
+
resource = FHIR.from_contents(content)
|
|
142
|
+
puts "Resource: #{resource.resourceType} with ID: #{resource.id} is loaded from #{file_path}"
|
|
143
|
+
|
|
144
|
+
@ig_resources << resource
|
|
145
|
+
rescue StandardError => e
|
|
146
|
+
puts "Error processing #{file_path}: #{e.message}"
|
|
147
|
+
end
|
|
148
|
+
end
|
|
149
|
+
end
|