@@ -342,13 +342,14 @@ class Va210781v2 < FormBase
342342 question_num : 11 ,
343343 question_suffix : 'B' ,
344344 question_label : 'Other' ,
345- question_type : 'checklist_group' ,
346345 question_text : 'Other Report'
347346 } ,
348347 'otherOverflow' => {
349348 key : '' ,
350349 question_num : 11 ,
351350 question_suffix : 'B' ,
351+ question_label : 'Other' ,
352+ question_type : 'checklist_group' ,
352353 question_text : 'Other Report'
353354 }
354355 } ,
@@ -716,7 +717,7 @@ def process_reports(extras_redesign: false)
716717 no_report = false
717718 police_reports = [ ]
718719 unlisted_reports = [ ]
719- reports_details = @form_data [ 'reportsDetails' ] ||= { }
720+ @form_data [ 'reportsDetails' ] ||= { }
720721
721722 @form_data [ 'events' ] . each do |event |
722723 reports = merge_reports ( event )
@@ -738,7 +739,7 @@ def process_reports(extras_redesign: false)
738739 @form_data [ 'noReportFiled' ] = no_report && !report_filed ? 1 : nil
739740
740741 process_police_reports ( police_reports , extras_redesign )
741- reports_details [ 'other' ] = unlisted_reports . join ( '; ' ) unless unlisted_reports . empty?
742+ process_unlisted_reports ( unlisted_reports , extras_redesign )
742743 end
743744
744745 def process_police_reports ( police_reports , extras_redesign )
@@ -754,6 +755,13 @@ def process_police_reports(police_reports, extras_redesign)
754755 end
755756 end
756757
758+ def process_unlisted_reports ( unlisted_reports , extras_redesign )
759+ return if unlisted_reports . empty?
760+
761+ @form_data [ 'reportsDetails' ] [ 'other' ] = unlisted_reports . join ( '; ' )
762+ @form_data [ 'reportsDetails' ] [ 'otherOverflow' ] = unlisted_reports if extras_redesign
763+ end
764+
757765 def process_treatment_dates
758766 @form_data [ 'treatmentProvidersDetails' ] &.each do |item |
759767 item [ 'noDates' ] = item [ 'treatmentMonth' ] . to_s . strip . empty? && item [ 'treatmentYear' ] . to_s . strip . empty?
0 commit comments