Class: Formulary::QHPPlanDrug
- Inherits:
- 
      Object
      
        - Object
- Formulary::QHPPlanDrug
 
- Defined in:
- lib/formulary/qhp_plan_drug.rb
Overview
A drug with plan-specific details (tier, prior auth, limits)
Instance Attribute Summary collapse
- 
  
    
      #drug  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute drug. 
- 
  
    
      #plan  ⇒ Object 
    
    
  
  
  
  
    
      readonly
    
    
  
  
  
  
  
  
    Returns the value of attribute plan. 
Instance Method Summary collapse
- #drug_plan_info ⇒ Object private
- 
  
    
      #initialize(drug, plan)  ⇒ QHPPlanDrug 
    
    
  
  
  
    constructor
  
  
  
  
  
  
  
    A new instance of QHPPlanDrug. 
- #name ⇒ Object
- #plan_id ⇒ Object
- #prior_auth? ⇒ Boolean
- #quantity_limit? ⇒ Boolean
- #rxnorm_code ⇒ Object
- #step_therapy_limit? ⇒ Boolean
- #tier ⇒ Object
Constructor Details
#initialize(drug, plan) ⇒ QHPPlanDrug
Returns a new instance of QHPPlanDrug.
| 8 9 10 11 | # File 'lib/formulary/qhp_plan_drug.rb', line 8 def initialize(drug, plan) @drug = drug @plan = plan end | 
Instance Attribute Details
#drug ⇒ Object (readonly)
Returns the value of attribute drug.
| 6 7 8 | # File 'lib/formulary/qhp_plan_drug.rb', line 6 def drug @drug end | 
#plan ⇒ Object (readonly)
Returns the value of attribute plan.
| 6 7 8 | # File 'lib/formulary/qhp_plan_drug.rb', line 6 def plan @plan end | 
Instance Method Details
#drug_plan_info ⇒ Object (private)
| 53 54 55 | # File 'lib/formulary/qhp_plan_drug.rb', line 53 def drug_plan_info @drug_plan_info ||= drug.plans.find { |drug_plan| drug_plan[:plan_id] == plan.id } end | 
#name ⇒ Object
| 17 18 19 | # File 'lib/formulary/qhp_plan_drug.rb', line 17 def name drug.name end | 
#plan_id ⇒ Object
| 47 48 49 | # File 'lib/formulary/qhp_plan_drug.rb', line 47 def plan_id plan.id end | 
#prior_auth? ⇒ Boolean
| 35 36 37 | # File 'lib/formulary/qhp_plan_drug.rb', line 35 def prior_auth? drug_plan_info[:prior_authorization] end | 
#quantity_limit? ⇒ Boolean
| 43 44 45 | # File 'lib/formulary/qhp_plan_drug.rb', line 43 def quantity_limit? drug_plan_info[:quantity_limit] end | 
#rxnorm_code ⇒ Object
| 13 14 15 | # File 'lib/formulary/qhp_plan_drug.rb', line 13 def rxnorm_code drug.rxnorm_code end | 
#step_therapy_limit? ⇒ Boolean
| 39 40 41 | # File 'lib/formulary/qhp_plan_drug.rb', line 39 def step_therapy_limit? drug_plan_info[:step_therapy] end | 
#tier ⇒ Object
| 21 22 23 24 25 26 27 28 29 30 31 32 33 | # File 'lib/formulary/qhp_plan_drug.rb', line 21 def tier if drug_plan_info[:drug_tier] == "ZERO-COST-SHARE-PREVENTIVE" drug_plan_info[:drug_tier] = "ZERO-COST-SHARE-PREVENTATIVE" elsif drug_plan_info[:drug_tier] == "MEDICAL-BENEFIT" drug_plan_info[:drug_tier] = "MEDICAL-SERVICE" elsif drug_plan_info[:drug_tier] == "NON-PREFERRED-BRAND-SPECIALTY" drug_plan_info[:drug_tier] = "SPECIALTY" end drug_plan_info[:drug_tier].downcase end |