source: FOIAVistA/trunk/r/DIETETICS-FH/FHOMSS1.m@ 1423

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

initial load of FOIAVistA 6/30/08 version

File size: 2.6 KB
Line 
1FHOMSS1 ;Hines OIFO/RTK SPECIAL MEALS STATUS LIST ;4/11/03 10:05
2 ;;5.5;DIETETICS;**5**;Jan 28, 2005;Build 53
3 ;
4LIST ; Display for cancel/print/authorize screens - First build data in ^TMP
5 K ^TMP($J),FHLIST S NUM=0,EX="",ENDT=9999999
6 F FHSMDT=STDT:0 S FHSMDT=$O(^FHPT("SM",FHSMDT)) Q:FHSMDT'>0!(FHSMDT>ENDT) D
7 .F FHDFN=0:0 S FHDFN=$O(^FHPT("SM",FHSMDT,FHDFN)) Q:FHDFN'>0 D
8 ..S FHSMDTX=$E(FHSMDT,1,7)
9 ..S FHZN=$G(^FHPT(FHDFN,"SM",FHSMDT,0)),FHST=$P(FHZN,U,2) I FHST="C" Q
10 ..I FHS'[FHST Q
11 ..D PATNAME^FHOMUTL I FHDFN="" Q
12 ..S FHLOC=$P(FHZN,U,3) Q:FHLOC=""
13 ..S FHPRORD=$P($G(^FH(119.6,FHLOC,0)),U,4) I FHPRORD="" S FHPRORD=99
14 ..S FHPRORD=$S(FHPRORD<1:99,FHPRORD<10:"0"_FHPRORD,1:FHPRORD)
15 ..S FHLOCNM=$P($G(^FH(119.6,FHLOC,0)),U,1),FHML=$P(FHZN,U,9)
16 ..S FHML=$S(FHML="B":1,FHML="N":2,FHML="E":3)
17 ..S ^TMP($J,FHPRORD_"~"_FHLOCNM,FHSMDTX_"."_FHML,FHPTNM_"~"_FHDFN)=FHZN
18 ..Q
19 .Q
20 I '$D(^TMP($J)) Q
21 D HDR
22 S FHLSRT="" F S FHLSRT=$O(^TMP($J,FHLSRT)) Q:FHLSRT=""!(EX=U) D
23 .F FHSMDT=STDT:0 S FHSMDT=$O(^TMP($J,FHLSRT,FHSMDT)) Q:FHSMDT'>0!(FHSMDT>ENDT)!(EX=U) D
24 ..S FHPTN="" F S FHPTN=$O(^TMP($J,FHLSRT,FHSMDT,FHPTN)) Q:FHPTN=""!(EX=U) D
25 ...S FHNODE=$G(^TMP($J,FHLSRT,FHSMDT,FHPTN)),FHSMDTX=$P(FHNODE,U,1)
26 ...S NUM=NUM+1,PAD=$S($L(NUM)=1:" ",1:"") W !,PAD,NUM
27 ...S FHDFN=$P(FHPTN,"~",2) D PATNAME^FHOMUTL W ?4,$E(FHPTNM,1,17)
28 ...S FHSTAT=$P(FHNODE,U,2),FHSTAT=$S(FHSTAT="P":"PENDING",FHSTAT="A":"AUTH",FHSTAT="D":"DENIED",1:"CANCEL")
29 ...S FHD=$$FMTE^XLFDT(FHSMDTX,"P") W ?22,$E(FHD,1,12)
30 ...S FHLPT=$P(FHNODE,U,3),FHLOC=$E($P($G(^FH(119.6,FHLPT,0)),U,1),1,9)
31 ...S FHRMBD=$P(FHNODE,U,13),FHRMBNM=""
32 ...I FHRMBD'="" S FHRMBNM=$E($P($G(^DG(405.4,FHRMBD,0)),U,1),1,9)
33 ...W ?35,FHLOC,?45,FHRMBNM
34 ...S FHDPT=$P(FHNODE,U,4),FHDIET=$E($P($G(^FH(111,FHDPT,0)),U,1),1,12)
35 ...W ?55,FHDIET
36 ...S FHMEAL=$P(FHNODE,U,9) W ?69,FHMEAL,?73,FHSTAT
37 ...S FHLIST(NUM)=FHDFN_"^"_FHSMDTX
38 ...I $E(FHSTAT,1)="D" D
39 ....S FHDENY=$P(FHNODE,U,6) W !?6,"Denied by: "
40 ....I FHDENY'="" W $P($G(^VA(200,FHDENY,0)),U,1)
41 ...S FHCOMM=$P(FHNODE,U,8) I FHCOMM'="" W !?6,"Comment: ",FHCOMM
42 ...I $D(^FHPT(FHDFN,"SM",FHSMDTX,1)) D
43 ....S FHEL=$G(^FHPT(FHDFN,"SM",FHSMDTX,1))
44 ....W !?6,"Early/Late Tray Time: ",$P(FHEL,U,1)
45 ....W " Bagged Meal: ",$P(FHEL,U,2)
46 .I $Y>(IOSL-4) D PG I EX=U Q
47 .Q
48 Q
49PG ;
50 I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR I 'Y S EX=U Q
51 D HDR Q
52HDR ;
53 W:$Y @IOF
54 W !?5,"S P E C I A L M E A L S S T A T U S R E P O R T"
55 W !!!?1,"#",?6,"Name",?23,"Date/Time",?35,"Location",?45,"Room-Bed"
56 W ?55,"Diet Ordered",?68,"Meal",?73,"Status"
57 W !,"===",?4,"=================",?22,"============"
58 W ?35,"========= =========",?55,"============",?68,"====",?73,"======="
59 Q
Note: See TracBrowser for help on using the repository browser.