[613] | 1 | FHMMNADM ;Hines OIFO/JT,RTK,AAC - Multidiv Adm/Disc Monitor Report ;10/10/03 10:34
|
---|
| 2 | ;;5.5;DIETETICS;;Jan 28, 2005
|
---|
| 3 | ;
|
---|
| 4 | COM ;Get Communication Offices
|
---|
| 5 | ;
|
---|
| 6 | S (XX,ZCO,CO,COXX,CNAME,CONAME,CONAM,WARD,FHCOMM)="",(ALLMON,ALLMV)=0
|
---|
| 7 | ;S ZZOUT=$G(^FH(119.73,0)),(CONUMX,ZOUT)=$P(ZZOUT,"^",4)
|
---|
| 8 | S ZZCOUNT=0 F ZZCOUNT=0:0 S ZZCOUNT=$O(^FH(119.73,ZZCOUNT)) Q:ZZCOUNT'>0 S ZOUT=ZZCOUNT
|
---|
| 9 | R !!,"Print report for all Communications Offices Y or N: ",ZCO:DTIME W ! S ZCO=$TR(ZCO,"y","Y")
|
---|
| 10 | I ZCO'="Y" D N2 I (Y=-1)&(CO="") Q
|
---|
| 11 | ;
|
---|
| 12 | DATE ;sets date
|
---|
| 13 | ;
|
---|
| 14 | K %DT(0) S %DT="AEPT",%DT("A")="Enter beginning date: " D ^%DT Q:Y<0
|
---|
| 15 | S FHSDT=Y,%DT(0)=FHSDT,%DT("A")="Enter ending date: " D ^%DT Q:Y<0
|
---|
| 16 | S FHEDT=Y
|
---|
| 17 | S DIR(0)="SA^A:Admissions;D:Discharges"
|
---|
| 18 | S DIR("A")="Select type of movement for this report: " D ^DIR
|
---|
| 19 | Q:Y["^"!(Y="") S TYP=Y
|
---|
| 20 | D DEV Q
|
---|
| 21 | ;
|
---|
| 22 | EN ;get admission/monitor information
|
---|
| 23 | Q:XX="*"
|
---|
| 24 | I ZCO'="Y" S CONUMX=CONUMX-1 G:CONUMX=0 THEND S COXX=$P(CO,"^",CONUMX),CNAME=$P(CONAME,"^",CONUMX)
|
---|
| 25 | I ZCO="Y" S COXX=COXX+1 G:COXX>ZOUT THEND S CNAME=$G(^FH(119.73,COXX,0)),CNAME=$P(CNAME,"^")
|
---|
| 26 | I $D(^FH(119.73,COXX,"I"))!'$D(^FH(119.73,COXX,0)) G EN
|
---|
| 27 | ;
|
---|
| 28 | I TYP'="A" G EN1 Q
|
---|
| 29 | S PG=0,EX="",Y=DT X ^DD("DD") S FHNDT=Y D HDR
|
---|
| 30 | S MVTOT=0,MONTOT=0
|
---|
| 31 | S I=FHSDT F S I=$O(^DGPM("ATT1",I)) Q:'I!(I>FHEDT)!(EX=U) D
|
---|
| 32 | .S J=0 F S J=$O(^DGPM("ATT1",I,J)) Q:'J!(EX=U) S REC=$G(^DGPM(J,0)) S WARD=$P(REC,"^",6) Q:WARD="" D COFF2 Q:FHCOMM="" Q:$D(^FH(119.73,FHCOMM,"I")) Q:FHCOMM'=COXX D
|
---|
| 33 | ..S ADM=J,ADMD=I D WRT
|
---|
| 34 | .Q
|
---|
| 35 | Q:XX="*"
|
---|
| 36 | D END
|
---|
| 37 | D EN
|
---|
| 38 | Q
|
---|
| 39 | ;
|
---|
| 40 | COFF ;get communication offices
|
---|
| 41 | Q:'$D(^DIC(42,"B",WARD))
|
---|
| 42 | S WARDIEN=$O(^DIC(42,"B",WARD,""))
|
---|
| 43 | Q:'$D(^FH(119.6,"AW",WARDIEN))
|
---|
| 44 | S FHWARD=$O(^FH(119.6,"AW",WARDIEN,""))
|
---|
| 45 | S FHCOMM=$P($G(^FH(119.6,FHWARD,0)),"^",8)
|
---|
| 46 | Q
|
---|
| 47 | ;
|
---|
| 48 | COFF2 ;
|
---|
| 49 | Q:'$D(^FH(119.6,"AW",WARD))
|
---|
| 50 | S FHWARD=$O(^FH(119.6,"AW",WARD,""))
|
---|
| 51 | S FHCOMM=$P($G(^FH(119.6,FHWARD,0)),"^",8)
|
---|
| 52 | Q
|
---|
| 53 | ;
|
---|
| 54 | WRT ;write info
|
---|
| 55 | ;
|
---|
| 56 | S DFN=$P(^DGPM(J,0),U,3) I $Y>(IOSL-4) D PG I EX=U S XX="*" Q
|
---|
| 57 | S FHZ115="P"_DFN D CHECK^FHOMDPA I FHDFN="" Q
|
---|
| 58 | S Y=$P(ADMD,".") X ^DD("DD") W !,Y,?13,$E($P($G(^DPT(DFN,0)),U,1),U,23)
|
---|
| 59 | W ?39,$E($P($G(^DPT(DFN,0)),U,9),6,9) S MVTOT=MVTOT+1
|
---|
| 60 | I $D(^FHPT(FHDFN,"A",ADM,"MO","B")) W ?48,"Yes" S MONTOT=MONTOT+1
|
---|
| 61 | S Y=$P($P($G(^FHPT(FHDFN,"A",ADM,0)),U,14),".",1) I Y X ^DD("DD") W ?56,Y
|
---|
| 62 | I $Y>(IOSL-4) D PG I EX=U S XX="*" Q
|
---|
| 63 | Q
|
---|
| 64 | ;
|
---|
| 65 | EN1 ;discharges
|
---|
| 66 | S PG=0,EX="",Y=DT X ^DD("DD") S FHNDT=Y D HDR I EX=U S XX="*" Q
|
---|
| 67 | S MVTOT=0,MONTOT=0
|
---|
| 68 | S I=FHSDT F S I=$O(^DGPM("ATT3",I)) Q:'I!(I>FHEDT)!(EX=U) D
|
---|
| 69 | .S J=0 F S J=$O(^DGPM("ATT3",I,J)) Q:'J!(EX=U) S D0=J D WARD^DGPMUTL S WARD=X Q:WARD="" D COFF Q:FHCOMM="" Q:$D(^FH(119.73,FHCOMM,"I")) Q:FHCOMM'=COXX D
|
---|
| 70 | ..S ADM=$P(^DGPM(J,0),U,14)
|
---|
| 71 | ..S ADMD=$P(^DGPM(ADM,0),U,1) D WRT
|
---|
| 72 | .Q
|
---|
| 73 | D END
|
---|
| 74 | D EN Q
|
---|
| 75 | ;
|
---|
| 76 | END ;end/kill/quit
|
---|
| 77 | ;
|
---|
| 78 | I EX=U Q
|
---|
| 79 | W !!,"TOTAL "_$S(TYP="A":"ADMISSIONS",TYP="D":"DISCHARGES")_": ",?22,MVTOT S ALLMV=ALLMV+MVTOT
|
---|
| 80 | W !,"TOTAL WITH MONITORS:",?22,MONTOT S ALLMON=ALLMON+MONTOT
|
---|
| 81 | S FHPER=0 I MONTOT>0,MVTOT>0 S FHPER=(MONTOT/MVTOT)*100
|
---|
| 82 | I $L($P(FHPER,".",2))>2 S FHPER=$P(FHPER,".",1)_"."_$E($P(FHPER,".",2),1,2)
|
---|
| 83 | W !,"Percentage of "
|
---|
| 84 | W $S(TYP="A":"Admissions",TYP="D":"Discharges")
|
---|
| 85 | W " with Monitors: ",FHPER,"%"
|
---|
| 86 | I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR
|
---|
| 87 | Q
|
---|
| 88 | ;
|
---|
| 89 | THEND ;end/kill/quit
|
---|
| 90 | ;
|
---|
| 91 | I EX=U Q
|
---|
| 92 | S CNAME="ALL "
|
---|
| 93 | D HDR
|
---|
| 94 | W !!,"ALL TOTAL "_$S(TYP="A":"ADMISSIONS",TYP="D":"DISCHARGES")_": ",?22,ALLMV
|
---|
| 95 | W !,"TOTAL WITH MONITORS:",?22,ALLMON
|
---|
| 96 | S ALLFHPER=0 I ALLMON>0,ALLMV>0 S ALLFHPER=(ALLMON/ALLMV)*100
|
---|
| 97 | I $L($P(ALLFHPER,".",2))>2 S ALLFHPER=$P(ALLFHPER,".",1)_"."_$E($P(ALLFHPER,".",2),1,2)
|
---|
| 98 | W !,"Percentage of "
|
---|
| 99 | W $S(TYP="A":"Admissions",TYP="D":"Discharges")
|
---|
| 100 | W " with Monitors: ",ALLFHPER,"%"
|
---|
| 101 | Q
|
---|
| 102 | ;
|
---|
| 103 | ;
|
---|
| 104 | DEV ;get device and set up queue
|
---|
| 105 | S TAG=$S(TYP="A":"EN",TYP="D":"EN")
|
---|
| 106 | K %ZIS,IOP S %ZIS="Q" D ^%ZIS Q:POP
|
---|
| 107 | I '$D(IO("Q")) U IO D @TAG,^%ZISC Q
|
---|
| 108 | S ZTRTN=TAG_"^FHMMNADM",ZTSAVE("FHSDT")="",ZTSAVE("FHEDT")=""
|
---|
| 109 | S ZTSAVE("ZCO")="",ZTSAVE("COXX")="",ZTSAVE("CONUMX")="",ZTSAVE("ZOUT")="",ZTSAVE("XX")=""
|
---|
| 110 | S ZTSAVE("CNAME")="",ZTSAVE("FHCOMM")="",ZTSAVE("CO")="",ZTSAVE("CONAME")=""
|
---|
| 111 | S ZTSAVE("ALLMV")="",ZTSAVE("ALLMON")="",ZTSAVE("ALLFHPER")=""
|
---|
| 112 | S ZTSAVE("TYP")="",ZTDESC="Dietetics Monitor Report" D ^%ZTLOAD
|
---|
| 113 | W !,"Task #",ZTSK
|
---|
| 114 | D ^%ZISC K %ZIS,IOP Q
|
---|
| 115 | Q
|
---|
| 116 | ;
|
---|
| 117 | KL ;
|
---|
| 118 | K I,J,DFN,FHDFN,SSN,MVTOT,MONTOT,FHPER,X,Y,PG,FHNDT,ADM,CO,CONAME,CONAM,WARD,FHCOMM,ALLMON,ALLMV
|
---|
| 119 | K TAG,DIR,%DT,ADDT Q
|
---|
| 120 | Q
|
---|
| 121 | ;
|
---|
| 122 | N2 ;Find Communications Office
|
---|
| 123 | S DIC=119.73,DIC(0)="AEQ",DIC("A")="Select Communication Offices: "
|
---|
| 124 | D ^DIC I (Y=-1)&(CO="") Q
|
---|
| 125 | I Y=-1 Q
|
---|
| 126 | S CON=$P(Y,"^",1),CO=CON_"^"_CO,CONAM=$P(Y,"^",2),CONAME=CONAM_"^"_CONAME S CONUMX=$L(CO,"^") G N2
|
---|
| 127 | I Y=-1 K DIC Q
|
---|
| 128 | Q
|
---|
| 129 | ;
|
---|
| 130 | PG ;
|
---|
| 131 | I IOST?1"C".E W ! K DIR S DIR(0)="E" D ^DIR I 'Y S EX=U Q
|
---|
| 132 | D HDR Q
|
---|
| 133 | HDR ;Header
|
---|
| 134 | ;
|
---|
| 135 | W:$Y @IOF
|
---|
| 136 | W !,"DIETETIC MONITOR REPORT (Monitoring "
|
---|
| 137 | W $S(TYP="A":"Admissions",TYP="D":"Discharges")_")"
|
---|
| 138 | W !,FHNDT,?60,"Page: " S PG=PG+1 W PG,!
|
---|
| 139 | W !,?5,"Communication Offices: ",CNAME,!!
|
---|
| 140 | W "Admission",?13,"Patient",?39,"SSN",?45,"Monitor?",?56,"Discharge"
|
---|
| 141 | W ! F Z=1:1:79 W "="
|
---|
| 142 | Q
|
---|