app/helpers/hbvs_helper.rb
#if vaccine is needed but not get it, return alert
if vaccine is needed but not get it, return alert
if vaccine is needed but not get it return alert
def determine_hbv_vaccine_alert(profile, vaccines, test_status)
    @had_hbv_vac = false
    vaccines.each do |v|
      @had_hbv_vac = true if v.targetcon == "hbv"
    end
    if !@had_hbv_vac    
      if(test_status == TETS_STATUS_SUSCEPTIBLE )  
         return "You should get HBV vaccine!"
      else
        @hbv_vac_needed = false
        @gs = get_hbv_guidelines(profile)
        if(@gs)
          @gs.each do |g|
            @hbv_vac_needed = true if g.vaccine_needed
          end
        end
        if @hbv_vac_needed   
          return "You should get HBV vaccine!"
        end
      end
    end
  end
def determine_hbv_vaccine_alert ( profile , vaccines , test_status ) @had_hbv_vac = false vaccines . each do | v | @had_hbv_vac = true if v . targetcon == "hbv" end if ! @had_hbv_vac if ( test_status == TETS_STATUS_SUSCEPTIBLE ) return "You should get HBV vaccine!" else @hbv_vac_needed = false @gs = get_hbv_guidelines ( profile ) if ( @gs ) @gs . each do | g | @hbv_vac_needed = true if g . vaccine_needed end end if @hbv_vac_needed return "You should get HBV vaccine!" end end end end
if vaccine is needed but not get it, return alert
if vaccine is needed but not get it return alert
# did not have hbv vaccine #need vaccine # need vaccine
profile
<not_specific>
vaccines
<not_specific>
test_status
<not_specific>