source: FOIAVistA/tag/r/DIETETICS-FH/FHOMRMD.m@ 1670

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

initial load of FOIAVistA 6/30/08 version

File size: 5.4 KB
Line 
1FHOMRMD ;Hines OIFO/RTK/FAI RECURRING MEALS REVIEW/DISPLAY ;10/20/04 13:22
2 ;;5.5;DIETETICS;**1,5**;Jan 28, 2005;Build 53
3 ;patch #5 - added outpatient SOs & SFs.
4 ;
5DISP ;
6 S X1=STDT,X2=-1 D C^%DTC S STDT=X
7 I '$O(^FHPT(FHDFN,"OP","B",STDT)) W !!,"No Recurring Meals to Display" Q
8 K FHLIST S EX="",NUM=0 D HDR I $G(ENDT)="" S ENDT=9999999.99
9 F FHRMDT=STDT:0 S FHRMDT=$O(^FHPT(FHDFN,"OP","B",FHRMDT)) Q:FHRMDT'>0!(FHRMDT>ENDT)!(EX=U) F FHRNUM=0:0 S FHRNUM=$O(^FHPT(FHDFN,"OP","B",FHRMDT,FHRNUM)) Q:FHRNUM'>0!(EX=U) D
10 .S FHNODE=$G(^FHPT(FHDFN,"OP",FHRNUM,0))
11 .S FHRM=$P(FHNODE,U,1)
12 .S NUM=NUM+1,PAD=$S($L(NUM)<3:3-$L(NUM),1:1) W !?PAD,NUM
13 .S FHLIST(NUM)=FHRNUM_"^"_FHRM
14 .S FHDOW=$$DOW^XLFDT(FHRM),FHDOW=$E(FHDOW,1,3)
15 .S FHDTP=$$FMTE^XLFDT(FHRM,"P") W ?6,FHDOW," - ",$E(FHDTP,1,12)
16 .S FHLPT=$P(FHNODE,U,3),FHLOCZN=$G(^FH(119.6,FHLPT,0)) D
17 ..S FHLOC=$E($P(FHLOCZN,U,1),1,10),FHSERV=$P(FHLOCZN,U,10)
18 ..S FHSRV=$S(FHSERV["T":$P(FHLOCZN,U,5),FHSERV["C":$P(FHLOCZN,U,6),1:"")
19 ..I FHSRV="" S FHSRVPT="" Q
20 ..S FHSRVPT=$P($G(^FH(119.72,FHSRV,0)),U,1)
21 ..Q
22 .W ?26,FHLOC,?38,$E(FHSRVPT,1,9)
23 .W ?51,$P(FHNODE,U,4),?56,$P(FHNODE,U,5)
24 .I $P($G(^FH(119.6,FHLPT,1)),U,4)="Y" D DIETPAT W ?60,$E(FHDIETP,1,12)
25 .I $P($G(^FH(119.6,FHLPT,1)),U,4)'="Y" S FHDPTR=$P(FHNODE,U,2) Q:FHDPTR="" W ?60,$E($P($G(^FH(111,FHDPTR,0)),U,1),1,12)
26 .S FHSTAT=$P(FHNODE,U,15) I FHSTAT="C" W ?76,"C"
27 .I $Y>(IOSL-4) D PG I EX=U Q
28 .I $D(^FHPT(FHDFN,"OP",FHRNUM,1)) D
29 ..S FHNODE1=$G(^FHPT(FHDFN,"OP",FHRNUM,1))
30 ..S FHSTATA=$P(FHNODE1,U,5) I FHSTATA="C" W !?7,"Additional Orders: ",$E($P(FHNODE1,U,1),1,46),?76,"C" Q
31 ..W !?7,"Additional Orders: ",$P(FHNODE1,U,1)
32 .I $D(^FHPT(FHDFN,"OP",FHRNUM,2)) D
33 ..S FHNODE2=$G(^FHPT(FHDFN,"OP",FHRNUM,2))
34 ..S FHEL=FHNODE2
35 ..W !?7,"Early/Late Tray Time: ",$P(FHEL,U,1)
36 ..W " Bagged Meal: ",$P(FHEL,U,2)
37 ..S FHSTATE=$P(FHNODE2,U,6) I FHSTATE="C" W ?76,"C"
38 .I $D(^FHPT(FHDFN,"OP",FHRNUM,3)) D
39 ..S FHNODE3=$G(^FHPT(FHDFN,"OP",FHRNUM,3))
40 ..S FHTU=FHNODE3
41 ..W !?7,"Tubefeeding: " S FHSTATT=$P(FHTU,U,5) I FHSTATT="C" W ?76,"C"
42 ..F FHTZ=0:0 S FHTZ=$O(^FHPT(FHDFN,"OP",FHRNUM,"TF",FHTZ)) Q:FHTZ'>0 D
43 ...S FHTUZN=$G(^FHPT(FHDFN,"OP",FHRNUM,"TF",FHTZ,0))
44 ...S FHTUPTR=$P(FHTUZN,U,1),FHTUSTR=$P(FHTUZN,U,2)
45 ...W !?9,$P($G(^FH(118.2,FHTUPTR,0)),U,1)," Strength: "
46 ...W $S(FHTUSTR=1:"1/4",FHTUSTR=2:"1/2",FHTUSTR=3:"3/4",1:"FULL")
47 ...I $P(FHTUZN,U,3)["CC" D ;print ml instead of cc.
48 ....S QUA=$P(FHTUZN,U,3)
49 ....S QUAFI=$P(QUA,"CC",1),QUASE=$P(QUA,"CC",2)
50 ....S $P(FHTUZN,U,3)=QUAFI_"ML"_QUASE
51 ...W " Quantity: ",$P(FHTUZN,U,3)
52 ..W !?7,"Total ML's: ",$P(FHTU,U,2)," Total KCALS/DAY: ",$P(FHTU,U,3)
53 ..S FHTCOMM=$P(FHTU,U,1) I FHTCOMM'="" W !?7,"Comment: ",FHTCOMM
54 .;outpatient SOs.
55 .I $D(^FHPT(FHDFN,"OP",FHRNUM,"SP")) D
56 ..I $Y>(IOSL-4) D PG I EX=U Q
57 ..W !,?7,"Standing Orders:"
58 ..S FHTZSOL=23,FHTZCNT=0
59 ..F FHTZ=0:0 S FHTZ=$O(^FHPT(FHDFN,"OP",FHRNUM,"SP",FHTZ)) Q:FHTZ'>0 D
60 ...S FHTZSO=$G(^FHPT(FHDFN,"OP",FHRNUM,"SP",FHTZ,0))
61 ...S FHTZSO2=$P(FHTZSO,U,2)
62 ...S FHTZSO6=$P(FHTZSO,U,6)
63 ...S FHTZSO8=$P(FHTZSO,U,8)
64 ...S FHTZSOCN="" I FHTZSO6'="" S FHTZSOCN=" (C) "
65 ...I $G(FHTZSO2),$D(^FH(118.3,FHTZSO2,0)) D
66 ....S FHTZSON=$P(^FH(118.3,FHTZSO2,0),U,1)
67 ....S FHTZSOL=FHTZSOL+$L(FHTZSON)+$L(FHTZSOCN)+7
68 ....I FHTZSOL>80 W !,?23 S FHTZSOL=30+$L(FHTZSON)+$L(FHTZSOCN),FHTZCNT=0
69 ....I $G(FHTZCNT) W ", ",FHTZSON,FHTZSOCN," = ",FHTZSO8
70 ....E W " ",FHTZSON,FHTZSOCN," = ",FHTZSO8
71 ....S FHTZCNT=FHTZCNT+1
72 .I $D(^FHPT(FHDFN,"OP",FHRNUM,"SF")) D
73 ..Q:'$D(^FHPT(FHDFN,"OP",FHRNUM,"SF",0))
74 ..S SF=""
75 ..I $D(^FHPT(FHDFN,"OP",FHRNUM,"SF",0)) S SF=$P(^(0),U,3)
76 ..Q:'SF
77 ..S FHSFDAT=$G(^FHPT(FHDFN,"OP",FHRNUM,"SF",SF,0))
78 ..I SF,$P(FHSFDAT,U,32) Q
79 ..I $Y>(IOSL-4) D PG I EX=U Q
80 ..W !,?7,"Supplemental Feeding: " I $P(FHSFDAT,U,4),$D(^FH(118.1,$P(FHSFDAT,U,4),0)) W $P(^(0),U,1)
81 ..S FHSF10=$P(FHSFDAT,U,5,12)
82 ..S FHSF2=$P(FHSFDAT,U,13,20)
83 ..S FHSF8=$P(FHSFDAT,U,21,28)
84 ..I FHSF10'["^^^^^^^" D
85 ...W !,?9,"10AM:"
86 ...F FHI=1,3,5,7 S FHSF1=$P(FHSF10,U,FHI) I FHSF1,$D(^FH(118,FHSF1,0)) W " ",$P(^FH(118,FHSF1,0),U,1)," = ",$S('$P(FHSF10,U,FHI+1):1,1:$P(FHSF10,U,FHI+1))
87 ..I FHSF2'["^^^^^^^" D
88 ...I $Y>(IOSL-4) D PG I EX=U Q
89 ...W !,?9,"2PM:"
90 ...F FHI=1,3,5,7 S FHSF1=$P(FHSF2,U,FHI) I FHSF1,$D(^FH(118,FHSF1,0)) W " ",$P(^FH(118,FHSF1,0),U,1)," = ",$S('$P(FHSF2,U,FHI+1):1,1:$P(FHSF2,U,FHI+1))
91 ..I FHSF8'["^^^^^^^" D
92 ...I $Y>(IOSL-4) D PG I EX=U Q
93 ...W !,?9,"8PM:"
94 ...F FHI=1,3,5,7 S FHSF1=$P(FHSF8,U,FHI) I FHSF1,$D(^FH(118,FHSF1,0)) W " ",$P(^FH(118,FHSF1,0),U,1)," = ",$S('$P(FHSF8,U,FHI+1):1,1:$P(FHSF8,U,FHI+1))
95 .Q
96 W ! Q
97DIETPAT ;
98 S FHDIETS=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,7,11)
99 S FHDIETP=""
100 F PCE=1:1:5 D
101 .S FHDPTR=$P(FHDIETS,U,PCE) I FHDPTR="" Q
102 .S FHDNM=$P($G(^FH(111,FHDPTR,0)),U,7)
103 .I FHDNM="" S FHDNM=$P($G(^FH(111,FHDPTR,0)),U,1)
104 .S FHDIETP=FHDIETP_FHDNM_"," Q
105 S FHDIETP=$E(FHDIETP,1,$L(FHDIETP)-1)
106 Q
107PG ;
108 Q:$O(^FHPT(FHDFN,"OP","B",FHRMDT))'>0
109 I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR I 'Y S EX=U Q
110 D HDR Q
111HDR ;
112 I $G(FHPP)'=1 W:$Y @IOF
113 K FHPP W !?15,"R E C U R R I N G M E A L S"
114 W !!?3,"NAME: " D PATNAME^FHOMUTL W FHPTNM," ",FHSSN
115 W !!?27,"Ordering",?38,"Service"
116 W !?2,"#",?6,"Date/Time",?27,"Location",?38,"Point"
117 W ?50,"Meal",?55,"Bag",?60,"Diet Ordered",?74,"Status"
118 W !?1,"===",?6,"==================",?26,"=========="
119 W ?38,"==========",?50,"====",?55,"===",?60,"============",?74,"======"
120 Q
121END ;
122 K EX,FHDIET,FHDIETP,FHDIETS,FHDTP,FHFIND,FHLOC,FHLPT,FHNODE,FHRM
123 K FHRNUM,FHDPTR,FHDNM,FHTZCNT,FHTZSON,FHTZSOCN,FHTZSO8,FHTZSOL,FHTZSO2,FHTZSO6,FHTZ,FHTZSO Q
Note: See TracBrowser for help on using the repository browser.