-
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.
77665: Add 10-7959F Mapping/Stamping to IVC Form
- Loading branch information
Showing
7 changed files
with
90 additions
and
5 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
16 changes: 16 additions & 0 deletions
16
modules/simple_forms_api/app/form_mappings/vha_10_7959f.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,16 @@ | ||
{ | ||
"form1[0].#subform[0].VetLastName[0]": "<%= form.data.dig('veteran', 'full_name', 'last') %>", | ||
"form1[0].#subform[0].VetFirstName[0]": "<%= form.data.dig('veteran', 'full_name', 'first') %>", | ||
"form1[0].#subform[0].MiddleInitials[0]": "<%= form.data.dig('veteran', 'full_name', 'middle') %>", | ||
"form1[0].#subform[0].SocialSecurityNumber[0]": "<%= form.data.dig('veteran', 'ssn') %>", | ||
"form1[0].#subform[0].VAClaimFileNumber[0]": "<%= form.data.dig('veteran', 'claim_number') %>", | ||
"form1[0].#subform[0].DateofBirth[0]": "<%= form.data.dig('veteran', 'date_of_birth') %>", | ||
"form1[0].#subform[0].PhysicalAddress[0]": "<%= form.data.dig('veteran', 'physical_address', 'street') + '\n' + form.data.dig('veteran', 'physical_address', 'city') + ', ' + form.data.dig('veteran', 'physical_address', 'state') + '\n' + form.data.dig('veteran', 'physical_address', 'postal_code') %>", | ||
"form1[0].#subform[0].Country[0]": "<%= form.data.dig('veteran', 'physical_address', 'country') %>", | ||
"form1[0].#subform[0].MailingAddress[0]": "<%= form.data.dig('veteran', 'mailing_address', 'street') + '\n' + form.data.dig('veteran', 'mailing_address', 'city') + ', ' + form.data.dig('veteran', 'mailing_address', 'state') + '\n' + form.data.dig('veteran', 'mailing_address', 'postal_code') %>", | ||
"form1[0].#subform[0].Country[1]": "<%= form.data.dig('veteran', 'mailing_address', 'country') %>", | ||
"form1[0].#subform[0].TelephoneNumber[0]": "<%= form.data.dig('veteran', 'phone_number') %>", | ||
"form1[0].#subform[0].EmailAddress[0]": "<%= form.data.dig('veteran', 'email_address') %>", | ||
"form1[0].#subform[0].VeteranSignature[0]": "<%= form.data['statement_of_truth_signature'] %>", | ||
"form1[0].#subform[0].Date[0]": "<%= form.data['current_date'] %>" | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/simple_forms_api/app/models/simple_forms_api/vha_10_7959f.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 VHA107959f | ||
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
31 changes: 31 additions & 0 deletions
31
modules/simple_forms_api/spec/fixtures/form_json/vha_10_7959f.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,31 @@ | ||
{ | ||
"form_number": "10-7959F", | ||
"veteran": { | ||
"date_of_birth": "02/02/1987", | ||
"full_name": { | ||
"first": "Veteran", | ||
"middle": "B", | ||
"last": "Surname" | ||
}, | ||
"physical_address": { | ||
"country": "USA", | ||
"street": "1 Physical Ln", | ||
"city": "Place", | ||
"state": "AL", | ||
"postal_code": "12345" | ||
}, | ||
"mailing_address": { | ||
"country": "USA", | ||
"street": "1 Mail Ln", | ||
"city": "Place", | ||
"state": "PA", | ||
"postal_code": "12345" | ||
}, | ||
"ssn": "222554444", | ||
"claim_number": "123456789", | ||
"phone_number": "9876543213", | ||
"email_address": "[email protected]" | ||
}, | ||
"statement_of_truth_signature": "Veteran B Surname", | ||
"current_date": "01/01/2024" | ||
} |
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 |
---|---|---|
|
@@ -18,7 +18,8 @@ | |
] | ||
|
||
ivc_forms = [ | ||
'vha_10_10d.json' | ||
'vha_10_10d.json', | ||
'vha_10_7959f.json' | ||
] | ||
|
||
describe '#submit' do | ||
|
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