Module: DaVinciPlanNetTestKit::SpecialCases

Defined in:
lib/davinci_plan_net_test_kit/generator/special_cases.rb

Class Method Summary collapse

Class Method Details

.filter_instance_for_parameterless_gathering?(profile_url, instance) ⇒ Boolean

Returns:

  • (Boolean)


78
79
80
81
82
83
84
85
86
87
88
89
# File 'lib/davinci_plan_net_test_kit/generator/special_cases.rb', line 78

def self.filter_instance_for_parameterless_gathering?(profile_url, instance)
  case profile_url
  when 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Organization'
    # filter if we see the network type
    instance.type.reduce(false) { |outer_result, a_type| outer_result || a_type.coding.reduce(false) { |result, a_coding| result || (a_coding.code == 'ntwk' && a_coding.system == 'http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrgTypeCS') } }
  when 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Network'
    # filter unless we see the network type
    instance.type.reduce(true) { |outer_result, a_type| outer_result && a_type.coding.reduce(true) { |result, a_coding| result && !(a_coding.code == 'ntwk' && a_coding.system == 'http://hl7.org/fhir/us/davinci-pdex-plan-net/CodeSystem/OrgTypeCS') } }
  else
    false
  end
end