LRMISEZ ; IHS/DIR/FJE - MICROBIOLOGY INFECTION CONTROL DATA 2/14/89 17:10 ;
;;5.2;LR;**1013**;JUL 15, 2002
;
;;5.2;LAB SERVICE;;Sep 27, 1994
;from option LRMISEZ
BEGIN S U="^",LRLOS=0 S:'$D(DTIME) DTIME=999 K ^TMP($J) S IOP="HOME" D ^%ZIS,SURVEY W ! D ^%ZISC
END K ^TMP($J),%,%DT,A1,B,DFN,DIC,DTOUT,DUOUT,I,J,K,LAST,LRAA,LRAAN,LRAC,LRAD,LRADMD,LRADMS,LRAP,LRAO,LRASK,LRBG,LRBN,LRBO,LRBUG,LRDAT,LRDCHD,LRDFN
K LRDOC,LRDPF,LRDRUG,LREND,LRESULT,LRIDT,LRLLOC,LRLOS,LRLST,LRM,LRMY,LRNAME,LRND,LRNLOC,LROK,LROR,LRPAT,LRPF,LRPG,LRPNM,LRPPT,LRPROMPT,LRQUANT,LRSGL,LRSIT,LRST,LRSTAR,LRSUM,LRTK
;K LRYA,LRYRL,M,O,PNM,POP,R,S,SSN,X,Y,Z,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,LRZ,LRLIN
K LRYA,LRYRL,M,O,PNM,POP,R,S,SSN,HRCN,X,Y,Z,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,LRZ,LRLIN ;IHS/ANMC/CLS 08/18/96
Q
SURVEY W @IOF,?19,"INFECTION CONTROL SURVEY DATA",!! D LRAA^LRMIUT Q:LRAA<1
S LRAAN=$P(^LRO(68,LRAA,0),U,11)
F I=0:0 S %=1 W !!,"Use default reports" D YN^DICN Q:%'=0 D INFO
Q:%<0
S (LRM("L","S"),LRM("O","S"),LRM("D","S"),LRM("P","S"))="Unknown"
S LRSIT(1)=$S($D(^LAB(69.9,1,"MIS","B","C")):"C",1:"S") F I="L","P","D","O" S LRM(I)=$S($D(^LAB(69.9,1,"MIS","B",I)):"A",1:"N")
I %=2 S LREND=0 D ^LRMISEZA Q:LREND
I LRM("L")="N",LRM("O")="N",LRM("D")="N",LRM("P")="N" W !,"No reports were selected!" Q
S %DT="AEQ",%DT("A")="Start Date: " D ^%DT K %DT Q:Y<0 S LRSTAR=Y D D^LRU S LRST=Y I $E(LRSTAR,6,7)="00" S LRSTAR=$S($E(LRSTAR,4,7)="0000":LRSTAR+10000,$E(LRSTAR,4,5)="12":LRSTAR+10100,1:LRSTAR+100)
S %DT="AEQ",%DT("A")="End Date: " D ^%DT K %DT Q:Y<0 S LAST=Y D D^LRU S LRLST=Y Q:Y<0 I LRSTAR>LAST S X=LRSTAR,LRSTAR=LAST,LAST=X,X=LRST,LRST=LRLST,LRLST=X
S Y=LRSTAR D D^LRU S LRST=Y,Y=LAST D D^LRU S LRLST=Y,LRAD=$E(LRSTAR,1,3)-1_"0000",LRYRL=$E(LAST,1,3)_"0000",LAST=LAST\1+.99
DEVICE ;S %ZIS="NMQ",%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
S %ZIS="MQ",%ZIS("B")="" 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 ;IHS/ANMC/CLS 08/18/96 removed N(o) opening and mandatory queue
I '$D(IO("Q")) D DQ^LRMISEZ1 Q
S ZTRTN="DQ^LRMISEZ1",ZTSAVE("L*")="" D ^%ZTLOAD K IO("Q"),ZTSK,ZTRTN,ZTIO,ZTSAVE
Q
INFO W !,"Default reports are setup in the Laboratory Site file, 69.9."
W !,"If you answer 'NO', you can select individual surveys grouped by:",!,"organism, location, patient, and/or physician. You can select all items",!,"or a single item for each group. You can also select to have all groups"
W !,"contain a survey of a single organism. Surveys can be reported by",!,"Site/Specimen or Collection sample."
Q
LRMISEZ ; IHS/DIR/FJE - MICROBIOLOGY INFECTION CONTROL DATA 2/14/89 17:10 ;
+1 ;;5.2;LR;**1013**;JUL 15, 2002
+2 ;
+3 ;;5.2;LAB SERVICE;;Sep 27, 1994
+4 ;from option LRMISEZ
BEGIN SET U="^"
SET LRLOS=0
IF '$DATA(DTIME)
SET DTIME=999
KILL ^TMP($JOB)
SET IOP="HOME"
DO ^%ZIS
DO SURVEY
WRITE !
DO ^%ZISC
END KILL ^TMP($JOB),%,%DT,A1,B,DFN,DIC,DTOUT,DUOUT,I,J,K,LAST,LRAA,LRAAN,LRAC,LRAD,LRADMD,LRADMS,LRAP,LRAO,LRASK,LRBG,LRBN,LRBO,LRBUG,LRDAT,LRDCHD,LRDFN
+1 KILL LRDOC,LRDPF,LRDRUG,LREND,LRESULT,LRIDT,LRLLOC,LRLOS,LRLST,LRM,LRMY,LRNAME,LRND,LRNLOC,LROK,LROR,LRPAT,LRPF,LRPG,LRPNM,LRPPT,LRPROMPT,LRQUANT,LRSGL,LRSIT,LRST,LRSTAR,LRSUM,LRTK
+2 ;K LRYA,LRYRL,M,O,PNM,POP,R,S,SSN,X,Y,Z,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,LRZ,LRLIN
+3 ;IHS/ANMC/CLS 08/18/96
KILL LRYA,LRYRL,M,O,PNM,POP,R,S,SSN,HRCN,X,Y,Z,ZTDTH,ZTIO,ZTRTN,ZTSAVE,ZTSK,LRZ,LRLIN
+4 QUIT
SURVEY WRITE @IOF,?19,"INFECTION CONTROL SURVEY DATA",!!
DO LRAA^LRMIUT
IF LRAA<1
QUIT
+1 SET LRAAN=$PIECE(^LRO(68,LRAA,0),U,11)
+2 FOR I=0:0
SET %=1
WRITE !!,"Use default reports"
DO YN^DICN
IF %'=0
QUIT
DO INFO
+3 IF %<0
QUIT
+4 SET (LRM("L","S"),LRM("O","S"),LRM("D","S"),LRM("P","S"))="Unknown"
+5 SET LRSIT(1)=$SELECT($DATA(^LAB(69.9,1,"MIS","B","C")):"C",1:"S")
FOR I="L","P","D","O"
SET LRM(I)=$SELECT($DATA(^LAB(69.9,1,"MIS","B",I)):"A",1:"N")
+6 IF %=2
SET LREND=0
DO ^LRMISEZA
IF LREND
QUIT
+7 IF LRM("L")="N"
IF LRM("O")="N"
IF LRM("D")="N"
IF LRM("P")="N"
WRITE !,"No reports were selected!"
QUIT
+8 SET %DT="AEQ"
SET %DT("A")="Start Date: "
DO ^%DT
KILL %DT
IF Y<0
QUIT
SET LRSTAR=Y
DO D^LRU
SET LRST=Y
IF $EXTRACT(LRSTAR,6,7)="00"
SET LRSTAR=$SELECT($EXTRACT(LRSTAR,4,7)="0000":LRSTAR+10000,$EXTRACT(LRSTAR,4,5)="12":LRSTAR+10100,1:LRSTAR+100)
+9 SET %DT="AEQ"
SET %DT("A")="End Date: "
DO ^%DT
KILL %DT
IF Y<0
QUIT
SET LAST=Y
DO D^LRU
SET LRLST=Y
IF Y<0
QUIT
IF LRSTAR>LAST
SET X=LRSTAR
SET LRSTAR=LAST
SET LAST=X
SET X=LRST
SET LRST=LRLST
SET LRLST=X
+10 SET Y=LRSTAR
DO D^LRU
SET LRST=Y
SET Y=LAST
DO D^LRU
SET LRLST=Y
SET LRAD=$EXTRACT(LRSTAR,1,3)-1_"0000"
SET LRYRL=$EXTRACT(LAST,1,3)_"0000"
SET LAST=LAST\1+.99
DEVICE ;S %ZIS="NMQ",%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
+1 ;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 ;IHS/ANMC/CLS 08/18/96 removed N(o) opening and mandatory queue
SET %ZIS="MQ"
SET %ZIS("B")=""
WRITE !
DO ^%ZIS
KILL %ZIS
IF POP
QUIT
+2 IF '$DATA(IO("Q"))
DO DQ^LRMISEZ1
QUIT
+3 SET ZTRTN="DQ^LRMISEZ1"
SET ZTSAVE("L*")=""
DO ^%ZTLOAD
KILL IO("Q"),ZTSK,ZTRTN,ZTIO,ZTSAVE
+4 QUIT
INFO WRITE !,"Default reports are setup in the Laboratory Site file, 69.9."
+1 WRITE !,"If you answer 'NO', you can select individual surveys grouped by:",!,"organism, location, patient, and/or physician. You can select all items",!,"or a single item for each group. You can also select to have all groups"
+2 WRITE !,"contain a survey of a single organism. Surveys can be reported by",!,"Site/Specimen or Collection sample."
+3 QUIT