Class: VAProfile::Profile::V3::Service
Overview
NOTE: This controller is used for discovery purposes. Please contact the Authenticated Experience Profile team before using.
Constant Summary
collapse
- OID =
'2.16.840.1.113883.3.42.10001.100001.12'
- AAID =
'^NI^200DOD^USDOD'
Instance Attribute Summary collapse
Instance Method Summary
collapse
#config, configuration, #connection, #delete, #get, #perform, #post, #put, #raise_backend_exception, #raise_not_authenticated, #request, #sanitize_headers!, #service_name
#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger, #set_sentry_metadata
Constructor Details
#initialize(user) ⇒ Service
Returns a new instance of Service.
21
22
23
24
|
# File 'lib/va_profile/profile/v3/service.rb', line 21
def initialize(user)
@user = user
super()
end
|
Instance Attribute Details
#user ⇒ Object
Returns the value of attribute user.
19
20
21
|
# File 'lib/va_profile/profile/v3/service.rb', line 19
def user
@user
end
|
Instance Method Details
#body ⇒ Object
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
|
# File 'lib/va_profile/profile/v3/service.rb', line 60
def body
{
bios: [
{ bioPath: 'militaryPerson.adminDecisions' },
{ bioPath: 'militaryPerson.adminEpisodes' },
{ bioPath: 'militaryPerson.dentalIndicators' },
{ bioPath: 'militaryPerson.militaryOccupations', parameters: { scope: 'all' } },
{ bioPath: 'militaryPerson.militaryServiceHistory', parameters: { scope: 'all' } },
{ bioPath: 'militaryPerson.militarySummary' },
{ bioPath: 'militaryPerson.militarySummary.customerType.dodServiceSummary' },
{ bioPath: 'militaryPerson.payGradeRanks', parameters: { scope: 'highest' } },
{ bioPath: 'militaryPerson.prisonerOfWars' },
{ bioPath: 'militaryPerson.transferOfEligibility' },
{ bioPath: 'militaryPerson.retirements' },
{ bioPath: 'militaryPerson.separationPays' },
{ bioPath: 'militaryPerson.retirementPays' },
{ bioPath: 'militaryPerson.combatPays' },
{ bioPath: 'militaryPerson.unitAssignments' }
]
}
end
|
#get_health_benefit_bio ⇒ Object
26
27
28
29
30
31
32
33
34
35
|
# File 'lib/va_profile/profile/v3/service.rb', line 26
def get_health_benefit_bio
oid = MPI::Constants::VA_ROOT_OID
path = "#{oid}/#{ERB::Util.url_encode(icn_with_aaid)}"
service_response = perform(:post, path, { bios: [{ bioPath: 'healthBenefit' }] })
response = VAProfile::Profile::V3::HealthBenefitBioResponse.new(service_response)
Sentry.(response.debug_data) unless response.ok?
code = response.code || 502
raise_backend_exception("VET360_#{code}", self.class) if response.server_error?
response
end
|
#get_military_info ⇒ Object
37
38
39
|
# File 'lib/va_profile/profile/v3/service.rb', line 37
def get_military_info
config.submit(path(@user.edipi), body)
end
|
#get_military_occupations ⇒ Object
#icn_with_aaid ⇒ Object
53
54
55
56
57
58
|
# File 'lib/va_profile/profile/v3/service.rb', line 53
def icn_with_aaid
return "#{user.idme_uuid}^PN^200VIDM^USDVA" if user.idme_uuid
return "#{user.logingov_uuid}^PN^200VLGN^USDVA" if user.logingov_uuid
nil
end
|
#path(edipi) ⇒ Object
82
83
84
|
# File 'lib/va_profile/profile/v3/service.rb', line 82
def path(edipi)
"#{OID}/#{ERB::Util.url_encode("#{edipi}#{AAID}")}"
end
|
#submit(params) ⇒ Object
47
48
49
|
# File 'lib/va_profile/profile/v3/service.rb', line 47
def submit(params)
config.submit(path(@user.edipi), params)
end
|