Module: DaVinciPlanNetTestKit::Generator::Naming

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

Class Method Summary collapse

Class Method Details

.resource_has_multiple_profiles?(resource) ⇒ Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/davinci_plan_net_test_kit/generator/naming.rb', line 10

def resource_has_multiple_profiles?(resource)
  resources_with_multiple_profiles.include? resource
end

.resources_with_multiple_profilesObject



6
7
8
# File 'lib/davinci_plan_net_test_kit/generator/naming.rb', line 6

def resources_with_multiple_profiles
  ['Organization']
end

.snake_case_for_profile(group_metadata) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/davinci_plan_net_test_kit/generator/naming.rb', line 14

def snake_case_for_profile()
  resource = .resource
  return "org_affil" if resource == "OrganizationAffiliation" 
  return resource.underscore unless resource_has_multiple_profiles?(resource)

  # Networks and Organizations need to be separated
  case .profile_url
  when 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Network'
    return 'network'
  when 'http://hl7.org/fhir/us/davinci-pdex-plan-net/StructureDefinition/plannet-Organization'
    return 'organization'
  end
end

.upper_camel_case_for_profile(group_metadata) ⇒ Object



28
29
30
# File 'lib/davinci_plan_net_test_kit/generator/naming.rb', line 28

def upper_camel_case_for_profile()
  snake_case_for_profile().camelize
end