Class: ClaimFastTracking::Constants
- Inherits:
-
Object
- Object
- ClaimFastTracking::Constants
- Defined in:
- app/services/claim_fast_tracking/constants.rb
Constant Summary collapse
- DISABILITIES =
{ hypertension: { code: 7101, label: 'hypertension' }, asthma: { code: 6602, label: 'asthma' } }.freeze
- DISABILITIES_BY_CODE =
DISABILITIES.to_h { |k, v| [v[:code], k] }
Class Method Summary collapse
-
.extract_disability_symbol_list(form526_submission) ⇒ Array
Mapping submitted disabilities to symbols used as keys for DISABILITIES; an element is nil when the disability is not supported by RRD.
-
.first_disability(form526_submission) ⇒ Hash
For the first RRD-supported disability in the form526_submission.
Class Method Details
.extract_disability_symbol_list(form526_submission) ⇒ Array
Returns mapping submitted disabilities to symbols used as keys for DISABILITIES; an element is nil when the disability is not supported by RRD.
20 21 22 23 |
# File 'app/services/claim_fast_tracking/constants.rb', line 20 def self.extract_disability_symbol_list(form526_submission) form_disabilities = form526_submission.form.dig('form526', 'form526', 'disabilities') form_disabilities.map { |form_disability| DISABILITIES_BY_CODE[form_disability['diagnosticCode']] } end |
.first_disability(form526_submission) ⇒ Hash
Returns for the first RRD-supported disability in the form526_submission.
26 27 28 29 30 31 32 |
# File 'app/services/claim_fast_tracking/constants.rb', line 26 def self.first_disability(form526_submission) extracted_disability_symbols = extract_disability_symbol_list(form526_submission) return if extracted_disability_symbols.empty? disability_symbol = extracted_disability_symbols.first DISABILITIES[disability_symbol] end |