app/helpers/hcvs_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_hcv_risk(profile)
    gns = []
    if profile.hiv_positive
      gns.push(6)
    end
    if profile.injection_drug_user
      gns.push(1)
    end
    if profile.clot_factor_1987
      gns.push(2)
    end
    if profile.blood_organ_1992
      gns.push(3)
    end
    if profile.hemodialysis
      gns.push(4)
    end
    if profile.exposed_infected_blood_organ
      gns.push(5)
    end
    if profile.mother_hcv
      gns.push(7)
    end
    if profile.elevated_liver_enzymes
      gns.push(8)
    end
    if profile.med_donor
      gns.push(9)
    end
    profile.update_attributes(:hcv_risk_gns => gns)
  end
def check_hcv_risk ( profile ) gns = [ ] if profile . hiv_positive gns . push ( 6 ) end if profile . injection_drug_user gns . push ( 1 ) end if profile . clot_factor_1987 gns . push ( 2 ) end if profile . blood_organ_1992 gns . push ( 3 ) end if profile . hemodialysis gns . push ( 4 ) end if profile . exposed_infected_blood_organ gns . push ( 5 ) end if profile . mother_hcv gns . push ( 7 ) end if profile . elevated_liver_enzymes gns . push ( 8 ) end if profile . med_donor gns . push ( 9 ) end profile . update_attributes ( :hcv_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>