LRNDLST ;SLC/CJS - PRINT LIST OF NON-DRAW ORDERS ;2/19/91 11:03 ;
;;5.2;LAB SERVICE;**7,13,351**;Sep 27, 1994
S %DT="AE" D ^%DT Q:Y<1 S U="^",LRODT=+Y,LRLLOC="",%ZIS="Q" W !!?10," You may enter 'ALL' as a response",! D FNDLOC^LRDRAW G END:LRLLOC["^"
S LRBEG=1
S %ZIS="QN" D ^%ZIS G:POP END I IO=IO(0) G GO
K IO("Q") S ZTDESC="LONG FORM NO DRAW LIST",ZTIO=ION,ZTRTN="EN^LRNDLST",ZTSAVE("LRODT")="",ZTSAVE("LRLLOC")="",ZTSAVE("LRBEG")="" D ^%ZTLOAD W !!?10,"Report Queued to device "_ION,!
END K LROUT,DX(0),S,ZTSK
K DIRUT,J,%DT,%,A,I,K,LRDC,LRSN,X,Y,Z,DIC,%ZIS,LRBECAUS,LRCOMB,LRODT,LRLLOC,LRPGM,LRIO,LRTIME,%H,%X,%Y,DFN,LRDFN,LRDPF,LRIOZERO,LRLWC,PNM,POP,SSN D ^%ZISC
Q
% R %:DTIME S:'$T LROUT=1 Q:%=""!(%["N")!(%["Y") W !,"Answer 'Y' or 'N': " G %
GO K X,DX,DR,DIC S DR="0:99",U="^",Y=LRODT,PG=1 D DD^LRX S (LROUT,LRDC)=0
S DX(0)="I $E(IOST)=""C"" S S=$G(S)+1 I S>20 R ""'^' TO HALT: "",W:DTIME S:W=""^"" LROUT=1 S S=W'?1P W @IOF,!! I '$T S S=0,LROUT=1"
I LRLLOC="" F S LRLLOC=$O(^LRO(69,LRODT,1,"AC",LRLLOC)) Q:LRLLOC=""!(LROUT=1) S LRTOP=0,LRSN=0 F S LRSN=$O(^LRO(69,LRODT,1,"AC",LRLLOC,LRSN)) Q:LRSN<1!(LROUT=1) S LRDC=1 D ORD,PRNT
I LRLLOC'=""&(LROUT=0) S LRTOP=0,LRSN=0 F S LRSN=$O(^LRO(69,LRODT,1,"AC",LRLLOC,LRSN)) Q:LRSN<1!(LROUT=1) S LRDC=1 D ORD,PRNT
I 'LRDC W !,"REPORT EMPTY"
W !,"Finished",! W:$E(IOST,1,2)="P-" @IOF
S W="" R:'$G(LRBEG)&($E(IOST)="C") "Hit Enter to return to menu: ",W:DTIME
D ^%ZISC,END Q
ORD Q:$G(LROUT)
I $D(^LRO(69,LRODT,1,LRSN,1)),$P(^(1),U,4)="C" Q
I 'LRTOP S PG=1,W="" D
.R:'$G(LRBEG)&($E(IOST)="C") "Enter to CONTINUE or '^' TO HALT: ",W:DTIME
.S:W="^" LROUT=1 Q:$G(LROUT) W @IOF,!,"LIST OF PATIENT LAB ORDERS NOT DRAWN "_Y,!!!?10,"LISTING FOR ( ",LRLLOC," ) ",?50,"PG: ",PG,! S LRTOP=1 K LRBEG Q
Q
PRNT ;
Q:$G(LROUT) N S
I $D(^LRO(69,LRODT,1,LRSN,1)),$P(^(1),U,4)="C" Q
I '$L($P(^LRO(69,LRODT,1,LRSN,0),U,4)) Q
I $Y>$S($E(IOST)="C":18,1:60) S PG=PG+1 S W="" R:'$G(LRBEG)&($E(IOST)="C") "Enter to CONTINUE or '^' TO HALT: ",W:DTIME S:W="^" LROUT=1 Q:$G(LROUT) W @IOF,!!?10,"LISTING FOR ( ",LRLLOC," ) ",?50,"PG: ",PG,!
S DIC="^LRO(69,"_LRODT_",1,",(DA,D0)=LRSN,S=$Y S:'$D(DTOUT) DTOUT=0 D EN^LRDIQ Q:$G(LROUT) S LROUT=$G(DIRUT) Q
EN D GO W:$E(IOST,1,2)="P-" @IOF S:$D(ZTQUEUED) ZTREQ="@" Q
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRNDLST 2302 printed Nov 22, 2024@17:28:09 Page 2
LRNDLST ;SLC/CJS - PRINT LIST OF NON-DRAW ORDERS ;2/19/91 11:03 ;
+1 ;;5.2;LAB SERVICE;**7,13,351**;Sep 27, 1994
+2 SET %DT="AE"
DO ^%DT
if Y<1
QUIT
SET U="^"
SET LRODT=+Y
SET LRLLOC=""
SET %ZIS="Q"
WRITE !!?10," You may enter 'ALL' as a response",!
DO FNDLOC^LRDRAW
if LRLLOC["^"
GOTO END
+3 SET LRBEG=1
+4 SET %ZIS="QN"
DO ^%ZIS
if POP
GOTO END
IF IO=IO(0)
GOTO GO
+5 KILL IO("Q")
SET ZTDESC="LONG FORM NO DRAW LIST"
SET ZTIO=ION
SET ZTRTN="EN^LRNDLST"
SET ZTSAVE("LRODT")=""
SET ZTSAVE("LRLLOC")=""
SET ZTSAVE("LRBEG")=""
DO ^%ZTLOAD
WRITE !!?10,"Report Queued to device "_ION,!
END KILL LROUT,DX(0),S,ZTSK
+1 KILL DIRUT,J,%DT,%,A,I,K,LRDC,LRSN,X,Y,Z,DIC,%ZIS,LRBECAUS,LRCOMB,LRODT,LRLLOC,LRPGM,LRIO,LRTIME,%H,%X,%Y,DFN,LRDFN,LRDPF,LRIOZERO,LRLWC,PNM,POP,SSN
DO ^%ZISC
+2 QUIT
% READ %:DTIME
if '$TEST
SET LROUT=1
if %=""!(%["N")!(%["Y")
QUIT
WRITE !,"Answer 'Y' or 'N': "
GOTO %
GO KILL X,DX,DR,DIC
SET DR="0:99"
SET U="^"
SET Y=LRODT
SET PG=1
DO DD^LRX
SET (LROUT,LRDC)=0
+1 SET DX(0)="I $E(IOST)=""C"" S S=$G(S)+1 I S>20 R ""'^' TO HALT: "",W:DTIME S:W=""^"" LROUT=1 S S=W'?1P W @IOF,!! I '$T S S=0,LROUT=1"
+2 IF LRLLOC=""
FOR
SET LRLLOC=$ORDER(^LRO(69,LRODT,1,"AC",LRLLOC))
if LRLLOC=""!(LROUT=1)
QUIT
SET LRTOP=0
SET LRSN=0
FOR
SET LRSN=$ORDER(^LRO(69,LRODT,1,"AC",LRLLOC,LRSN))
if LRSN<1!(LROUT=1)
QUIT
SET LRDC=1
DO ORD
DO PRNT
+3 IF LRLLOC'=""&(LROUT=0)
SET LRTOP=0
SET LRSN=0
FOR
SET LRSN=$ORDER(^LRO(69,LRODT,1,"AC",LRLLOC,LRSN))
if LRSN<1!(LROUT=1)
QUIT
SET LRDC=1
DO ORD
DO PRNT
+4 IF 'LRDC
WRITE !,"REPORT EMPTY"
+5 WRITE !,"Finished",!
if $EXTRACT(IOST,1,2)="P-"
WRITE @IOF
+6 SET W=""
if '$GET(LRBEG)&($EXTRACT(IOST)="C")
READ "Hit Enter to return to menu: ",W:DTIME
+7 DO ^%ZISC
DO END
QUIT
ORD if $GET(LROUT)
QUIT
+1 IF $DATA(^LRO(69,LRODT,1,LRSN,1))
IF $PIECE(^(1),U,4)="C"
QUIT
+2 IF 'LRTOP
SET PG=1
SET W=""
Begin DoDot:1
+3 if '$GET(LRBEG)&($EXTRACT(IOST)="C")
READ "Enter to CONTINUE or '^' TO HALT: ",W:DTIME
+4 if W="^"
SET LROUT=1
if $GET(LROUT)
QUIT
WRITE @IOF,!,"LIST OF PATIENT LAB ORDERS NOT DRAWN "_Y,!!!?10,"LISTING FOR ( ",LRLLOC," ) ",?50,"PG: ",PG,!
SET LRTOP=1
KILL LRBEG
QUIT
End DoDot:1
+5 QUIT
PRNT ;
+1 if $GET(LROUT)
QUIT
NEW S
+2 IF $DATA(^LRO(69,LRODT,1,LRSN,1))
IF $PIECE(^(1),U,4)="C"
QUIT
+3 IF '$LENGTH($PIECE(^LRO(69,LRODT,1,LRSN,0),U,4))
QUIT
+4 IF $Y>$SELECT($EXTRACT(IOST)="C":18,1:60)
SET PG=PG+1
SET W=""
if '$GET(LRBEG)&($EXTRACT(IOST)="C")
READ "Enter to CONTINUE or '^' TO HALT: ",W:DTIME
if W="^"
SET LROUT=1
if $GET(LROUT)
QUIT
WRITE @IOF,!!?10,"LISTING FOR ( ",LRLLOC," ) ",?50,"PG: ",PG,!
+5 SET DIC="^LRO(69,"_LRODT_",1,"
SET (DA,D0)=LRSN
SET S=$Y
if '$DATA(DTOUT)
SET DTOUT=0
DO EN^LRDIQ
if $GET(LROUT)
QUIT
SET LROUT=$GET(DIRUT)
QUIT
EN DO GO
if $EXTRACT(IOST,1,2)="P-"
WRITE @IOF
if $DATA(ZTQUEUED)
SET ZTREQ="@"
QUIT
+1 QUIT