Skip to content

Instantly share code, notes, and snippets.

@sdglhm
Created May 20, 2017 04:53
Show Gist options
  • Save sdglhm/53e5c8b6344b8e6b6c0ad809446b7761 to your computer and use it in GitHub Desktop.
Save sdglhm/53e5c8b6344b8e6b6c0ad809446b7761 to your computer and use it in GitHub Desktop.
score = 0
gender = "MALE"
age = "ADULT"
thalassemia = "YES"
tuberculosis = "YES"
chronic_disease = "YES"
rheumatoid_arthritis = "YES"
malignant_disease = "YES"
pancreatitis = "YES"
coeliac_disease = "YES"
hydroxycarbamide = "YES"
azathioprine = "YES"
nsaids = "YES"
busulfan = "YES"
doxorubicin = "YES"
metformin = "YES"
blood_count = 11
gasterectomy = "YES"
ileal_resection = "YES"
dietary = "VEGITARIAN"
alcoholic = "YES"
income = "1"
fatigue_headache_faintness = "YES"
breathlessness = "YES"
palpitations = "YES"
angina = "YES"
intermittent = "YES"
paler_skin = "YES"
blood_faeces = "YES"
case gender
when "MALE"
score += 0.5
when "MENOPAUSAL_FEMALE"
score += 0.6
when "MENSTRUATING_FEMALE"
score += 0.9
when "PREGNANT_FEMALE"
score += 0.99
end
case age
when "INFANT"
score += 0.9
when "CHILDREN"
score += 0.6
when "ADULT"
score += 0.45
when "ELDERLY"
score += 0.85
end
#List of diseases
if thalassemia == "YES" then
score += 1
end
if tuberculosis == "YES" then
score += 1
end
if chronic_disease == "YES" then
score += 1
end
if rheumatoid_arthritis == "YES" then
score += 1
end
if malignant_disease == "YES" then
score += 1
end
if pancreatitis == "YES" then
score += 1
end
if coeliac_disease == "YES" then
score += 1
end
#End list of diseases
#List of drugs
if hydroxycarbamide == "YES" then
score += 1
end
if azathioprine == "YES" then
score += 1
end
if nsaids == "YES" then
score += 1
end
if busulfan == "YES" then
score += 1
end
if doxorubicin == "YES" then
score += 1
end
if metformin == "YES" then
score += 1
end
#End list of drugs
if age == "INFANT" && blood_count < 11 then
score += 10;
elsif age == "CHILDREN" && blood_count < 12 then
score += 10;
elsif gender == "MALE" && blood_count < 13 then
score += 10;
elsif gender == "PREGNANT_FEMALE" || gender == "MENOPAUSAL_FEMALE" || gender == "MENSTRUATING_FEMALE" && blood_count < 12 then
score +=10;
else
#do nothing
end
#END blood count
#Operations
if gasterectomy == "YES" then
score += 1
end
if ileal_resection == "YES" then
score += 1
end
#end Operations
#diestry habits
case dietary
when "VEGAN"
score +=0.85
when "VEGITARIAN"
score += 0.65
when "NON"
score += 0.3
end
if alcoholic == "YES" then
score += 1
end
case income
when "1"
score += 0.9
when "2"
score += 0.35
when "3"
score += 0.30
end
#observe
if fatigue_headache_faintness == "YES" then
score += 1
end
if breathlessness == "YES" then
score += 1
end
if palpitations == "YES" then
score += 1
end
if angina == "YES" then
score += 1
end
if intermittent == "YES" then
score += 1
end
if paler_skin == "YES" then
score += 1
end
if blood_faeces == "YES" then
score += 1
end
score_out = score/37*100
puts "score "
puts score
puts "per"
puts score_out
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment