modules/claims_api/app/models/claims_api/auto_established_claim.rb
# The legacy ClaimsApi code has always allowed 'secondaryDisabilities' to have 'specialIssues'.
# EVSS does not allow this.
# Rather than break the API by removing 'specialIssues' from the 'secondaryDisabilities' schema,
# just detect the invalid case and remove the 'specialIssues' before sending to EVSS.
The legacy ClaimsApi code has always allowed 'secondaryDisabilities' to have 'specialIssues'.
EVSS does not allow this.
The legacy ClaimsApi code has always allowed ' secondaryDisabilities ' to have ' specialIssues ' . EVSS does not allow this .
def remove_special_issues_from_secondary_disabilities
      disabilities = form_data['disabilites']
      disabilities.map do |disability|
        next if disability['secondaryDisabilities'].blank?
        disability['secondaryDisabilities'].map do |secondary|
          secondary.delete('specialIssues') if secondary['specialIssues'].present?
          secondary
        end
      end
    end
def remove_special_issues_from_secondary_disabilities disabilities = form_data [ 'disabilites' ] disabilities . map do | disability | next if disability [ 'secondaryDisabilities' ] . blank? disability [ 'secondaryDisabilities' ] . map do | secondary | secondary . delete ( 'specialIssues' ) if secondary [ 'specialIssues' ] . present? secondary end end end
The legacy ClaimsApi code has always allowed 'secondaryDisabilities' to have 'specialIssues'.
The legacy ClaimsApi code has always allowed ' secondaryDisabilities ' to have ' specialIssues ' .