Module: Inferno::DSL::MustSupportAssessment
- Included in:
- FHIREvaluation::Rules::AllMustSupportsPresent
- Defined in:
- lib/inferno/dsl/must_support_assessment.rb
Overview
The MustSupportAssessment module contains the logic for tests
that check “All Must Support elements are present”.
Generally, test authors should use assert_must_support_elements_present
or missing_must_support_elements
DSL methods.
A few additional methods are exposed to support the transition of existing tests that
call into these methods directly.
Instance Method Summary collapse
-
#find_missing_elements(resources, must_support_elements) ⇒ Object
-
#missing_element_string(element_definition) ⇒ Object
-
#missing_must_support_elements(resources, profile_url, validator_name: :default, metadata: nil, requirement_extension: nil) {|Metadata| ... } ⇒ Array<String>
Find any Must Support elements defined on the given profile that are missing in the given resources.
-
#perform_must_support_assessment(profile, resources, ig, debug_metadata: false, requirement_extension: nil) {|Metadata| ... } ⇒ Array<String>
perform_must_support_assessment allows customizing the metadata with a block.
Instance Method Details
#find_missing_elements(resources, must_support_elements) ⇒ Object
54 55 56 |
# File 'lib/inferno/dsl/must_support_assessment.rb', line 54 def find_missing_elements(resources, must_support_elements) InternalMustSupportLogic.new().find_missing_elements(resources, must_support_elements) end |
#missing_element_string(element_definition) ⇒ Object
58 59 60 |
# File 'lib/inferno/dsl/must_support_assessment.rb', line 58 def missing_element_string(element_definition) InternalMustSupportLogic.new.missing_element_string(element_definition) end |
#missing_must_support_elements(resources, profile_url, validator_name: :default, metadata: nil, requirement_extension: nil) {|Metadata| ... } ⇒ Array<String>
Find any Must Support elements defined on the given profile that are missing in the given resources. Must Support elements are identified on the profile StructureDefinition and pre-parsed into metadata, which may be customized prior to the check by passing a block. Alternate metadata may be provided directly. Set test suite config flag debug_must_support_metadata: true to log the metadata to a file for debugging.
23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/inferno/dsl/must_support_assessment.rb', line 23 def missing_must_support_elements(resources, profile_url, validator_name: :default, metadata: nil, requirement_extension: nil, &) = config.[:debug_must_support_metadata] if .present? InternalMustSupportLogic.new.(resources, , debug_metadata:) else ig, profile = find_ig_and_profile(profile_url, validator_name) perform_must_support_assessment(profile, resources, ig, debug_metadata:, requirement_extension:, &) end end |
#perform_must_support_assessment(profile, resources, ig, debug_metadata: false, requirement_extension: nil) {|Metadata| ... } ⇒ Array<String>
perform_must_support_assessment allows customizing the metadata with a block. Customizing the metadata may add, modify, or remove items. For instance, US Core 3.1.1 Patient “Previous Name” is defined as MS only in narrative. Choices are also defined only in narrative.
46 47 48 49 50 51 52 |
# File 'lib/inferno/dsl/must_support_assessment.rb', line 46 def perform_must_support_assessment(profile, resources, ig, debug_metadata: false, requirement_extension: nil) test_impl = InternalMustSupportLogic.new = test_impl.(profile, ig, requirement_extension:) yield if block_given? test_impl.(resources, , debug_metadata:) end |