Class: PdfFill::Forms::Va210781

Inherits:
FormBase
  • Object
show all
Includes:
CommonPtsd
Defined in:
lib/pdf_fill/forms/va210781.rb

Constant Summary collapse

INCIDENT_ITERATOR =
PdfFill::HashConverter::ITERATOR
KEY =
{
  'veteranFullName' => {
    'first' => {
      key: 'form1[0].#subform[0].ClaimantsFirstName[0]',
      limit: 12,
      question_num: 1,
      question_suffix: 'A',
      question_text: "VETERAN/BENEFICIARY'S FIRST NAME"
    },
    'middleInitial' => {
      key: 'form1[0].#subform[0].ClaimantsMiddleInitial1[0]'
    },
    'last' => {
      key: 'form1[0].#subform[0].ClaimantsLastName[0]',
      limit: 18,
      question_num: 1,
      question_suffix: 'B',
      question_text: "VETERAN/BENEFICIARY'S LAST NAME"
    }
  },
  'veteranSocialSecurityNumber' => {
    'first' => {
      key: 'form1[0].#subform[0].ClaimantsSocialSecurityNumber_FirstThreeNumbers[0]'
    },
    'second' => {
      key: 'form1[0].#subform[0].ClaimantsSocialSecurityNumber_SecondTwoNumbers[0]'
    },
    'third' => {
      key: 'form1[0].#subform[0].ClaimantsSocialSecurityNumber_LastFourNumbers[0]'
    }
  },
  'veteranSocialSecurityNumber1' => {
    'first' => {
      key: 'form1[0].#subform[1].VeteransSocialSecurityNumber_FirstThreeNumbers[0]'
    },
    'second' => {
      key: 'form1[0].#subform[1].VeteransSocialSecurityNumber_SecondTwoNumbers[0]'
    },
    'third' => {
      key: 'form1[0].#subform[1].VeteransSocialSecurityNumber_LastFourNumbers[0]'
    }
  },
  'veteranSocialSecurityNumber2' => {
    'first' => {
      key: 'form1[0].#subform[2].VeteransSocialSecurityNumber_FirstThreeNumbers[1]'
    },
    'second' => {
      key: 'form1[0].#subform[2].VeteransSocialSecurityNumber_SecondTwoNumbers[1]'
    },
    'third' => {
      key: 'form1[0].#subform[2].VeteransSocialSecurityNumber_LastFourNumbers[1]'
    }
  },
  'vaFileNumber' => {
    key: 'form1[0].#subform[0].VAFileNumber[0]'
  },
  'veteranDateOfBirth' => {
    'month' => {
      key: 'form1[0].#subform[0].DOBmonth[0]'
    },
    'day' => {
      key: 'form1[0].#subform[0].DOBday[0]'
    },
    'year' => {
      key: 'form1[0].#subform[0].DOByear[0]'
    }
  },
  'veteranServiceNumber' => {
    key: 'form1[0].#subform[0].VeteransServiceNumber[0]'
  },
  'email' => {
    key: 'form1[0].#subform[0].PreferredEmail[0]'
  },
  'veteranPhone' => {
    key: 'form1[0].#subform[0].PreferredEmail[1]'
  },
  'veteranSecondaryPhone' => {
    key: 'form1[0].#subform[0].PreferredEmail[2]'
  },
  'incidents' => {
    limit: 2,
    first_key: 'incidentDescription',
    question_text: 'INCIDENTS',
    question_num: 8,
    'incidentDate' => {
      'month' => {
        key: "incidentDateMonth[#{INCIDENT_ITERATOR}]"
      },
      'day' => {
        key: "incidentDateDay[#{INCIDENT_ITERATOR}]"
      },
      'year' => {
        key: "incidentDateYear[#{INCIDENT_ITERATOR}]"
      }
    },
    'unitAssignedDates' => {
      'fromMonth' => {
        key: "unitAssignmentDateFromMonth[#{INCIDENT_ITERATOR}]"
      },
      'fromDay' => {
        key: "unitAssignmentDateFromDay[#{INCIDENT_ITERATOR}]"
      },
      'fromYear' => {
        key: "unitAssignmentDateFromYear[#{INCIDENT_ITERATOR}]"
      },
      'toMonth' => {
        key: "unitAssignmentDateToMonth[#{INCIDENT_ITERATOR}]"
      },
      'toDay' => {
        key: "unitAssignmentDateToDay[#{INCIDENT_ITERATOR}]"
      },
      'toYear' => {
        key: "unitAssignmentDateToYear[#{INCIDENT_ITERATOR}]"
      }
    },
    'incidentLocation' => {
      question_num: 8,
      limit: 3,
      first_key: 'row0',
      'row0' => {
        key: "incidentLocationFirstRow[#{INCIDENT_ITERATOR}]"
      },
      'row1' => {
        key: "incidentLocationSecondRow[#{INCIDENT_ITERATOR}]"
      },
      'row2' => {
        key: "incidentLocationThirdRow[#{INCIDENT_ITERATOR}]"
      }
    },
    'unitAssigned' => {
      question_num: 8,
      limit: 3,
      'row0' => {
        key: "unitAssignmentFirstRow[#{INCIDENT_ITERATOR}]",
        limit: 30
      },
      'row1' => {
        key: "unitAssignmentSecondRow[#{INCIDENT_ITERATOR}]",
        limit: 30
      },
      'row2' => {
        key: "unitAssignmentThirdRow[#{INCIDENT_ITERATOR}]",
        limit: 30
      }
    },
    'incidentDescription' => {
      key: "incidentDescription[#{INCIDENT_ITERATOR}]",
      limit: 268
    },
    'medalsCitations' => {
      key: "medalsCitations[#{INCIDENT_ITERATOR}]"
    },
    'first0' => {
      key: "personInvolvedFirst[0][#{INCIDENT_ITERATOR}]",
      limit: 12
    },
    'middleInitial0' => {
      key: "personInvolvedMiddleI[0][#{INCIDENT_ITERATOR}]"
    },
    'last0' => {
      key: "personInvolvedLast[0][#{INCIDENT_ITERATOR}]",
      limit: 18
    },
    'rank0' => {
      key: "personInvolvedRank[0][#{INCIDENT_ITERATOR}]"
    },
    'injuryDeathDateMonth0' => {
      key: "injuryDeathDateMonth[0][#{INCIDENT_ITERATOR}]"
    },
    'injuryDeathDateDay0' => {
      key: "injuryDeathDateDay[0][#{INCIDENT_ITERATOR}]"
    },
    'injuryDeathDateYear0' => {
      key: "injuryDeathDateYear[0][#{INCIDENT_ITERATOR}]"
    },
    'killedInAction0' => {
      key: "killedInAction0[#{INCIDENT_ITERATOR}]"
    },
    'killedNonBattle0' => {
      key: "killedNonBattle0[#{INCIDENT_ITERATOR}]"
    },
    'woundedInAction0' => {
      key: "woundedInAction0[#{INCIDENT_ITERATOR}]"
    },
    'injuredNonBattle0' => {
      key: "injuredNonBattle0[#{INCIDENT_ITERATOR}]"
    },
    'other0' => {
      key: "other0[#{INCIDENT_ITERATOR}]"
    },
    'otherText0' => {
      key: "otherText0[#{INCIDENT_ITERATOR}]"
    },
    'unitAssigned0Row0' => {
      key: "personUnitAssignedRow0[0][#{INCIDENT_ITERATOR}]",
      limit: 30
    },
    'unitAssigned0Row1' => {
      key: "personUnitAssignedRow1[0][#{INCIDENT_ITERATOR}]",
      limit: 30
    },
    'unitAssigned0Row2' => {
      key: "personUnitAssignedRow2[0][#{INCIDENT_ITERATOR}]",
      limit: 30
    },
    'description0' => {
      always_overflow: true
    },
    'first1' => {
      key: "personInvolvedFirst[1][#{INCIDENT_ITERATOR}]",
      limit: 12
    },
    'middleInitial1' => {
      key: "personInvolvedMiddleI[1][#{INCIDENT_ITERATOR}]"
    },
    'last1' => {
      key: "personInvolvedLast[1][#{INCIDENT_ITERATOR}]",
      limit: 18
    },
    'rank1' => {
      key: "personInvolvedRank[1][#{INCIDENT_ITERATOR}]"
    },
    'injuryDeathDateMonth1' => {
      key: "injuryDeathDateMonth[1][#{INCIDENT_ITERATOR}]"
    },
    'injuryDeathDateDay1' => {
      key: "injuryDeathDateDay[1][#{INCIDENT_ITERATOR}]"
    },
    'injuryDeathDateYear1' => {
      key: "injuryDeathDateYear[1][#{INCIDENT_ITERATOR}]"
    },
    'killedInAction1' => {
      key: "killedInAction1[#{INCIDENT_ITERATOR}]"
    },
    'killedNonBattle1' => {
      key: "killedNonBattle1[#{INCIDENT_ITERATOR}]"
    },
    'woundedInAction1' => {
      key: "woundedInAction1[#{INCIDENT_ITERATOR}]"
    },
    'injuredNonBattle1' => {
      key: "injuredNonBattle1[#{INCIDENT_ITERATOR}]"
    },
    'other1' => {
      key: "other1[#{INCIDENT_ITERATOR}]"
    },
    'otherText1' => {
      key: "otherText1[#{INCIDENT_ITERATOR}]"
    },
    'unitAssigned1Row0' => {
      key: "personUnitAssignedRow0[1][#{INCIDENT_ITERATOR}]",
      limit: 30
    },
    'unitAssigned1Row1' => {
      key: "personUnitAssignedRow1[1][#{INCIDENT_ITERATOR}]",
      limit: 30
    },
    'unitAssigned1Row2' => {
      key: "personUnitAssignedRow2[1][#{INCIDENT_ITERATOR}]",
      limit: 30
    },
    'description1' => {
      always_overflow: true
    },
    'incidentOverflow' => {
      key: '',
      question_text: 'INCIDENTS',
      question_num: 8,
      question_suffix: 'A'
    },
    'personsInvolvedArray' => {
      limit: 2
    }
  },
  'remarks' => {
    key: 'form1[0].#subform[2].REMARKS[0]',
    question_num: 14
  },
  'signature' => {
    key: 'form1[0].#subform[2].Signature[0]'
  },
  'signatureDate' => {
    key: 'form1[0].#subform[2].Date11[0]',
    format: 'date'
  },
  'additionalIncidentText' => {
    question_num: 17,
    question_text: 'ADDITIONAL INCIDENTS',
    limit: 0,
    key: 'none'
  }
}.freeze

