-
Notifications
You must be signed in to change notification settings - Fork 127
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Sample PDF, Spec updates, PDF JSON, Upload/PDF Stamper logic
- Loading branch information
Showing
8 changed files
with
169 additions
and
3 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
46 changes: 46 additions & 0 deletions
46
modules/simple_forms_api/app/form_mappings/vha_10_7959a.json.erb
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,46 @@ | ||
{ | ||
"form1[0].#subform[0].Phone-ptnt[0]": "<%= form.data.dig('veteran', 'phone_number') %>", | ||
"form1[0].#subform[0].ZIPCode-ptnt[0]": "<%= form.data.dig('veteran', 'address', 'postal_code') %>", | ||
"form1[0].#subform[0].State-ptnt[0]": "<%= form.data.dig('veteran', 'address', 'state') %>", | ||
"form1[0].#subform[0].City-ptnt[0]": "<%= form.data.dig('veteran', 'address', 'city') %>", | ||
"form1[0].#subform[0].Date-Ptnt[0]": "<%= form.data.dig('veteran', 'date_of_birth') %>", | ||
"form1[0].#subform[0].CheckIfNew[0]": "<%= form.data.dig('veteran', 'is_new_address') %>", | ||
"form1[0].#subform[0].StreetAddrss-ptnt[0]": "<%= form.data.dig('veteran', 'address', 'street') %>", | ||
"form1[0].#subform[0].SSN-ptnt[0]": "<%= form.data.dig('veteran', 'ssn_or_tin') %>", | ||
"form1[0].#subform[0].MiddleInit-ptnt[0]": "<%= form.data.dig('veteran', 'full_name', 'middle') %>", | ||
"form1[0].#subform[0].FirstNme-ptnt[0]": "<%= form.data.dig('veteran', 'full_name', 'first') %>", | ||
"form1[0].#subform[0].LastNme-ptnt[0]": "<%= form.data.dig('veteran', 'full_name', 'last') %>", | ||
|
||
"form1[0].#subform[0].#area[2].WorkRelatedTreat[0]": "", | ||
"form1[0].#subform[0].#area[2]": "", | ||
"form1[0].#subform[0].#area[0].OutsdWrkAccdnt[0]": "", | ||
"form1[0].#subform[0].#area[0]": "", | ||
"form1[0].#subform[0].PtntCverage[0]": "", | ||
"form1[0].#subform[0].NameOHI-1[0]": "<%= form.data.dig('ohi_info', 'insurances')[0]&.dig('name') %>", | ||
"form1[0].#subform[0].OHIPolicyNmbr-1[0]": "<%= form.data.dig('ohi_info', 'insurances')[0]&.dig('policy_number') %>", | ||
"form1[0].#subform[0].Phone-OHI-1[0]": "<%= form.data.dig('ohi_info', 'insurances')[0]&.dig('phone_number') %>", | ||
"form1[0].#subform[0].NameOHI-2[0]": "<%= form.data.dig('ohi_info', 'insurances')[1]&.dig('name') %>", | ||
"form1[0].#subform[0].OHIPolicyNmbr-2[0]": "<%= form.data.dig('ohi_info', 'insurances')[1]&.dig('policy_number') %>", | ||
"form1[0].#subform[0].Phone-OHI-2[0]": "<%= form.data.dig('ohi_info', 'insurances')[1]&.dig('phone_number') %>", | ||
"form1[0].#subform[0].#area[1].RadioButtonList[0]": "", | ||
"form1[0].#subform[0].#area[1].RadioButtonList[1]": "", | ||
"form1[0].#subform[0].#area[1].RadioButtonList[2]": "", | ||
"form1[0].#subform[0].#area[1].RadioButtonList[3]": "", | ||
"form1[0].#subform[0].#area[1].SpecifyOtherPrimaryHealthInsurance[0]": "<%= form.data.dig('ohi_info', 'coverage_type_other') %>", | ||
|
||
"form1[0].#subform[0].LastNme-spnsr[0]": "<%= form.data.dig('sponsor', 'full_name', 'last') %>", | ||
"form1[0].#subform[0].FirstNme-spnsr[0]": "<%= form.data.dig('sponsor', 'full_name', 'first') %>", | ||
"form1[0].#subform[0].MiddleInit-spnsr[0]": "<%= form.data.dig('sponsor', 'full_name', 'middle') %>", | ||
|
||
"form1[0].#subform[0].SignatureTelephoneNumber[0]": "<%= form.data.dig('claimant', 'phone_number') %>", | ||
"form1[0].#subform[0].SignatureZipCode[0]": "<%= form.data.dig('claimant', 'address', 'postal_code') %>", | ||
"form1[0].#subform[0].SignatureState[0]": "<%= form.data.dig('claimant', 'address', 'state') %>", | ||
"form1[0].#subform[0].SignatureCity[0]": "<%= form.data.dig('claimant', 'address', 'city') %>", | ||
"form1[0].#subform[0].SignatureStreetAddress[0]": "<%= form.data.dig('claimant', 'address', 'street') %>", | ||
"form1[0].#subform[0].SignatureField1[0]": "<%= form.data.dig('claimant', 'signature') %>", | ||
"form1[0].#subform[0].SignatureMiddleInitial[0]": "<%= form.data.dig('claimant', 'full_name', 'middle') %>", | ||
"form1[0].#subform[0].SignatureFirstName[0]": "<%= form.data.dig('claimant', 'full_name', 'first') %>", | ||
"form1[0].#subform[0].SignatureLastName[0]": "<%= form.data.dig('claimant', 'full_name', 'last') %>", | ||
"form1[0].#subform[0].relationshipToApplicant[0]": "<%= form.data.dig('claimant', 'relationship_to_patient') %>", | ||
"form1[0].#subform[0].SignatureDateOfBirth2[0]": "<%= form.data.dig('claimant', 'date_of_birth') %>" | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/simple_forms_api/app/models/simple_forms_api/vha_10_7959a.rb
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,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module SimpleFormsApi | ||
class VHA107959a | ||
include Virtus.model(nullify_blank: true) | ||
|
||
attribute :data | ||
|
||
def initialize(data) | ||
@data = data | ||
end | ||
|
||
def metadata | ||
{ | ||
'veteranFirstName' => @data.dig('veteran', 'full_name', 'first'), | ||
'veteranLastName' => @data.dig('veteran', 'full_name', 'last'), | ||
'fileNumber' => @data.dig('veteran', 'va_file_number').presence || @data.dig('veteran', 'ssn'), | ||
'zipCode' => @data.dig('veteran', 'address', 'postal_code'), | ||
'source' => 'VA Platform Digital Forms', | ||
'docType' => @data['form_number'], | ||
'businessLine' => 'CMP' | ||
} | ||
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
66 changes: 66 additions & 0 deletions
66
modules/simple_forms_api/spec/fixtures/form_json/vha_10_7959a.json
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,66 @@ | ||
{ | ||
"form_number": "10-7959A", | ||
"veteran": { | ||
"date_of_birth": "1987-02-02", | ||
"address": { | ||
"country": "USA", | ||
"street": "1 First Ln", | ||
"city": "Place", | ||
"state": "AL", | ||
"postal_code": "12345" | ||
}, | ||
"full_name": { | ||
"first": "Veteran", | ||
"middle": "B", | ||
"last": "Surname" | ||
}, | ||
"ssn_or_tin": "222554444", | ||
"va_claim_number": "123456789", | ||
"phone_number": "9876543213", | ||
"is_new_address": true | ||
}, | ||
"sponsor": { | ||
"full_name": { | ||
"first": "Sponsor", | ||
"middle": "P", | ||
"last": "Sponsor_Surname" | ||
} | ||
}, | ||
"ohi_info": { | ||
"is_treatment_work_injury": false, | ||
"is_treatement_non_work_injury": true, | ||
"is_patient_covered": true, | ||
"coverage_type": "other", | ||
"coverage_type_other": "", | ||
"insurances": [ | ||
{ | ||
"name": "OHI LLC", | ||
"policy_number": "7777", | ||
"phone_number": "215-345-2424" | ||
}, | ||
{ | ||
"name": "OHI ORG", | ||
"policy_number": "9999", | ||
"phone_number": "668-123-4567" | ||
} | ||
] | ||
}, | ||
"claimant": { | ||
"date_of_birth": "1986-03-03", | ||
"full_name": { | ||
"first": "Claimant", | ||
"middle": "L", | ||
"last": "Claimant_Surname" | ||
}, | ||
"address": { | ||
"country": "USA", | ||
"street": "2 Second Ln", | ||
"city": "Place Two", | ||
"state": "PA", | ||
"postal_code": "54321" | ||
}, | ||
"phone_number": "2153555555", | ||
"relationship_to_patient": "Mother", | ||
"signature": "Claimant Signature" | ||
} | ||
} |
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.