Class: EVSS::DisabilityCompensationForm::DataTranslationAllClaim

Inherits:
Object
  • Object
show all
Defined in:
lib/evss/disability_compensation_form/data_translation_all_claim.rb

Overview

Transforms a client submission into the format expected by the EVSS 526 service

Constant Summary collapse

HOMELESS_SITUATION_TYPE =

rubocop:disable Metrics/ClassLength

{
  'shelter' => 'LIVING_IN_A_HOMELESS_SHELTER',
  'notShelter' => 'NOT_CURRENTLY_IN_A_SHELTERED_ENVIRONMENT',
  'anotherPerson' => 'STAYING_WITH_ANOTHER_PERSON',
  'fleeing' => 'FLEEING_CURRENT_RESIDENCE',
  'other' => 'OTHER'
}.freeze
HOMELESS_RISK_SITUATION_TYPE =
{
  'losingHousing' => 'HOUSING_WILL_BE_LOST_IN_30_DAYS',
  'leavingShelter' => 'LEAVING_PUBLICLY_FUNDED_SYSTEM_OF_CARE',
  'other' => 'OTHER'
}.freeze
TERMILL_OVERFLOW_TEXT =
"Corporate Flash Details\n" \
"This applicant has indicated that they're terminally ill.\n"
FORM4142_OVERFLOW_TEXT =
'VA Form 21-4142/4142a has been completed by the applicant and sent to the ' \
'PMR contractor for processing in accordance with M21-1 III.iii.1.D.2.'
EVSS_TZ =

EVSS validates this date using CST, at some point this may change to EST.

'Central Time (US & Canada)'

Instance Method Summary collapse

Constructor Details

#initialize(user, form_content, has_form4142) ⇒ DataTranslationAllClaim

Returns a new instance of DataTranslationAllClaim.



37
38
39
40
41
42
43
# File 'lib/evss/disability_compensation_form/data_translation_all_claim.rb', line 37

def initialize(user, form_content, has_form4142)
  @form_submission_date = Time.now.in_time_zone(EVSS_TZ).to_date
  @user = user
  @form_content = form_content
  @has_form4142 = has_form4142
  @translated_form = { 'form526' => {} }
end

Instance Method Details

#translateHash

Performs the translation by merging system user data and data fetched from upstream services

Returns:

  • (Hash)

    The translated form ready for submission



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/evss/disability_compensation_form/data_translation_all_claim.rb', line 49

def translate
  output_form['claimantCertification'] = true
  output_form['standardClaim'] = input_form['standardClaim']
  output_form['autoCestPDFGenerationDisabled'] = input_form['autoCestPDFGenerationDisabled'] || false
  output_form['applicationExpirationDate'] = application_expiration_date
  output_form['overflowText'] = overflow_text
  output_form['bddQualified'] = bdd_qualified?
  output_form['claimSubmissionSource'] = 'VA.gov'
  output_form.compact!

  output_form.update(translate_banking_info)
  output_form.update(translate_service_pay)
  output_form.update(translate_service_info)
  output_form.update(translate_veteran)
  output_form.update(translate_treatments)
  output_form.update(translate_disabilities)

  @translated_form
end