source: FOIAVistA/trunk/r/DIETETICS-FH/FHASM6.m@ 1328

Last change on this file since 1328 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 4.8 KB
Line 
1FHASM6 ; HISC/REL - Protein/Fluid Requirements ;10/30/90 13:42
2 ;;5.5;DIETETICS;**8**;Jan 28, 2005;Build 28
3H2O W !!,"Calculate Fluid Requirements By:"
4 W !!?5,"1) Adult (35 ml/kg/day)",!?9,"Elderly Calculation (30 ml/kg/day)",!?9,"Adolescent (40-60 ml/kg/day)",!?9,"Children (70-110 ml/kg/day)",!?9,"Infant (100-150 ml/kg/day)"
5 W !?5,"2) 100 ml/kg first 10 kg +",!?9,"50 ml/kg second 10 kg +",!?9,"25 ml/kg remaining kg"
6 W !?5,"3) 1 ml/Kcal",!?5,"4) 0.5 ml/Kcal (Fluid Overload)"
7 W !?5,"5) 1500 ml/sq meter"
8 W !?5,"6) Set Your Own Fluid Level",!?5,"7) Omit Calculation"
9H0 W !!,"Choose: " W:CFRB CFRB_"// " R H2O:DTIME S:H2O=U FHQUIT=1 G:'$T!(H2O["^") KIL^FHASM1
10 I H2O="",CFRB S H2O=CFRB
11 I "1234567"'[H2O!(H2O'?1N) W !,"Choose 1 - 7 Only" G H0
12 S CFRB=H2O
13 I "125"[H2O S CB="Fluid" D GETW^FHASM5 G:CB=0 KIL^FHASM1
14 G H1:H2O=1,H2:H2O=2,H3:H2O=3,H4:H2O=4,H5:H2O=5,H6:H2O=6 S:'$D(FLD) FLD="" G PRO
15H1 ;add elderly calculation here
16 I AGE>64 S FLD=30 G H12
17 I AGE>17 S FLD=35 G H12
18 I AGE>10 S A1=40,A2=60 G H11
19 I AGE'<1 S A1=70,A2=110 G H11
20 S A1=100,A2=150
21H11 W !!,"Select Level Between ",A1," and ",A2," ml/kg/day: " W:FLD'="" FLD_"// "
22 R FLD:DTIME S:FLD=U FHQUIT=1 G:'$T!(FLD["^") KIL^FHASM1
23 I FLD<A1!(FLD>A2) W *7,!,"Fluid Level is not within range." G H11
24H12 S FLD=W2*FLD G H7
25H2 S W1=W2,FLD=$S(W1<10:W1*100,W1<20:W1-10*50+1000,1:W1-20*25+1500) G H7
26H3 S FLD=KCAL G H7
27H4 S FLD=.5*KCAL G H7
28H5 S X=W2,X1=.425 D PWR S FLD=Y,X=HGT*2.54,X1=.725 D PWR S FLD=FLD*Y*.007184*1500 G H7
29H6 W !!,"Enter Fluid Requirements (ml/day): ",FLD,"// " R FLD:DTIME S:FLD=U FHQUIT=1 G:'$T!(FLD["^") KIL^FHASM1
30 I FLD'?1N.N!(FLD<0)!(FLD>10000) W *7,!,"Level must be between 0-10000 ml/day" G H6
31 S FLD=+$J(FLD,0,0) G PRO
32H7 S FLD=+$J(FLD,0,0)
33H8 W !!,"Select Fluid Requirements (ml/day): ",FLD,"// " R X:DTIME I '$T!(X["^") G KIL^FHASM1
34 I X'="",X'?1N.N!(X<0)!(X>10000) W *7,!,"Level must be between 0-10000 ml/day" G H8
35 I X'="",X'=FLD S FLD=+$J(X,0,0),H2O=6
36PRO ;protein calculation. Before setting protein, set the formula used in Fluid calculation.
37 S (FHH2O,FHH2O)=""
38 I H2O=1 D
39 .I AGE>64 S FHH2O="Elderly Calculation (30 ml/kg/day)" Q
40 .I AGE>17 S FHH2O="Adult (35 ml/kg/day)" Q
41 .I AGE>10 S FHH2O="Adolescent (40-60 ml/kg/day)" Q
42 .I AGE'<1 S FHH2O="Children (70-110 ml/kg/day)" Q
43 .S FHH2O="Infant (100-150 ml/kg/day)" Q
44 I H2O=2 D
45 .I W1<10 S FHH2O="100 ml/kg first 10 kg" Q
46 .I W1<20 S FHH2O="50N ml/kg 10 kg" Q
47 .S FHH2O="25 ml/kg remaining kg"
48 S:H2O=3 FHH2O="1 ml/kcal"
49 S:H2O=4 FHH2O="0.5 ml/kcal (Fluid Overload"
50 S:H2O=5 FHH2O="1500 ml/sq meter"
51 S:H2O=6 FHH2O="Set Your Own Fluid Level"
52 S:H2O=7 FHH2O="Omit Calculation"
53 S FHFFC=FHH2O_" and "_FHCFRBO
54 S CB="Protein" D GETW^FHASM5 G:CB=0 KIL^FHASM1 W !!?11,"Protein Requirements (g/kg)",!?16,"(Examples)"
55 W !,"Acute Burn, Injury, Trauma",?48,"2-4"
56 W !,"Acute Encephalopathy",?48,"0.6-0.8"
57 W !,"Acute Hepatitis",?48,"1.2-1.5"
58 W !,"Anabolism",?48,"1.2-1.5"
59 W !,"Burn",?48,"1.4"
60 W !,"Chronic Encephalopathy",?48,"1.2"
61 W !,"Chronic Hepatitis (no cirrhosis)",?48,"1.2-1.5"
62 W !,"Chronic Liver Disease",?48,"1-1.5"
63 W !,"Chronic Renal Failure",?48,"0.6"
64 W !,"Conservative Mgt Pre-Dialysis",?48,"0.6-0.75"
65 W !,"Convalescent Burn, Injury Trauma",?48,"2"
66 W !,"ESRD Hemodialysis",?48,"1.2-1.3"
67 W !,"ESRD Peritoneal Dialysis",?48,"1.2-1.3"
68 W !,"Ileocolostomy",?48,"1-1.4"
69 W !,"Liver transplant (pre-transplant/stable)",?48,"1.2-1.5"
70 W !,"Malabsorption Syndrome",?48,"1"
71 W !,"Nephrotic Syndrome",?48,"1-1.4"
72 W !,"Post-liver transplant - short term(1-2 months)",?48,"1.2-2"
73 W !," long term",?48,"0.8-1.0"
74 W !,"Pressure Ulcers",?48,"1.2-1.5"
75 W !,"Protein-Sparing",?48,"1.5"
76 W !,"Ulcerative Colitis",?48,"1-1.4"
77 S P1=$S(AGE>18:0.8,AGE>14:0.84,AGE>10:1,AGE>6:1.2,AGE>3:1.5,AGE>1:1.8,AGE>.5:2,1:2.2)
78P6 S FHPLX=$S($G(FHPL):FHPL,1:P1) I FHPLX<1,$E(FHPLX,1)'="0" S FHPLX="0"_FHPLX
79 S X="" W !!,"Enter Protein Level (g/kg) ",FHPLX," // " R X:DTIME S:X="^" FHQUIT=1 I '$T!(X["^")!FHQUIT G KIL^FHASM1
80 I FHPLX,X="" S X=FHPLX
81 I X'?.1N.1".".2N!(X<.4)!(X>4) W *7," Level must be 0.4 to 4.0" G P6
82 I X<1,$E(X,1)'="0" S X="0"_X
83 S (PRO,FHPL)=X
84 S PRO=+$J(PRO*W2,0,0)
85 S FHFPC=FHCFRBO_" and protein level of "_X
86P7 W !!,"Enter Protein Requirements (gm/day): ",PRO,"// " R X:DTIME I '$T!(X["^") G KIL^FHASM1
87 I X'="",X'>0!(X>400) W *7," Enter a value greater than 0 but not more than 400." G P7
88 I X'="",X'=PRO S PRO=+$J(X,0,0),FHFPC="User sets the Protein Level"
89 I KCAL W " ",$J(PRO*400/KCAL,0,0)," % of KCAL"
90 ;
91NEXT G ^FHASM7
92 ;
93PWR ; Raise X to X1 power - Output in Y
94 I X'>0 S Y=0 Q
95 S X2=1 I X>0 F X3=0:1 Q:(X/X2)<10 S X2=X2*10
96 I X<1 F X3=0:-1 Q:(X/X2)>.1 S X2=X2*.1
97 S X=X/X2
98 S X=(X-1)/(X+1),(Y,X5)=X F X4=3:2 S X5=X5*X*X,X2=X5/X4,Y=X2+Y S:X2<0 X2=-X2 Q:X2<.000001
99 S Y=Y*2+(X3*2.302585),X=Y*X1
100 S (Y,X5)=X,Y=Y+1 F X4=2:1 S X5=X5*X/X4,Y=Y+X5 Q:X5<.000001
101 S Y=+$J(Y,0,5) K X2,X3,X4,X5 Q
Note: See TracBrowser for help on using the repository browser.