source: WorldVistAEHR/trunk/r/DIETETICS-FH/FHMNPRT.m@ 1427

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

initial load of WorldVistAEHR

File size: 3.5 KB
Line 
1FHMNPRT ;Hines OIFO/RTK - Dietetics Monitor Report Print ;02/08/06 10:29
2 ;;5.5;DIETETICS;**4**;Jan 28, 2005;Build 32
3 ;
4PRINT ;
5 K FHMNTT S PG=0,EX="" D NOW^%DTC S Y=X D DD^%DT S FHNDT=Y D HDR
6 S (ALLMON,M1,M2,M3,M4,M5)=0
7 I FHNXIEN'="ALL",'$D(FHDATA(FHNXIEN)) D MESSAGE Q
8 I FHNXIEN'="ALL" S ZZ=FHNXIEN D DISP,D1END Q
9 I FHNXIEN="ALL" S ZZ="" F S ZZ=$O(FHDATA(ZZ)) Q:ZZ=""!(EX=U) D
10 .D DISP
11 .S ALLMON=ALLMON+MON
12 .S M1=M1+MON1,M2=M2+MON2,M3=M3+MON3,M4=M4+MON4,M5=M5+MON5
13 .Q
14 I FHNXIEN'="ALL"!(EX=U) D END Q
15 I ALLMON=0 W !!?5,"NO PATIENTS WITH MONITORS IN GIVEN DATE RANGE" D END Q
16 W !!?16,"Totals for ALL ",$S(FHSORT="C":"Clinicians.......: ",1:"Wards............: "),$J(ALLMON,3)
17 W !?16,"Monitor: Albumin ...............: ",$J(M1,3)," ",$J(((M1/ALLMON)*100),1,2),"%"
18 W !?16,"Monitor: BMI .....................: ",$J(M2,3)," ",$J(((M2/ALLMON)*100),1,2),"%"
19 W !?16,"Monitor: NPO+Clr Liq > 3 days...: ",$J(M3,3)," ",$J(((M3/ALLMON)*100),1,2),"%"
20 W !?16,"Monitor: On Hyperals............: ",$J(M4,3)," ",$J(((M4/ALLMON)*100),1,2),"%"
21 W !?16,"Monitor: On Tubefeeding.........: ",$J(M5,3)," ",$J(((M5/ALLMON)*100),1,2),"%"
22 I $Y>(IOSL-4) D PG I EX=U Q
23 W !!!,"TOTAL ADMISSIONS....:",?23,FHTADM
24 W !,"TOTAL MONITORS......:",?23,ALLMON
25 I FHTADM>0 W !,"PERCENTAGE..........:",?23,$J(((ALLMON/FHTADM)*100),1,2),"%"
26 ;
27D1END I IOST?1"C".E,EX'=U W ! K DIR S DIR(0)="E" D ^DIR
28 D END Q
29DISP ;
30 I FHSORT="C" W !!?25,"CLINICIAN: ",ZZ
31 I FHSORT="W" W !!?25,"WARD: ",ZZ
32 S (TOT,MON,MON1,MON2,MON3,MON4,MON5)=0
33 F YY=0:0 S YY=$O(FHDATA(ZZ,YY)) Q:YY'>0 D
34 .F HH=0:0 S HH=$O(FHDATA(ZZ,YY,HH)) Q:HH'>0!(EX=U) D
35 ..I $Y>(IOSL-4) D PG I EX=U Q
36 ..S DFN=$P(FHDATA(ZZ,YY,HH),U,5)
37 ..S Y=YY X ^DD("DD") W !,Y
38 ..W ?13,$P(FHDATA(ZZ,YY,HH),U,1)
39 ..W ?39,$P(FHDATA(ZZ,YY,HH),U,2)
40 ..W ?47,$P(FHDATA(ZZ,YY,HH),U,6)
41 ..I $P(FHDATA(ZZ,YY,HH),U,3)="Yes" D
42 ...F NUM=0:0 S NUM=$O(FHMON(DFN,HH,NUM)) Q:NUM'>0!(EX=U) D
43 ....I NUM'=1 W !
44 ....S MON=MON+1,MONTYP=$P($P(FHMON(DFN,HH,NUM),U,1),": ",2)
45 ....S PC=$S(MONTYP["Albumin":1,MONTYP["BMI":2,MONTYP["NPO+Clr":3,MONTYP["Hyper":4,1:5)
46 ....I $G(FHMNTT(ZZ))="" S FHMNTT(ZZ)=""
47 ....S $P(FHMNTT(ZZ),U,PC)=$P(FHMNTT(ZZ),U,PC)+1
48 ....W ?56,MONTYP I $Y>(IOSL-4) D PG I EX=U Q
49 ....Q
50 ...Q
51 ..S TOT=TOT+1
52 ..Q
53 .Q
54 I EX=U Q
55 W !!?16,"Total Number of Monitors........: ",$J(MON,3) I $Y>(IOSL-4) D PG I EX=U Q
56 S PCE=$P(FHMNTT(ZZ),U,1) I PCE>0 W !?16,"Monitor: Albumin ...............: ",$J(PCE,3)," ",$J(((PCE/MON)*100),1,2),"%" S MON1=PCE I $Y>(IOSL-4) D PG I EX=U Q
57 S PCE=$P(FHMNTT(ZZ),U,2) I PCE>0 W !?16,"Monitor: BMI .....................: ",$J(PCE,3)," ",$J(((PCE/MON)*100),1,2),"%" S MON2=PCE I $Y>(IOSL-4) D PG I EX=U Q
58 S PCE=$P(FHMNTT(ZZ),U,3) I PCE>0 W !?16,"Monitor: NPO+Clr Liq > 3 days...: ",$J(PCE,3)," ",$J(((PCE/MON)*100),1,2),"%" S MON3=PCE I $Y>(IOSL-4) D PG I EX=U Q
59 S PCE=$P(FHMNTT(ZZ),U,4) I PCE>0 W !?16,"Monitor: On Hyperals............: ",$J(PCE,3)," ",$J(((PCE/MON)*100),1,2),"%" S MON4=PCE I $Y>(IOSL-4) D PG I EX=U Q
60 S PCE=$P(FHMNTT(ZZ),U,5) I PCE>0 W !?16,"Monitor: On Tubefeeding.........: ",$J(PCE,3)," ",$J(((PCE/MON)*100),1,2),"%" S MON5=PCE
61 W ! Q
62 ;
63MESSAGE ;
64 W !!?5,"NO PATIENTS WITH MONITORS IN GIVEN DATE RANGE"
65 W !?10,"FOR THIS ",$S(FHSORT="C":"CLINICIAN",1:"WARD"),": ",FHNXIEN
66 Q
67END K FHMNTT,HH,M1,M2,M3,M4,M5,MON,MON1,MON2,MON3,MON4,MON5,MONTYP
68 K NUM,PC,PCE,PG,PER,TOT,YY
69 Q
70PG ;
71 I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR I 'Y S EX=U Q
72 D HDR Q
73HDR ;Header
74 W:$Y @IOF W !,FHNDT,?60,"Page: " S PG=PG+1 W PG,!!
75 W "Admission",?13,"Patient",?39,"SSN",?45,"Status",?56,"Monitor(s)"
76 W ! F Z=1:1:79 W "="
77 Q
Note: See TracBrowser for help on using the repository browser.