source: FOIAVistA/tag/r/DIETETICS-FH/FHOMPP1.m@ 1540

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1FHOMPP1 ;Hines OIFO/RTK Patient Profile for CPRS (continued) ;6/07/04 9:05
2 ;;5.5;DIETETICS;**1**;Jan 28, 2005
3 ;
4 S FHB="" F I=1:1:80 S FHB=FHB_" "
5 S X1=STDT,X2=-1 D C^%DTC S STDT=X
6 I '$O(^FHPT(FHDFN,"OP","B",STDT)) S N=1 D NEWL^FHOMPP S ^TMP($J,"FHPROF",DFN,FHX)="No Recurring Meals to Display" Q
7 K FHLIST S EX="",NUM=0 D HDR
8 F FHRMDT=STDT:0 S FHRMDT=$O(^FHPT(FHDFN,"OP","B",FHRMDT)) Q:FHRMDT'>0!(EX=U) F FHRNUM=0:0 S FHRNUM=$O(^FHPT(FHDFN,"OP","B",FHRMDT,FHRNUM)) Q:FHRNUM'>0!(EX=U) D
9 .S NUM=NUM+1,FHNODE=$G(^FHPT(FHDFN,"OP",FHRNUM,0))
10 .S FHRM=$P(FHNODE,U,1)
11 .S FHDOW=$$DOW^XLFDT(FHRM),FHDOW=$E(FHDOW,1,3)
12 .S FHDTP=$$FMTE^XLFDT(FHRM,"P") S N=0 D NEWL^FHOMPP S ^TMP($J,"FHPROF",DFN,FHX)=NUM S FHJ=7 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_FHDOW_" - "_$E(FHDTP,1,12)
13 .S FHLPT=$P(FHNODE,U,3),FHLOCZN=$G(^FH(119.6,FHLPT,0)) D
14 ..S FHLOC=$E($P(FHLOCZN,U,1),1,10),FHSERV=$P(FHLOCZN,U,10)
15 ..S FHSRV=$S(FHSERV["T":$P(FHLOCZN,U,5),FHSERV["C":$P(FHLOCZN,U,6),1:"")
16 ..I FHSRV="" S FHSRVPT="" Q
17 ..S FHSRVPT=$P($G(^FH(119.72,FHSRV,0)),U,1)
18 ..Q
19 .S FHJ=27 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_FHLOC
20 .S FHJ=39 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_$E(FHSRVPT,1,9)
21 .S FHJ=52 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_$P(FHNODE,U,4)
22 .S FHJ=57 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_$P(FHNODE,U,5)
23 .I $P($G(^FH(119.6,FHLPT,1)),U,4)="Y" D DIETPAT S FHJ=61 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_$E(FHDIETP,1,12)
24 .E S FHDPTR=$P(FHNODE,U,2) S FHJ=61 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_$E($P($G(^FH(111,FHDPTR,0)),U,1),1,12)
25 .S FHSTAT=$P(FHNODE,U,15) I FHSTAT="C" S FHJ=77 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_"C"
26 .I $D(^FHPT(FHDFN,"OP",FHRNUM,1)) D
27 ..S N=0 D NEWL^FHOMPP
28 ..S FHNODE1=$G(^FHPT(FHDFN,"OP",FHRNUM,1))
29 ..S FHSTATA=$P(FHNODE1,U,5) I FHSTATA="C" S ^TMP($J,"FHPROF",DFN,FHX)=" Additional Orders: "_$E($P(FHNODE1,U,1),1,46) S FHJ=77 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_"C" Q
30 ..S ^TMP($J,"FHPROF",DFN,FHX)=" Additional Orders: "_$P(FHNODE1,U,1)
31 .I $D(^FHPT(FHDFN,"OP",FHRNUM,2)) D
32 ..S N=0 D NEWL^FHOMPP
33 ..S FHNODE2=$G(^FHPT(FHDFN,"OP",FHRNUM,2))
34 ..S FHEL=FHNODE2
35 ..S ^TMP($J,"FHPROF",DFN,FHX)=" Early/Late Tray Time: "_$P(FHEL,U,1)_" Bagged Meal: "_$P(FHEL,U,2)
36 ..S FHSTATE=$P(FHNODE2,U,6) I FHSTATE="C" S FHJ=77 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_"C" Q
37 .I $D(^FHPT(FHDFN,"OP",FHRNUM,3)) D
38 ..S N=0 D NEWL^FHOMPP
39 ..S FHNODE3=$G(^FHPT(FHDFN,"OP",FHRNUM,3))
40 ..S FHTU=FHNODE3
41 ..S ^TMP($J,"FHPROF",DFN,FHX)=" Tubefeeding: " S FHSTATT=$P(FHTU,U,5) I FHSTATT="C" S FHJ=77 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_"C"
42 ..S N=0 D NEWL^FHOMPP
43 ..F FHTZ=0:0 S FHTZ=$O(^FHPT(FHDFN,"OP",FHRNUM,"TF",FHTZ)) Q:FHTZ'>0 D
44 ...S FHTUZN=$G(^FHPT(FHDFN,"OP",FHRNUM,"TF",FHTZ,0))
45 ...S FHTUPTR=$P(FHTUZN,U,1),FHTUSTR=$P(FHTUZN,U,2)
46 ...I $P(FHTUZN,U,3)["CC" D
47 ....S QUA=$P(FHTUZN,U,3)
48 ....S QUAFI=$P(QUA,"CC",1),QUASE=$P(QUA,"CC",2)
49 ....S $P(FHTUZN,U,3)=QUAFI_"ML"_QUASE
50 ...S ^TMP($J,"FHPROF",DFN,FHX)=" "_$P($G(^FH(118.2,FHTUPTR,0)),U,1)_" Strength: "_$S(FHTUSTR=1:"1/4",FHTUSTR=2:"1/2",FHTUSTR=3:"3/4",1:"FULL")_" Quantity: "_$P(FHTUZN,U,3)
51 ...S N=0 D NEWL^FHOMPP
52 ...S ^TMP($J,"FHPROF",DFN,FHX)=" Total ML's: "_$P(FHTU,U,2)_" Total KCALS/DAY: "_$P(FHTU,U,3)
53 ..S FHTCOMM=$P(FHTU,U,1) I FHTCOMM'="" S N=0 D NEWL^FHOMPP S ^TMP($J,"FHPROF",DFN,FHX)="Comment: "_FHTCOMM
54 .Q
55 Q
56DIETPAT ;
57 S FHDIETS=$P($G(^FHPT(FHDFN,"OP",FHRNUM,0)),U,7,11)
58 S FHDIETP=""
59 F PCE=1:1:5 D
60 .S FHDPTR=$P(FHDIETS,U,PCE) I FHDPTR="" Q
61 .S FHDNM=$P($G(^FH(111,FHDPTR,0)),U,7)
62 .I FHDNM="" S FHDNM=$P($G(^FH(111,FHDPTR,0)),U,1)
63 .S FHDIETP=FHDIETP_FHDNM_"," Q
64 S FHDIETP=$E(FHDIETP,1,$L(FHDIETP)-1)
65 Q
66HDR ;
67 ;S ^TMP($J,"FHPROF",DFN,FHX)=" OUTPATIENT NAME: " D PATNAME^FHOMUTL S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_FHPTNM_" "_FHSSN
68 ;S FHJ=66 D PAD S ^TMP($J,"FHPROF",DFN,FHX)=^TMP($J,"FHPROF",DFN,FHX)_PAD_FHSEX_" Age "_FHAGE
69 S N=1 D NEWL^FHOMPP
70 S ^TMP($J,"FHPROF",DFN,FHX)=" Ordering Service"
71 S N=0 D NEWL^FHOMPP
72 S ^TMP($J,"FHPROF",DFN,FHX)=" # Date/Time Location Point Meal Bag Diet Ordered Status"
73 S N=0 D NEWL^FHOMPP
74 S ^TMP($J,"FHPROF",DFN,FHX)="=== ================== ========== ========== ==== === ============ ======"
75 Q
76PAD ;
77 S FHU=^TMP($J,"FHPROF",DFN,FHX),A=$L(FHU),PAD=$E(FHB,1,FHJ-A)
78 Q
79END ;
80 K EX,FHDIET,FHDIETP,FHDIETS,FHDTP,FHFIND,FHLOC,FHLPT,FHNODE,FHRM
81 K FHRNUM,FHDPTR,FHDNM Q
Note: See TracBrowser for help on using the repository browser.