Class: EVSSClaimDocument

Inherits:
Common::Base show all
Includes:
ActiveModel::Validations, ActiveModel::Validations::Callbacks, SentryLogging
Defined in:
app/models/evss_claim_document.rb

Constant Summary collapse

DOCUMENT_TYPES =

rubocop:disable Layout/LineLength

{
  '1489' => 'Hypertension Rapid Ready For Decision Summary PDF',
  'L015' => 'Buddy/Lay Statement',
  'L018' => 'Civilian Police Reports',
  'L023' => 'Other Correspondence',
  'L029' => 'Copy of a DD214',
  'L034' => 'Military Personnel Record',
  'L048' => 'Medical Treatment Record - Government Facility',
  'L049' => 'Medical Treatment Record - Non-Government Facility',
  'L070' => 'Photographs',
  'L102' => 'VA Form 21-2680 - Examination for Housebound Status or Permanent Need for Regular Aid & Attendance',
  'L107' => 'VA Form 21-4142 - Authorization To Disclose Information',
  'L115' => 'VA Form 21-4192 - Request for Employment Information in Connection with Claim for Disability',
  'L117' => 'VA Form 21-4502 - Application for Automobile or Other Conveyance and Adaptive Equipment Under 38 U.S.C. 3901-3904',
  'L133' => 'VA Form 21-674 - Request for Approval of School Attendance',
  'L139' => 'VA Form 21-686c - Declaration of Status of Dependents',
  'L149' => 'VA Form 21-8940 - Veterans Application for Increased Compensation Based on Un-employability',
  'L159' => 'VA Form 26-4555 - Application in Acquiring Specially Adapted Housing or Special Home Adaptation Grant',
  'L222' => 'VA Form 21-0779 - Request for Nursing Home Information in Connection with Claim for Aid & Attendance',
  'L228' => 'VA Form 21-0781 - Statement in Support of Claim for PTSD',
  'L229' => 'VA Form 21-0781a - Statement in Support of Claim for PTSD Secondary to Personal Assault',
  'L450' => 'STR - Dental - Photocopy',
  'L451' => 'STR - Medical - Photocopy',
  'L478' => 'Medical Treatment Records - Furnished by SSA',
  'L702' => 'Disability Benefits Questionnaire (DBQ)',
  'L703' => 'Goldmann Perimetry Chart/Field Of Vision Chart',
  'L827' => 'VA Form 21-4142a - General Release for Medical Provider Information',
  'L1489' => 'Automated Review Summary Document'
}.freeze
EVSS_TEXT_ENCODING =

rubocop:enable Layout/LineLength

'ascii'
MINIMUM_ENCODING_CONFIDENCE =

EVSS only accepts text files written in ASCII

0.5

Instance Attribute Summary

Attributes inherited from Common::Base

#errors_hash, #metadata

Instance Method Summary collapse

Methods included from SentryLogging

#log_exception_to_sentry, #log_message_to_sentry, #non_nil_hash?, #normalize_level, #rails_logger

Methods inherited from Common::Base

#changed, #changed?, #changes, default_sort, filterable_attributes, #initialize, max_per_page, per_page, sortable_attributes

Constructor Details

This class inherits a constructor from Common::Base

Instance Method Details

#==(other) ⇒ Object



67
68
69
# File 'app/models/evss_claim_document.rb', line 67

def ==(other)
  attributes == other.attributes
end

#descriptionObject



59
60
61
# File 'app/models/evss_claim_document.rb', line 59

def description
  DOCUMENT_TYPES[document_type]
end

#to_serializable_hashObject



71
72
73
74
# File 'app/models/evss_claim_document.rb', line 71

def to_serializable_hash
  # file_obj is not suitable for serialization
  to_hash.tap { |h| h.delete :file_obj }
end

#tracked_item_id=(num) ⇒ Object

The front-end URLencodes a nil tracked_item_id as the string ‘null’



77
78
79
80
# File 'app/models/evss_claim_document.rb', line 77

def tracked_item_id=(num)
  num = nil if num == 'null'
  super num
end

#uploader_idsObject



63
64
65
# File 'app/models/evss_claim_document.rb', line 63

def uploader_ids
  [tracked_item_id, uuid]
end