source: WorldVistAEHR/trunk/r/DSS_EXTRACTS-ECX/ECXNUTPP.m@ 691

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

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1ECXNUTPP ;ALB/JRC - Nut Production Worksheet Print ; 11/2/06 8:41am
2 ;;3.0;DSS EXTRACTS;**92**;Dec 22, 1997;Build 30
3 ;
4EN ;entry point from option
5 ;Queue Report
6 N ZTDESC,ZTIO,ZTSAVE
7 S ZTIO=""
8 S ZTDESC="Nutrition Division Worksheet for DSS"
9 D EN^XUTMDEVQ("EN1^ECXNUTPP",ZTDESC,.ZTSAVE)
10 Q
11EN1 ;Tasked entry point
12 ;Declare variables
13 N STOP,PAGE,TDIET,TTDIET,LTYPE,LN
14 S (STOP,PAGE,LTYPE)=0,(TDIET)=""
15 K ^TMP($J)
16 F S TDIET=$O(^ECX(728.45,"B",TDIET)) Q:TDIET=""!STOP D
17 .S IEN=0,IEN=$O(^ECX(728.45,"B",TDIET,IEN))
18 .S TTDIET=$$GET1^DIQ(728.45,IEN,.01)
19 .D HEADER I STOP D EXIT Q
20 .D GETDATA I STOP D EXIT Q
21 .I '$O(^TMP($J,"ECX",0)) D Q
22 ..W !
23 ..W !,"***********************************************************"
24 ..W !,"* NOTHING TO REPORT FOR "_TTDIET_" CATEGORY",?58,"*"
25 ..W !,"***********************************************************"
26 ..D WAIT
27 .D DETAIL I STOP D EXIT Q
28 .D FOOTER I STOP D EXIT Q
29 .D WAIT I STOP D EXIT Q
30 .K ^TMP($J,"ECX")
31EXIT K ^TMP($J,"ECX")
32 Q
33GETDATA ;Get data
34 ;Init variables
35 N IEN,DIET,EDIET,DIEN,IENS,PRODUCT
36 S (IEN,DIET,EDIET,DIEN,IENS,PRODUCT)=""
37 F S IEN=$O(^ECX(728.45,"B",TDIET,IEN)) Q:'IEN F S DIET=$O(^ECX(728.45,IEN,1,"B",DIET)) Q:DIET="" F S DIEN=$O(^ECX(728.45,IEN,1,"B",DIET,DIEN)) Q:'DIEN D
38 .S IENS=""_DIEN_","_IEN_","_""
39 .S PRODUCT=$$GET1^DIQ(728.451,IENS,1,"E")
40 .S EDIET=$$GET1^DIQ(728.451,IENS,.01,"E")
41 .S ^TMP($J,"ECX",IEN)=""
42 .S ^TMP($J,"ECX",IEN,DIEN)=EDIET_U_PRODUCT
43 Q
44HEADER ;print header
45 S PAGE=$G(PAGE)+1
46 S $P(LN,"=",15)=""
47 W @IOF
48 W ?1,"RUN DATE: ",$$FMTE^XLFDT(DT,"5H"),?70,"PAGE ",PAGE
49 W !,?23,"NUTRITION PRODUCT WORKSHEET"
50 W !!,?27,TTDIET
51 W !!,?1,$P(TTDIET," ",1),?36,"ASSIGNED"
52 W !,?1,$P(TTDIET," ",2),?36,"PRODUCT"
53 W !,?1,LN,?36,LN
54 Q
55 ;
56DETAIL ;Print detailed line
57 ;Input : ^TMP("ECXDSS",$J) full global reference
58 ; DIET - File 116.2, 118, 118.2, 118.3, NAME
59 ; PRODUCT - Assigned DSS product
60 ;Output : None
61 ;
62 N NUMBER,RECORD,NODE
63 S (NUMBER,RECORD)=0,NODE=""
64 F S NUMBER=$O(^TMP($J,"ECX",NUMBER)) Q:'NUMBER!STOP D
65 .F S RECORD=$O(^TMP($J,"ECX",NUMBER,RECORD)) Q:'RECORD!STOP D
66 ..S NODE=$G(^TMP($J,"ECX",NUMBER,RECORD))
67 ..W !,?1,$P(NODE,U),?36,$P(NODE,U,2)
68 ..I $Y>(IOSL-5) D WAIT Q:STOP D HEADER
69 .Q
70 Q
71 ;
72WAIT ;End of page logic
73 ;Input ; None
74 ;Output ; STOP - Flag indicating if printing should continue
75 ; 1 = Stop 0 = Continue
76 ;
77 S STOP=0
78 ;CRT - Prompt for continue
79 I $E(IOST,1,2)="C-"&(IOSL'>24) D Q
80 .F Q:$Y>(IOSL-3) W !
81 .N DIR,X,Y,DTOUT,DUOUT,DIRUT,DIROUT
82 .S DIR(0)="E"
83 .D ^DIR
84 .S STOP=$S(Y'=1:1,1:0)
85 ;Background task - check taskman
86 S STOP=$$S^%ZTLOAD()
87 I STOP D
88 .W !,"*********************************************"
89 .W !,"* PRINTING OF REPORT STOPPED AS REQUESTED *"
90 .W !,"*********************************************"
91 Q
92 ;
93FOOTER ;Print footer
94 N SCREEN
95 S SCREEN=$E($P(TTDIET," ",1),1,1)_$E($P(TTDIET," ",2),1,1)
96 D FHEADER
97 D DSSPRO
98 Q
99 ;
100FHEADER ;Footer header
101 W !!!,?1,"DSS PRODUCTS",!,?1,LN
102 Q
103 ;
104DSSPRO ;DSS standardized products
105 N OFF,TEXT,DSSCAT,DSSPRO
106 F OFF=1:1 S TEXT=$P($T(PRODUCTS+OFF),";;",2) Q:TEXT="END"!STOP D
107 .S DSSCAT=$P(TEXT,U),DSSPRO=$P(TEXT,U,2)
108 .Q:DSSCAT'=SCREEN
109 .W !,?1,DSSPRO
110 .I $Y>(IOSL-5) D WAIT Q:STOP D HEADER,FHEADER
111 Q
112 ;
113PRODUCTS ;Standardized assigned products for nutrition diets
114 ;;PD^REGULAR
115 ;;PD^FULL LIQS
116 ;;PD^CLEAR LIQS
117 ;;PD^PUREE DYSPH
118 ;;SF^SUPP FEED
119 ;;SF^SUPP FEED NC
120 ;;TF^TF LESS 1
121 ;;TF^TF MORE 1
122 ;;TF^TF MIX LESS 1
123 ;;TF^TF MIX MORE 1
124 ;;SO^ST ORDER
125 ;;SO^ST ORDER NC
126 ;;END
Note: See TracBrowser for help on using the repository browser.