app/services/form1010cg/service.rb
# Will search eMIS for the provided form subject and return `true` if the subject is a verteran.
# The result will be cached and subsequent calls will return the cached value, preventing additional api requests.
#
# @param form_subject [String] The key in the claim's data that contains this person's info (ex: "veteran")
# @return [true | false] Returns `true` if the form subject is a veteran and false otherwise.
Will search eMIS for the provided form subject and return `true` if the subject is a verteran.
The result will be cached and subsequent calls will return the cached value, preventing additional api requests.
Will search eMIS for the provided form subject and return ` true ` if the subject is a verteran . The result will be cached and subsequent calls will return the cached value preventing additional api requests .
def is_veteran(form_subject) 
      cached_veteran_status = @cache[:veteran_statuses][form_subject]
      return cached_veteran_status unless cached_veteran_status.nil?
      icn = icn_for(form_subject)
      return @cache[:veteran_statuses][form_subject] = false if icn == NOT_FOUND
      response = emis_service.get_veteran_status(icn: icn)
      is_veteran = response&.items&.first&.title38_status_code == 'V1'
      @cache[:veteran_statuses][form_subject] = is_veteran || false
    end
def is_veteran ( form_subject ) cached_veteran_status = @cache [ :veteran_statuses ] [ form_subject ] return cached_veteran_status unless cached_veteran_status . nil? icn = icn_for ( form_subject ) return @cache [ :veteran_statuses ] [ form_subject ] = false if icn == NOT_FOUND response = emis_service . get_veteran_status ( icn : icn ) is_veteran = response &. items &. first &. title38_status_code == 'V1' @cache [ :veteran_statuses ] [ form_subject ] = is_veteran || false end
Will search eMIS for the provided form subject and return `true` if the subject is a verteran.
Will search eMIS for the provided form subject and return ` true ` if the subject is a verteran .
# rubocop:disable Naming/PredicateName
Returns `true` if the form subject is a veteran and false otherwise.
Returns ` true ` if the form subject is a veteran and false otherwise .
true | false
form_subject
The key in the claim's data that contains this person's info (ex: "veteran")
The key in the claim ' s data that contains this person ' s info ( ex : " veteran " )