-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[10-10EZ] Boilerplate to generate filled out 10-10EZ pdf (#20784)
* add new form_id instance method to health_care_application model * add ability to test specific test data instead of all three in fill_forms_example shared example * add new va1010ez class to fill out pdf form. Initial implementation is to just fill out the name field
- Loading branch information
Showing
10 changed files
with
195 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'pdf_fill/forms/form_base' | ||
|
||
module PdfFill | ||
module Forms | ||
class Va1010ez < FormBase | ||
FORM_ID = HealthCareApplication::FORM_ID | ||
|
||
KEY = { | ||
'veteranFullName' => { | ||
key: 'F[0].P4[0].LastFirstMiddle[0]' | ||
} | ||
}.freeze | ||
|
||
def merge_fields(_options = {}) | ||
merge_full_name | ||
@form_data | ||
end | ||
|
||
private | ||
|
||
def merge_full_name | ||
@form_data['veteranFullName'] = | ||
combine_full_name(@form_data['veteranFullName']) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
{ | ||
"isMedicaidEligible": true, | ||
"spouseAddress": { | ||
"street": "12345 Elm St", | ||
"city": "Houston", | ||
"postalCode": "77388", | ||
"country": "USA", | ||
"state": "TX" | ||
}, | ||
"spousePhone": "2122122121", | ||
"cohabitedLastYear": true, | ||
"sameAddress": false, | ||
"medicarePartAEffectiveDate": "2000-01-01", | ||
"medicareClaimNumber": "0123456", | ||
"isEnrolledMedicarePartA": true, | ||
"isCoveredByHealthInsurance": true, | ||
"providers": [ | ||
{ | ||
"insuranceName": "Aetna", | ||
"insurancePolicyHolderName": "Indiana Jones", | ||
"insurancePolicyNumber": "32345111", | ||
"insuranceGroupCode": "1233444" | ||
} | ||
], | ||
"deductibleMedicalExpenses": 0, | ||
"deductibleFuneralExpenses": 0, | ||
"deductibleEducationExpenses": 0, | ||
"spouseGrossIncome": 20, | ||
"spouseNetIncome": 21, | ||
"spouseOtherIncome": 22, | ||
"veteranGrossIncome": 60000, | ||
"veteranNetIncome": 0, | ||
"veteranOtherIncome": 0, | ||
"spouseFullName": { | ||
"first": "Jane", | ||
"middle": "marie", | ||
"last": "Jones" | ||
}, | ||
"spouseDateOfBirth": "1977-01-01", | ||
"dateOfMarriage": "2000-01-01", | ||
"maritalStatus": "Married", | ||
"purpleHeartRecipient": true, | ||
"isFormerPow": true, | ||
"postNov111998Combat": true, | ||
"disabledInLineOfDuty": true, | ||
"swAsiaCombat": true, | ||
"vietnamService": true, | ||
"exposedToRadiation": true, | ||
"radiumTreatments": true, | ||
"campLejeune": true, | ||
"discloseFinancialInformation": true, | ||
"lastServiceBranch": "air force", | ||
"lastEntryDate": "1998-01-01", | ||
"lastDischargeDate": "2004-01-01", | ||
"dischargeType": "honorable", | ||
"vaCompensationType": "lowDisability", | ||
"isAmericanIndianOrAlaskanNative": true, | ||
"isAsian": true, | ||
"isBlackOrAfricanAmerican": true, | ||
"isSpanishHispanicLatino": true, | ||
"isNativeHawaiianOrOtherPacificIslander": true, | ||
"isWhite": true, | ||
"hasDemographicNoAnswer": true, | ||
"isEssentialAcaCoverage": true, | ||
"vaMedicalFacility": "520GA", | ||
"wantsInitialVaContact": true, | ||
"email": "[email protected]", | ||
"homePhone": "3462636183", | ||
"mobilePhone": "3462636184", | ||
"veteranAddress": { | ||
"street": "321 Elm St", | ||
"city": "Houston", | ||
"postalCode": "77388", | ||
"country": "USA", | ||
"state": "TX" | ||
}, | ||
"gender": "M", | ||
"mothersMaidenName": "Test", | ||
"cityOfBirth": "Spring", | ||
"stateOfBirth": "TX", | ||
"veteranFullName": "Indiana Bill Jones II", | ||
"veteranSocialSecurityNumber": "234221243", | ||
"veteranDateOfBirth": "1980-01-01", | ||
"privacyAgreementAccepted": true, | ||
"dependents": [ | ||
{ | ||
"fullName": { | ||
"first": "Bob", | ||
"middle": "Joe", | ||
"last": "Jones" | ||
}, | ||
"dependentRelation": "Son", | ||
"socialSecurityNumber": "343221234", | ||
"dateOfBirth": "2000-02-01", | ||
"becameDependent": "2000-02-01", | ||
"attendedSchoolLastYear": true, | ||
"dependentEducationExpenses": 0, | ||
"disabledBefore18": false, | ||
"cohabitedLastYear": true, | ||
"grossIncome": 10, | ||
"netIncome": 11, | ||
"otherIncome": 12 | ||
} | ||
], | ||
"veteranHomeAddress": { | ||
"street": "123 Elm St", | ||
"city": "Houston", | ||
"postalCode": "77388", | ||
"country": "USA", | ||
"state": "TX" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
# frozen_string_literal: true | ||
|
||
require 'rails_helper' | ||
require 'pdf_fill/forms/va1010ez' | ||
require 'lib/pdf_fill/fill_form_examples' | ||
|
||
describe PdfFill::Forms::Va1010ez do | ||
include SchemaMatchers | ||
|
||
let(:form_data) do | ||
get_fixture('pdf_fill/10-10EZ/simple') | ||
end | ||
|
||
let(:form_class) do | ||
described_class.new(form_data) | ||
end | ||
|
||
it_behaves_like 'a form filler', { | ||
form_id: described_class::FORM_ID, | ||
factory: :health_care_application, | ||
input_data_fixture_dir: 'spec/fixtures/pdf_fill/10-10EZ', | ||
output_pdf_fixture_dir: 'spec/fixtures/pdf_fill/10-10EZ/unsigned', | ||
test_data_types: %w[simple] | ||
} | ||
|
||
describe '#merge_fields' do | ||
it 'merges the right fields' do | ||
expect(form_class.merge_fields.to_json).to eq( | ||
get_fixture('pdf_fill/10-10EZ/merge_fields').to_json | ||
) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters