source: WorldVistAEHR/trunk/r/DIETETICS-FH/FHPRI2.m@ 1234

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

initial load of WorldVistAEHR

File size: 3.3 KB
RevLine 
[613]1FHPRI2 ; HISC/REL/NCA - Ingredient Lists ;3/6/95 16:04
2 ;;5.5;DIETETICS;;Jan 28, 2005
3LIS1 ; List Ingredients - Recipe data
4 S FHX1=1 G L0
5LIS2 ; List Ingredients - Purchasing data
6 S FHX1=2 G L0
7LIS3 ; List Ingredients - Nutrient data
8 S FHX1=3 G L0
9L0 R !!,"Sort: (A=Alphabetically F=Food Group V=Vendor) F// ",FHX2:DTIME G:'$T!(FHX2="^") KIL S:FHX2="" FHX2="F" I "afv"[FHX2 S X=FHX2 D TR^FH S FHX2=X
10 I FHX2'?1U!("AFV"'[FHX2) W *7," Enter A, F or V" G L0
11L1 W !!,"The list requires a 132 column printer.",!
12 W ! K IOP,%ZIS S %ZIS("A")="Select LIST Printer: ",%ZIS="MQ" D ^%ZIS K %ZIS,IOP G:POP KIL
13 I $D(IO("Q")) S FHPGM="Q1^FHPRI2",FHLST="FHX1^FHX2" D EN2^FH G KIL
14 U IO D Q1 D ^%ZISC K %ZIS,IOP G KIL
15Q1 ; List Ingredients
16 D NOW^%DTC S DTP=% D DTP^FH I FHX2'="A" G Q2
17 S PG=0 D HDR
18 S NX="" F K=0:0 S NX=$O(^FHING("B",NX)) Q:NX="" F D0=0:0 S D0=$O(^FHING("B",NX,D0)) Q:D0<1 D P0
19 W ! Q
20Q2 S PG=0,OLD="" K ^TMP($J)
21 F K=0:0 S K=$O(^FHING(K)) Q:K<1 S X=^(K,0) D Q3
22 S GRP="" F K=0:0 S GRP=$O(^TMP($J,GRP)) Q:GRP="" S NAM="" F NX=0:0 S NAM=$O(^TMP($J,GRP,NAM)) Q:NAM="" F D0=0:0 S D0=$O(^TMP($J,GRP,NAM,D0)) Q:D0<1 D:GRP'=OLD H0 D P0
23 W ! Q
24Q3 S NAM=$P(X,"^",1) I FHX2="F" S GRP=$P(X,"^",13) S:GRP<1 GRP=9
25 E S GRP=$P(X,"^",4) S:GRP GRP=$P($G(^FH(113.2,GRP,0)),"^",1) S:GRP="" GRP="~~~"
26 S ^TMP($J,GRP,$E(NAM,1,30),K)="" Q
27P0 D:$Y>(IOSL-8) HDR S X=$G(^FHING(D0,0))
28 G P1:FHX1=1,P2:FHX1=2,P3:FHX1=3 Q
29P1 W !,$P(X,"^",1) S Y=$P(X,"^",3),Y=$E(Y,$L(Y)-3,16) W:Y'="" ?53,Y
30 S Y=$P(X,"^",12),Y=$S(Y="":Y,$D(^FH(113.1,Y,0))#2:$P(^(0),"^",2),1:Y) W:Y'="" ?61,Y
31 W ?70,$P(X,"^",20),?75,$P(X,"^",5) S Y=$P(X,"^",8) W:Y'="" ?81,$J(+Y,10)
32 S Y=$P(X,"^",6) S Y=$S(Y="":Y,$D(^FH(119.1,Y,0))#2:$P(^(0),"^",1),1:Y) W:Y'="" ?94,$E(Y,1,15)
33 S Y=$P(X,"^",17) W:Y'="" ?113,$J(+Y,10)
34 S Y=$P(X,"^",16) W:Y'="" ?126,Y Q
35P2 W !,$E($P(X,"^",1),1,49),?50,$P(X,"^",2),?73,$P(X,"^",3),?92,$P(X,"^",13)
36 S Y=$P(X,"^",4) S Y=$S(Y="":Y,$D(^FH(113.2,Y,0))#2:$P(^(0),"^",1),1:Y) W:Y'="" ?95,$E(Y,1,17)
37 W ?114,$P(X,"^",5)
38 S Y=$P(X,"^",7) W:Y'="" ?117,$J(Y,6,0)
39 S Y=$P(X,"^",9) W:Y'="" ?123,$J(Y,8,3) Q
40P3 W !,$E($P(X,"^",1),1,50) S Y=$P(X,"^",21),Y=$S(Y="":Y,$D(^FHNU(Y,0))#2:$E($P(^(0),"^",1),1,40),1:Y) W:Y'="" ?53,Y
41 S Y=$P(X,"^",16) W:Y'="" ?110,Y
42 S Y=$P(X,"^",22) W:Y'="" ?120,$J(Y,7,3) Q
43H0 S OLD=GRP
44HDR W:'($E(IOST,1,2)'="C-"&'PG) @IOF S PG=PG+1 G H1:FHX1=1,H2:FHX1=2,H3:FHX1=3 Q
45H1 W !,DTP,?44,"I N G R E D I E N T R E C I P E D A T A",?124,"Page ",PG
46 D:FHX2'="A" H5
47 W !!,"NAME",?53,"STOCK",?60,"LOC'N",?68,"THAW",?75,"U/P",?85,"ISS/UP",?94,"ISSUE",?116,"REC/ISS",?126,"REC" G H4
48H2 W !,DTP,?40,"I N G R E D I E N T P U R C H A S I N G D A T A",?124,"Page ",PG
49 D:FHX2'="A" H5
50 W !!,"NAME",?50,"SUPPLY DESCRIPTION",?73,"STOCK NUMBER",?91,"GRP VENDOR",?114,"U/P",?119,"MULT",?126,"PRICE" G H4
51H3 W !,DTP,?42,"I N G R E D I E N T N U T R I E N T D A T A",?124,"Page ",PG
52 D:FHX2'="A" H5
53 W !!,"NAME",?53,"NUTRIENT DATA REFERENCE",?108,"REC UNIT",?119,"WT IN LBS."
54H4 W !,"-----------------------------------------------------------------------------------------------------------------------------------",! Q
55H5 I FHX2="F" S Y="Food Group: "_$P("MEAT PRODUCTS^MILK PRODUCTS^FRUITS & VEGETABLES^BREADS^COMMERCIAL NUTRITION SUPPLEMENTS^MISCELLANEOUS^^^UNCLASSIFIED","^",GRP)
56 E S Y="Vendor: "_$S(GRP'="~~~":GRP,1:"Unknown")
57 W !!?(131-$L(Y)\2),Y Q
58KIL K ^TMP($J) G KILL^XUSCLEAN
Note: See TracBrowser for help on using the repository browser.