Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: FHNU6

FHNU6.m

Go to the documentation of this file.
  1. FHNU6 ; HISC/REL/NCA - Abbreviated Analysis Output ;8/2/94 16:09
  1. ;;5.5;DIETETICS;;Jan 28, 2005
  1. K A,B,C F K=1:1:3 S C(K)=0 F K=1:1:66 S A(K)=0,B(K)=0
  1. S NX=0
  1. D1 S NX=$O(FHM(NX)) I NX="" G D2
  1. S AMT=+FHM(NX) I TYP="C" S WT=$P(FHM(NX),",",3),AMT=AMT*WT
  1. S AMT=AMT/100,Y=$G(^FHNU(NX,1)) F K=1:1:20 S Z1=$P(Y,"^",K) I Z1'="" S A(K)=Z1*AMT+A(K),B(K)=B(K)+1
  1. S Y=$G(^FHNU(NX,2)) F K=21:1:38 S Z1=$P(Y,"^",K-20) I Z1'="" S A(K)=Z1*AMT+A(K),B(K)=B(K)+1
  1. S Y=$G(^FHNU(NX,3)) F K=39:1:56 S Z1=$P(Y,"^",K-38) I Z1'="" S A(K)=Z1*AMT+A(K),B(K)=B(K)+1
  1. S Y=$G(^FHNU(NX,4)) F K=57:1:66 S Z1=$P(Y,"^",K-56) I Z1'="" S A(K)=Z1*AMT+A(K),B(K)=B(K)+1
  1. G D1
  1. D2 S ZR=$S(RDA:^FH(112.2,RDA,1),1:""),ANS=""
  1. S Z1=4*A(1)+(9*A(2))+(4*A(3)) S:'Z1 Z1=1 F KK=1,3,2 S C(KK)=$J(A(KK)*$S(KK=2:900,1:400)/Z1,4,0)
  1. W:$E(IOST,1,2)="C-" @IOF W !?28,"--- Analysis of Menu ---",!!?(80-$L(TIT)\2),TIT,!!?34,"%",?39,"%",?76,"%",!
  1. W ?33,"DRI",?37,"Kcal",?75,"DRI",!
  1. F K=1:1:34 S Y=$T(COM+K),Z1=$P(Y,";",3) D LST
  1. D PSE I ANS="^" K A,B,C,KK,T1,Z1,Z2,ZR Q
  1. F K=35:1:70 S Y=$T(COM+K),Z1=$P(Y,";",3) D LST
  1. D PSE W ! K A,B,C,KK,T1,Z1,Z2,ZR Q
  1. LST W:K#2 ! Q:'Z1 S T1=$S(K#2:0,1:42)
  1. W ?T1,$P(Y,";",4)," (",B(Z1),")" I B(Z1) W ?(T1+21),$J(A(Z1),7,$P(Y,";",6))," ",$P(Y,";",5)
  1. S Z2=$P(Y,";",7) I Z2,ZR'="" S Z2=A(Z1)/$P(ZR,U,Z2) W ?(T1+33),$J(Z2*100,3,0)
  1. I $D(C(Z1)) W ?(T1+37),C(Z1)
  1. Q
  1. PSE I IOST?1"C-".E R !!,"Press RETURN to Continue ",X:DTIME W ! S:'$T!(X["^") ANS="^" Q:ANS="^" I "^"'[X W !,"Enter a RETURN to Continue." G PSE
  1. Q
  1. COM ;;
  1. ;;4;Calories;K;0;0
  1. ;;33;Vitamin A;RE;0;2
  1. ;;1;Protein;Gms;1;1
  1. ;;19;Ascorbic Acid;Mg;1;4
  1. ;;3;Carbohydrate;Gms;1;0
  1. ;;17;Vitamin E;Mg;1;3
  1. ;;2;Fat;Gms;1;0
  1. ;;21;Riboflavin;Mg;1;6
  1. ;;13;Sodium;Mg;1;19
  1. ;;20;Thiamin;Mg;1;5
  1. ;;12;Potassium;Mg;1;20
  1. ;;22;Niacin;Mg;1;7
  1. ;;8;Calcium;Mg;1;11
  1. ;;24;Vitamin B6;Mg;1;8
  1. ;;11;Phosphorus;Mg;1;12
  1. ;;26;Vitamin B12;Mcg;1;10
  1. ;;9;Iron;Mg;1;14
  1. ;;65;Vitamin K;Mcg;1;26
  1. ;;14;Zinc;Mg;1;15
  1. ;;25;Folate;Mcg;1;9
  1. ;;10;Magnesium;Mg;1;13
  1. ;;23;Pantothenic Ac;Mg;1;16
  1. ;;16;Manganese;Mg;1;18
  1. ;;29;Cholesterol;Mg;1;0
  1. ;;15;Copper;Mg;1;17
  1. ;;27;Linoleic Acid;Gms;1;0
  1. ;;66;Selenium;Mcg;1;22
  1. ;;28;Linolenic Acid;Gms;1;0
  1. ;;0;Crude Fiber;Gms;1;0
  1. ;;31;Monounsat. Fat;Gms;1;0
  1. ;;0;Dietary Fiber;Gms;1;0
  1. ;;32;Polyunsat. Fat;Gms;1;0
  1. ;;5;Water;Ml;1;0
  1. ;;30;Saturated Fat;Gms;1;0
  1. ;;34;Ash;Gms;1;0
  1. ;;39;Tryptophan;Gms;2;0
  1. ;;35;Alcohol;Gms;1;0
  1. ;;40;Threonine;Gms;2;0
  1. ;;36;Caffeine;Mg;1;0
  1. ;;41;Isoleucine;Gms;2;0
  1. ;;37;Total Diet Fiber;Gms;1;0
  1. ;;42;Leucine;Gms;2;0
  1. ;;38;Total Tocopherol;Mg;1;0
  1. ;;43;Lysine;Gms;2;0
  1. ;;57;Capric Acid;Gms;2;0
  1. ;;44;Methionine;Gms;2;0
  1. ;;58;Lauric Acid;Gms;2;0
  1. ;;45;Cystine;Gms;2;0
  1. ;;59;Myristic Acid;Gms;2;0
  1. ;;46;Phenylalanine;Gms;2;0
  1. ;;60;Palmitic Acid;Gms;2;0
  1. ;;47;Tyrosine;Gms;2;0
  1. ;;61;Palmitoleic Acid;Gms;2;0
  1. ;;48;Valine;Gms;2;0
  1. ;;62;Stearic Acid;Gms;2;0
  1. ;;49;Arginine;Gms;2;0
  1. ;;63;Oleic Acid;Gms;2;0
  1. ;;50;Histidine;Gms;2;0
  1. ;;64;Arachidonic Acid;Gms;2;0
  1. ;;51;Alanine;Gms;2;0
  1. ;;0
  1. ;;52;Aspartic Acid;Gms;2;0
  1. ;;0
  1. ;;53;Glutamic Acid;Gms;2;0
  1. ;;0
  1. ;;54;Glycine;Gms;2;0
  1. ;;0
  1. ;;55;Proline;Gms;2;0
  1. ;;0
  1. ;;56;Serine;Gms;2;0