Instance Method Summary collapse

Methods included from CommonPtsd

#combine_date_range, #expand_incident_date, #expand_incident_location, #expand_incident_unit_assignment, #expand_ssn, #expand_unit_assigned_dates, #expand_veteran_dob, #format_incident, #get_unit_date_overflow, #split_approximate_date

Methods included from FormHelper

#address_block, #combine_date_ranges, #expand_checkbox_as_hash, #extract_country, #extract_middle_i, #format_boolean, #select_checkbox, #select_radio_button, #split_date, #split_postal_code, #split_ssn, #validate_date

Methods inherited from FormBase

#combine_both_addr, #combine_full_address, #combine_full_address_extras, #combine_full_name, #combine_hash, #combine_name_addr, #combine_name_addr_extras, #combine_postal_code, #combine_previous_names, date_strftime, #expand_checkbox, #expand_date_range, #expand_signature, #initialize

Constructor Details

This class inherits a constructor from PdfFill::Forms::FormBase

Instance Method Details

#merge_fields(_options = {}) ⇒ Object



309
310
311
312
313
314
315
316
317
318
319
# File 'lib/pdf_fill/forms/va210781.rb', line 309

def merge_fields(_options = {})
  @form_data['veteranFullName'] = extract_middle_i(@form_data, 'veteranFullName')
  @form_data = expand_ssn(@form_data)
  @form_data['veteranDateOfBirth'] = expand_veteran_dob(@form_data)
  expand_incidents(@form_data['incidents'])

  expand_signature(@form_data['veteranFullName'])
  @form_data['signature'] = "/es/ #{@form_data['signature']}"

  @form_data
end