LRMITRZ ;AVAMC/REG,SLC/BA- MICRO TREND SHEET ; 2/14/89 17:11 ;
;;V~5.0~;LAB;;02/27/90 17:09
;from option LRMITRZ
BEGIN K ^UTILITY($J) S U="^",LRLOS=0 S:'$D(DTIME) DTIME=99 S IOP="HOME" D ^%ZIS,TREND W ! X ^%ZIS("C")
END K ^UTILITY($J),%,%DT,B,C,DFN,DIC,DTOUT,DUOUT,I,J,K,LAST,LRAB,LRADMD,LRADMS,LRANTI,LRAO,LRAP,LRASK,LRATS,LRBA,LRBEG,LRBG,LRBI,LRBN,LRBO,LRBUG,LRCBA,LRCOL,LRCT
K LRCTB,LRDAT,LRDCHD,LRDFN,LRDOC,LREND,LRFIN,LRIDT,LRLLOC,LRLOS,LRM,LRND,LRNO,LRNUM,LROK,LRPAT,LRPG,LRPNM,LRPROMPT,LRSEQ,LRSGL,LRSINGLE,LRSM,LRSSP,LRST,LRSTAR
K LRT,LRTOT,LRTSAL,LRTYPE,LRYY,O,P,PNM,POP,R,S,X,Y,Z,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,LRLIN,LRZ
Q
TREND W @IOF,?20,"MICROBIOLOGY ANTIMICROBIAL TREND SHEET"
F I=0:0 S %=1 W !!,"Use default reports" D YN^DICN Q:%'=0 D INFO
Q:%<0
S (LRM("O","S"),LRM("S","S"),LRM("L","S"),LRM("D","S"),LRM("P","S"),LRM("C","S"))="Unknown" F I="O","S","L","D","P","C" S LRM(I)=$S($D(^LAB(69.9,1,"MIT","B",I)):"A",1:"N")
I %=2 S LREND=0 D ^LRMITRZA Q:LREND
I LRM("O")="N",LRM("S")="N",LRM("L")="N",LRM("D")="N",LRM("P")="N",LRM("C")="N" W !,"No reports were selected!" Q
S %DT="AE",%DT("A")="Start with Month/Year: " D ^%DT K %DT Q:Y<1 S LRSTAR=$E(Y,1,5)_"00"
S %DT="AE",%DT("A")="End with Month/Year: " D ^%DT K %DT Q:Y<1 S LAST=$E(Y,1,5)_"00"
I LAST<LRSTAR S X=LRSTAR,LRSTAR=LAST,LAST=X
S Y=LRSTAR D D^LRU S LRBEG=Y,Y=LAST D D^LRU S LRFIN=Y,LAST=$E(LAST,1,5)_99
S LRATS=9999999-LRSTAR,LRTSAL=9999999-LAST
DEVICE S %ZIS="MNQ",%ZIS("B")="",IOP="Q" W ! D ^%ZIS K %ZIS Q:POP S %DT="AET",%DT("A")="TIME TO RUN: T+1@1AM//" D ^%DT S:Y>0 ZTDTH=Y I Y'>0 S %DT="T",X="T+1@1AM" D ^%DT S ZTDTH=Y
I '$D(IO("Q")) D DQ^LRMITRZ1 Q
S ZTRTN="DQ^LRMITRZ1",ZTSAVE("L*")="" D ^%ZTLOAD K IO("Q"),ZTRTN,ZTIO,ZTSAVE,Z,ZTSK
Q
INFO W !,"Default reports are setup in the Laboratory Site file, 69.9."
W !,"If you answer 'NO', you can select individual antibiotic trend reports",!,"grouped by: organism, site/specimen, location, patient, physician, and/or",!,"collection sample. You can select all items or a single item for each group."
W !,"Example: a trend report on a single patient."
Q
LRMITRZ ;AVAMC/REG,SLC/BA- MICRO TREND SHEET ; 2/14/89 17:11 ;
+1 ;;V~5.0~;LAB;;02/27/90 17:09
+2 ;from option LRMITRZ
BEGIN KILL ^UTILITY($JOB)
SET U="^"
SET LRLOS=0
IF '$DATA(DTIME)
SET DTIME=99
SET IOP="HOME"
DO ^%ZIS
DO TREND
WRITE !
XECUTE ^%ZIS("C")
END KILL ^UTILITY($JOB),%,%DT,B,C,DFN,DIC,DTOUT,DUOUT,I,J,K,LAST,LRAB,LRADMD,LRADMS,LRANTI,LRAO,LRAP,LRASK,LRATS,LRBA,LRBEG,LRBG,LRBI,LRBN,LRBO,LRBUG,LRCBA,LRCOL,LRCT
+1 KILL LRCTB,LRDAT,LRDCHD,LRDFN,LRDOC,LREND,LRFIN,LRIDT,LRLLOC,LRLOS,LRM,LRND,LRNO,LRNUM,LROK,LRPAT,LRPG,LRPNM,LRPROMPT,LRSEQ,LRSGL,LRSINGLE,LRSM,LRSSP,LRST,LRSTAR
+2 KILL LRT,LRTOT,LRTSAL,LRTYPE,LRYY,O,P,PNM,POP,R,S,X,Y,Z,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,LRLIN,LRZ
+3 QUIT
TREND WRITE @IOF,?20,"MICROBIOLOGY ANTIMICROBIAL TREND SHEET"
+1 FOR I=0:0
SET %=1
WRITE !!,"Use default reports"
DO YN^DICN
IF %'=0
QUIT
DO INFO
+2 IF %<0
QUIT
+3 SET (LRM("O","S"),LRM("S","S"),LRM("L","S"),LRM("D","S"),LRM("P","S"),LRM("C","S"))="Unknown"
FOR I="O","S","L","D","P","C"
SET LRM(I)=$SELECT($DATA(^LAB(69.9,1,"MIT","B",I)):"A",1:"N")
+4 IF %=2
SET LREND=0
DO ^LRMITRZA
IF LREND
QUIT
+5 IF LRM("O")="N"
IF LRM("S")="N"
IF LRM("L")="N"
IF LRM("D")="N"
IF LRM("P")="N"
IF LRM("C")="N"
WRITE !,"No reports were selected!"
QUIT
+6 SET %DT="AE"
SET %DT("A")="Start with Month/Year: "
DO ^%DT
KILL %DT
IF Y<1
QUIT
SET LRSTAR=$EXTRACT(Y,1,5)_"00"
+7 SET %DT="AE"
SET %DT("A")="End with Month/Year: "
DO ^%DT
KILL %DT
IF Y<1
QUIT
SET LAST=$EXTRACT(Y,1,5)_"00"
+8 IF LAST<LRSTAR
SET X=LRSTAR
SET LRSTAR=LAST
SET LAST=X
+9 SET Y=LRSTAR
DO D^LRU
SET LRBEG=Y
SET Y=LAST
DO D^LRU
SET LRFIN=Y
SET LAST=$EXTRACT(LAST,1,5)_99
+10 SET LRATS=9999999-LRSTAR
SET LRTSAL=9999999-LAST
DEVICE SET %ZIS="MNQ"
SET %ZIS("B")=""
SET IOP="Q"
WRITE !
DO ^%ZIS
KILL %ZIS
IF POP
QUIT
SET %DT="AET"
SET %DT("A")="TIME TO RUN: T+1@1AM//"
DO ^%DT
IF Y>0
SET ZTDTH=Y
IF Y'>0
SET %DT="T"
SET X="T+1@1AM"
DO ^%DT
SET ZTDTH=Y
+1 IF '$DATA(IO("Q"))
DO DQ^LRMITRZ1
QUIT
+2 SET ZTRTN="DQ^LRMITRZ1"
SET ZTSAVE("L*")=""
DO ^%ZTLOAD
KILL IO("Q"),ZTRTN,ZTIO,ZTSAVE,Z,ZTSK
+3 QUIT
INFO WRITE !,"Default reports are setup in the Laboratory Site file, 69.9."
+1 WRITE !,"If you answer 'NO', you can select individual antibiotic trend reports",!,"grouped by: organism, site/specimen, location, patient, physician, and/or",!,"collection sample. You can select all items or a single item for each group."
+2 WRITE !,"Example: a trend report on a single patient."
+3 QUIT