1 | FHMNADM ;Hines OIFO/JT,RTK - Dietetics Adm/Disc Monitor Report ;06/12/02 10:34
|
---|
2 | ;;5.5;DIETETICS;;Jan 28, 2005
|
---|
3 | ;
|
---|
4 | DATE ;sets date
|
---|
5 | ;
|
---|
6 | ; Check for multidivisional site
|
---|
7 | I $P($G(^FH(119.9,1,0)),U,20)'="N" D ^FHMMNADM Q
|
---|
8 | K %DT(0) S %DT="AEPT",%DT("A")="Enter beginning date: " D ^%DT Q:Y<0
|
---|
9 | S FHSDT=Y,%DT(0)=FHSDT,%DT("A")="Enter ending date: " D ^%DT Q:Y<0
|
---|
10 | S FHEDT=Y
|
---|
11 | S DIR(0)="SA^A:Admissions;D:Discharges"
|
---|
12 | S DIR("A")="Select type of movement for this report: " D ^DIR
|
---|
13 | Q:Y["^"!(Y="") S TYP=Y
|
---|
14 | G DEV
|
---|
15 | ;
|
---|
16 | EN ;get admission/monitor information
|
---|
17 | S PG=0,EX="",Y=DT X ^DD("DD") S FHNDT=Y D HDR
|
---|
18 | S MVTOT=0,MONTOT=0
|
---|
19 | S I=FHSDT F S I=$O(^DGPM("ATT1",I)) Q:'I!(I>FHEDT)!(EX=U) D
|
---|
20 | .S J=0 F S J=$O(^DGPM("ATT1",I,J)) Q:'J!(EX=U) D
|
---|
21 | ..S ADM=J,ADMD=I D WRT Q
|
---|
22 | .Q
|
---|
23 | D END Q
|
---|
24 | ;
|
---|
25 | WRT ;write info
|
---|
26 | ;
|
---|
27 | S DFN=$P(^DGPM(J,0),U,3) I $Y>(IOSL-4) D PG I EX=U Q
|
---|
28 | S FHZ115="P"_DFN D CHECK^FHOMDPA I FHDFN="" Q
|
---|
29 | S Y=$P(ADMD,".") X ^DD("DD") W !,Y,?13,$E($P(^DPT(DFN,0),U,1),U,23)
|
---|
30 | W ?39,$E($P(^(0),U,9),6,9) S MVTOT=MVTOT+1
|
---|
31 | I $D(^FHPT(FHDFN,"A",ADM,"MO"))>9 W ?48,"Yes" S MONTOT=MONTOT+1
|
---|
32 | S Y=$P($P($G(^FHPT(FHDFN,"A",ADM,0)),U,14),".",1) I Y X ^DD("DD") W ?56,Y
|
---|
33 | Q
|
---|
34 | ;
|
---|
35 | EN1 ;discharges
|
---|
36 | S PG=0,EX="",Y=DT X ^DD("DD") S FHNDT=Y D HDR
|
---|
37 | S MVTOT=0,MONTOT=0
|
---|
38 | S I=FHSDT F S I=$O(^DGPM("ATT3",I)) Q:'I!(I>FHEDT)!(EX=U) D
|
---|
39 | .S J=0 F S J=$O(^DGPM("ATT3",I,J)) Q:'J!(EX=U) D
|
---|
40 | ..S ADM=$P(^DGPM(J,0),U,14)
|
---|
41 | ..S ADMD=$P(^DGPM(ADM,0),U,1) D WRT Q
|
---|
42 | .Q
|
---|
43 | ;
|
---|
44 | END ;end/kill/quit
|
---|
45 | ;
|
---|
46 | I EX=U D KL Q
|
---|
47 | W !!,"TOTAL "_$S(TYP="A":"ADMISSIONS",TYP="D":"DISCHARGES")_": ",?22,MVTOT
|
---|
48 | W !,"TOTAL WITH MONITORS:",?22,MONTOT
|
---|
49 | S FHPER=0 I MONTOT>0,MVTOT>0 S FHPER=(MONTOT/MVTOT)*100
|
---|
50 | I $L($P(FHPER,".",2))>2 S FHPER=$P(FHPER,".",1)_"."_$E($P(FHPER,".",2),1,2)
|
---|
51 | W !,"Percentage of "
|
---|
52 | W $S(TYP="A":"Admissions",TYP="D":"Discharges")
|
---|
53 | W " with Monitors: ",FHPER,"%"
|
---|
54 | KL K I,J,FHDFN,DFN,SSN,MVTOT,MONTOT,FHPER,FHSDT,FHEDT,X,Y,PG,FHNDT,ADM
|
---|
55 | K TAG,TYP,DIR,%DT,ADDT Q
|
---|
56 | ;
|
---|
57 | DEV ;get device and set up queue
|
---|
58 | S TAG=$S(TYP="A":"EN",TYP="D":"EN1")
|
---|
59 | K %ZIS,IOP S %ZIS="Q" D ^%ZIS Q:POP
|
---|
60 | I '$D(IO("Q")) U IO D @TAG,^%ZISC Q
|
---|
61 | S ZTRTN=TAG_"^FHMNADM",ZTSAVE("FHSDT")="",ZTSAVE("FHEDT")=""
|
---|
62 | S ZTSAVE("TYP")="",ZTDESC="Dietetics Monitor Report" D ^%ZTLOAD
|
---|
63 | W !,"Task #",ZTSK
|
---|
64 | D ^%ZISC K %ZIS,IOP,FHSDT,FHEDT Q
|
---|
65 | PG ;
|
---|
66 | I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR I 'Y S EX=U Q
|
---|
67 | D HDR Q
|
---|
68 | HDR ;Header
|
---|
69 | ;
|
---|
70 | W:$Y @IOF
|
---|
71 | W !,"DIETETIC MONITOR REPORT (Monitoring "
|
---|
72 | W $S(TYP="A":"Admissions",TYP="D":"Discharges")_")"
|
---|
73 | W !,FHNDT,?60,"Page: " S PG=PG+1 W PG,!!
|
---|
74 | W "Admission",?13,"Patient",?39,"SSN",?45,"Monitor?",?56,"Discharge"
|
---|
75 | W ! F Z=1:1:79 W "="
|
---|
76 | Q
|
---|