Class: Formulary::QHPPlan
- Inherits:
-
Object
- Object
- Formulary::QHPPlan
- Defined in:
- lib/formulary/qhp_plan.rb
Overview
A health plan as represented by QHP data
Instance Attribute Summary collapse
-
#raw_plan ⇒ Object
readonly
Returns the value of attribute raw_plan.
Instance Method Summary collapse
- #email_contact ⇒ Object
- #formulary_url ⇒ Object
- #id ⇒ Object
- #id_type ⇒ Object
-
#initialize(raw_plan) ⇒ QHPPlan
constructor
A new instance of QHPPlan.
- #last_updated ⇒ Object
- #marketing_name ⇒ Object
- #marketing_url ⇒ Object
- #network ⇒ Object
- #summary_url ⇒ Object
- #tiers ⇒ Object
Constructor Details
#initialize(raw_plan) ⇒ QHPPlan
Returns a new instance of QHPPlan.
8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/formulary/qhp_plan.rb', line 8 def initialize(raw_plan) raw_plan[:formulary].map { |tier| if tier[:drug_tier] == "ZERO-COST-SHARE-PREVENTIVE" tier[:drug_tier] = "ZERO-COST-SHARE-PREVENTATIVE" elsif tier[:drug_tier] == "MEDICAL-BENEFIT" tier[:drug_tier] = "MEDICAL-SERVICE" elsif tier[:drug_tier] == "NON-PREFERRED-BRAND-SPECIALTY" tier[:drug_tier] = "SPECIALTY" end } @raw_plan = raw_plan.freeze end |
Instance Attribute Details
#raw_plan ⇒ Object (readonly)
Returns the value of attribute raw_plan.
6 7 8 |
# File 'lib/formulary/qhp_plan.rb', line 6 def raw_plan @raw_plan end |
Instance Method Details
#email_contact ⇒ Object
43 44 45 |
# File 'lib/formulary/qhp_plan.rb', line 43 def email_contact @email_contact ||= raw_plan[:plan_contact] end |
#formulary_url ⇒ Object
47 48 49 |
# File 'lib/formulary/qhp_plan.rb', line 47 def formulary_url @formulary_url ||= raw_plan[:formulary_url] end |
#id ⇒ Object
23 24 25 |
# File 'lib/formulary/qhp_plan.rb', line 23 def id @id ||= raw_plan[:plan_id] end |
#id_type ⇒ Object
35 36 37 |
# File 'lib/formulary/qhp_plan.rb', line 35 def id_type @id_type ||= raw_plan[:plan_id_type] end |
#last_updated ⇒ Object
31 32 33 |
# File 'lib/formulary/qhp_plan.rb', line 31 def last_updated @last_updated ||= raw_plan[:last_updated_on] end |
#marketing_name ⇒ Object
27 28 29 |
# File 'lib/formulary/qhp_plan.rb', line 27 def marketing_name @marketing_name ||= raw_plan[:marketing_name] end |
#marketing_url ⇒ Object
39 40 41 |
# File 'lib/formulary/qhp_plan.rb', line 39 def marketing_url @marketing_url ||= raw_plan[:marketing_url] end |
#network ⇒ Object
55 56 57 |
# File 'lib/formulary/qhp_plan.rb', line 55 def network @network ||= raw_plan[:network].map { |network| network[:network_tier] } end |
#summary_url ⇒ Object
51 52 53 |
# File 'lib/formulary/qhp_plan.rb', line 51 def summary_url @summary_url ||= raw_plan[:summary_url] end |
#tiers ⇒ Object
59 60 61 |
# File 'lib/formulary/qhp_plan.rb', line 59 def tiers @tiers ||= raw_plan[:formulary] end |