Commit c7a6b32 1 parent f23980d commit c7a6b32 Copy full SHA for c7a6b32
File tree 6 files changed +16
-21
lines changed
fixtures/pdf_fill/21-0781V2
support/disability_compensation_form
6 files changed +16
-21
lines changed Original file line number Diff line number Diff line change @@ -619,6 +619,7 @@ def merge_fields(_options = {})
619
619
620
620
set_treatment_selection
621
621
set_reports_selection
622
+ set_option_indicator
622
623
623
624
format_other_behavior_details
624
625
format_police_report_location
@@ -674,6 +675,16 @@ def set_reports_selection
674
675
@form_data [ 'otherReport' ] = reports [ 'other' ] ? 4 : nil
675
676
end
676
677
678
+ def set_option_indicator
679
+ selected_option = @form_data [ 'optionIndicator' ]
680
+ valid_options = %w[ yes no revoke notEnrolled ]
681
+
682
+ return if selected_option . nil? || valid_options . exclude? ( selected_option )
683
+
684
+ @form_data [ 'optionIndicator' ] = valid_options . index_with { |_option | false }
685
+ @form_data [ 'optionIndicator' ] [ selected_option ] = true
686
+ end
687
+
677
688
def format_other_behavior_details
678
689
other_behavior = @form_data [ 'behaviors' ] &.[]( 'otherBehavior' )
679
690
return if other_behavior . blank?
Original file line number Diff line number Diff line change 115
115
"noDates" : true
116
116
}
117
117
],
118
- "optionIndicator" : {
119
- "yes" : false ,
120
- "no" : false ,
121
- "revoke" : false ,
122
- "notEnrolled" : true
123
- },
118
+ "optionIndicator" : " notEnrolled" ,
124
119
"signatureDate" : " 2016-01-31"
125
120
}
Original file line number Diff line number Diff line change 144
144
"noDates" : true
145
145
}
146
146
],
147
- "optionIndicator" : {
148
- "yes" : false ,
149
- "no" : false ,
150
- "revoke" : false ,
151
- "notEnrolled" : true
152
- },
147
+ "optionIndicator" : " notEnrolled" ,
153
148
"signatureDate" : " 2016-01-31"
154
149
}
Original file line number Diff line number Diff line change 241
241
"noDates" : true
242
242
}
243
243
],
244
- "optionIndicator" : {
245
- "notEnrolled" : true
246
- },
244
+ "optionIndicator" : " notEnrolled" ,
247
245
"additionalInformation" : " Lorem ipsum dolor sit amet."
248
246
}
249
247
}
Original file line number Diff line number Diff line change 116
116
"noDates" : true
117
117
}
118
118
],
119
- "optionIndicator" : {
120
- "notEnrolled" : true
121
- },
119
+ "optionIndicator" : " notEnrolled" ,
122
120
"additionalInformation" : " Lorem ipsum dolor sit amet."
123
121
}
124
122
}
Original file line number Diff line number Diff line change 421
421
"noDates" : true
422
422
}
423
423
],
424
- "optionIndicator" : {
425
- "notEnrolled" : true
426
- },
424
+ "optionIndicator" : " notEnrolled" ,
427
425
"additionalInformation" : " Lorem ipsum dolor sit amet."
428
426
}
429
427
},
You can’t perform that action at this time.
0 commit comments