app/helpers/hbvs_helper.rb
#check patient profile for risk factors
#set array of guideline numbers to profile
check patient profile for risk factors
set array of guideline numbers to profile
check patient profile for risk factors set array of guideline numbers to profile
def check_hbv_risk(profile)
    gns = []
    if profile.hiv_positive
      gns.push(13)
    end
    if profile.injection_drug_user
      gns.push(3)
    end
    if profile.gay_man
      gns.push(4)
    end
    if profile.close_contacts_hbv
      gns.push(11)
    end
    if profile.hemodialysis
      gns.push(8)
    end
    if profile.immunosuppressive
      gns.push(5)
    end
    if profile.pregnant
      gns.push(9)
    end
    if profile.mother_hbv
      gns.push(10)
    end
    if HBV_PREVALENCE2[profile.country_born]
      gns.push(1)
    end
    if HBV_PREVALENCE8[profile.mother_country_born] || HBV_PREVALENCE8[profile.father_country_born]
      gns.push(2)
    end
    if profile.exposed_infected_blood_organ
      gns.push(12)
    end
    if profile.elevated_liver_enzymes
      gns.push(6)
    end
    if profile.med_donor
      gns.push(7)
    end
    profile.update_attributes(:hbv_risk_gns => gns)
  end
def check_hbv_risk ( profile ) gns = [ ] if profile . hiv_positive gns . push ( 13 ) end if profile . injection_drug_user gns . push ( 3 ) end if profile . gay_man gns . push ( 4 ) end if profile . close_contacts_hbv gns . push ( 11 ) end if profile . hemodialysis gns . push ( 8 ) end if profile . immunosuppressive gns . push ( 5 ) end if profile . pregnant gns . push ( 9 ) end if profile . mother_hbv gns . push ( 10 ) end if HBV_PREVALENCE2 [ profile . country_born ] gns . push ( 1 ) end if HBV_PREVALENCE8 [ profile . mother_country_born ] || HBV_PREVALENCE8 [ profile . father_country_born ] gns . push ( 2 ) end if profile . exposed_infected_blood_organ gns . push ( 12 ) end if profile . elevated_liver_enzymes gns . push ( 6 ) end if profile . med_donor gns . push ( 7 ) end profile . update_attributes ( :hbv_risk_gns => gns ) end
check patient profile for risk factors
set array of guideline numbers to profile
check patient profile for risk factors set array of guideline numbers to profile
#order important, highest risk (requiring treatment) should go first
profile
<not_specific>