def CKD2009_EPI(race, age, gender, sCr):
# 2009年CKD-EPI scr公式,公式以不同性别肌酐设置节点,以截点、性别、种族采用不同斜率
if race in ['black', '黑种人']:
if gender in ['male', '男']:
if sCr <= 79.56:
# 文献报道公式中肌酐为0.9mg/dl,本程序按照1mg/dl=88.4umol/L,将0.9mg/dl换算为79.56umol/L。
return {'value_a': 163.419, 'value_b': 0.9, 'value_c': -0.411}
else:
return {'value_a': 163.419, 'value_b': 0.9, 'value_c': -1.209}
else:
if sCr <= 61.88:
# 文献报道公式中肌酐为0.7mg/dl,本程序按照1mg/dl=88.4umol/L,将0.7mg/dl换算为61.88umol/L
return {'value_a': 166.36, 'value_b': 0.7, 'value_c': -0.329}
else:
return {'value_a': 166.36, 'value_b': 0.7, 'value_c': -1.209}
else:
if gender in ['male', '男']:
if sCr <= 79.56:
return {'value_a': 141, 'value_b': 0.9, 'value_c': -0.411}
else:
return {'value_a': 141, 'value_b': 0.9, 'value_c': -1.209}
else:
if sCr <= 61.88:
return {'value_a': 143.538, 'value_b': 0.7, 'value_c': -0.329}
else:
return {'value_a': 143.538, 'value_b': 0.7, 'value_c': -1.209}
def main():
race=input("输入人种(提示如为黑种人,输入'黑种人'):")
gender=input("输入性别(male或男,female或女):")
sCr=float(input('输入sCr值:'))
age=int(input('输入年龄:'))
result=CKD2009_EPI(race,gender,sCr,age)
print(result)
main()
这段代码,如果人种输入 黄种人,male,年龄35岁,sCr 为630,最后打印出来的是{'value_a': 143.538, 'value_b': 0.7, 'value_c': -0.329},与实际想得到的{'value_a': 141, 'value_b': 0.9, 'value_c': -1.209}不同,不知道是什么原因