Module: AUCoreTestKit::Generator::SpecialCases

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

Constant Summary collapse

RESOURCES_TO_EXCLUDE =
%w[
  Medication
  DiagnosticReport
].freeze
PROFILES_TO_EXCLUDE =
[].freeze
PATIENT_IDENTIFIERS =
[
  { display: 'IHI', url: 'http://ns.electronichealth.net.au/id/hi/ihi/1.0' },
  { display: 'Medicare', url: 'http://ns.electronichealth.net.au/id/medicare-number' },
  { display: 'DVA', url: 'http://ns.electronichealth.net.au/id/dva' }
].freeze
PRACTITIONER_IDENTIFIERS =
[
  { display: 'HPI-I', url: 'http://ns.electronichealth.net.au/id/hi/hpii/1.0' }
].freeze
PRACTITIONER_ROLE_IDENTIFIERS =
[
  { display: 'Medicare', url: 'http://ns.electronichealth.net.au/id/medicare-provider-number' }
].freeze
ORGANIZATION_IDENTIFIERS =
[
  { display: 'HPI-O', url: 'http://ns.electronichealth.net.au/id/hi/hpio/1.0' },
  { display: 'ABN', url: 'http://hl7.org.au/id/abn' }
].freeze
SEARCH_PARAMS_FOR_INCLUDE_BY_RESOURCE =
{
  'MedicationStatement' => [
    ['medication']
  ],
  'MedicationRequest' => [
    ['patient'],
    %w[patient intent],
    %w[patient intent status],
    ['_id'],
    %w[patient intent authoredon]
  ],
  'PractitionerRole' => [
    ['identifier'],
    ['practitioner'],
    ['_id'],
    ['specialty']
  ]
}.freeze
MULTIPLE_OR_AND_SEARCH_BY_TARGET_RESOURCE =
{
  'PractitionerRole' => [['practitioner']]
}.freeze

Class Method Summary collapse

Class Method Details

.exclude_group?(group) ⇒ Boolean

Returns:

  • (Boolean)


64
65
66
67
68
69
70
71
# File 'lib/au_core_test_kit/generator/special_cases.rb', line 64

def exclude_group?(group)
  case group.version
  when 'v1.0.0'
    %w[Medication RelatedPerson].include?(group.resource)
  else
    RESOURCES_TO_EXCLUDE.include?(group.resource)
  end
end

.multiple_or_and_search_by_target_resourceObject



93
94
95
# File 'lib/au_core_test_kit/generator/special_cases.rb', line 93

def multiple_or_and_search_by_target_resource
  MULTIPLE_OR_AND_SEARCH_BY_TARGET_RESOURCE
end

.organization_au_identifiersObject



85
86
87
# File 'lib/au_core_test_kit/generator/special_cases.rb', line 85

def organization_au_identifiers
  ORGANIZATION_IDENTIFIERS
end

.patient_au_identifiersObject



73
74
75
# File 'lib/au_core_test_kit/generator/special_cases.rb', line 73

def patient_au_identifiers
  PATIENT_IDENTIFIERS
end

.practitioner_au_identifiersObject



77
78
79
# File 'lib/au_core_test_kit/generator/special_cases.rb', line 77

def practitioner_au_identifiers
  PRACTITIONER_IDENTIFIERS
end

.practitionerrole_au_identifiersObject



81
82
83
# File 'lib/au_core_test_kit/generator/special_cases.rb', line 81

def practitionerrole_au_identifiers
  PRACTITIONER_ROLE_IDENTIFIERS
end

.search_params_for_include_by_resourceObject



89
90
91
# File 'lib/au_core_test_kit/generator/special_cases.rb', line 89

def search_params_for_include_by_resource
  SEARCH_PARAMS_FOR_INCLUDE_BY_RESOURCE
end