LRLIST ;SLC/RWF/CJS - LAB RESULTS LIST ;2/19/91 10:39 [ 04/14/2003 9:05 AM ]
;;5.2T9;LR;**1004,1006,1018**;Nov 17, 2004
;;5.2;LAB SERVICE;**44,86,153**;Sep 27, 1994
W !,"Summary List (Supervisors') >>> NOT FOR WARD USE <<<",!
EN K ^TMP("LR",$J),LRAA
D DATE^LRWU G END:Y<1 S LRAD=Y,DIC="^LRO(68,",DIC(0)="AEQ",LRNL=0
S LRRDT=$$DDDATE^LRAFUNC1(Y,1)
F D ^DIC Q:Y<1 D CHKDAT^LRLSTWRL Q:Y<1 S DIC("A")="ANOTHER ONE: ",LRNL=LRNL+1,LRAA(LRNL)=+Y,LRAA(LRNL,1)=$P(Y,U,2),LRSS(LRNL)=$P(^LRO(68,LRAA(LRNL),0),U,2)
K DIC G EN:$G(LRNL)<1
S LRDATE=-1 I $P(^LRO(68,LRAA(1),0),U,2)="MI" S %DT("A")="Report date approved to display: " D DATE^LRWU G END:$G(LREND) S LRDATE=Y
C K DIRUT,DIR S DIR("A")="List By",DIR(0)="S^1:ACCESSION NUMBER;2:PATIENT"
D ^DIR G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) END
S LRX=Y
D RANGE G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) C
INST K DIR S DIR(0)="PO^4:AQENM",DIR("A")="Optional - Select Collecting Institution "
F D ^DIR Q:Y=""!($E(Y=U))!(Y<1) S:Y LRINST=+Y,LRINST(LRINST)="",DIR("A")="Select Another Collecting Institution "
K DIR,DIRUT G:$E(Y)=U END
ALL W !!?5,"Do you wish to see all tests including Common Accessions " S %=1 D YN^DICN G:%=0 ALL G:%<1 END S:%=1 LRALL=""
S %ZIS="MQ" D ^%ZIS G END:POP
I $D(IO("Q")) S ZTRTN="DQ^LRLIST",ZTIO=ION,ZTDESC="Summary List (Supervisors')",ZTSAVE("LR*")="" D ^%ZTLOAD G END
C2 S $P(LREQ,"=",IOM)="",S=1 K DX S DX(0)="Q"
I $E(IOST,1,2)="C-" S DX(0)="S S=$Y I S>(IOSL-8) N X,Y K DIR S DIR(0)=""E"" D ^DIR K DIR S S=$S($D(DIRUT):0,1:1) Q:$D(DIRUT) W @IOF D HDR^LRLIST S S=$S($D(DIRUT):0,1:1)"
I IOST?1"P".E S DX(0)="S S=$Y I S>(IOSL-8) W @IOF D HDR^LRLIST S S=$Y"
U IO D HDR G L10:LRX=1,L20:LRX=2,END
L10 I $D(LRALL) F LRAA=1:1:LRNL F LRL=LRFAN-1:0 S LRL=$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRL)) Q:(LRL>LRLAN)!(LRL<LRFAN)!(S=0) S ^TMP("LR",$J,LRL,LRAA)=""
I '$D(LRALL) F LRAA=1:1:LRNL S LRL=LRFAN-1 F S LRL=$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRL)) Q:(LRL>LRLAN)!(LRL<LRFAN) I $O(^(LRL,4,0)) S ^TMP("LR",$J,LRL,LRAA)=""
F LRAN=0:0 S LRAN=$O(^TMP("LR",$J,LRAN)) Q:LRAN<1!($D(DIRUT))!($D(DUOUT))!($D(DUOUT)) F LRAA=0:0 S LRAA=$O(^TMP("LR",$J,LRAN,LRAA)) Q:LRAA<1 D PR Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))
W !! G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) END
W "END OF REPORT",! G END
L20 F LRAA=1:1:LRNL D L22 Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
S LRPNM=""
;F S LRPNM=$O(^TMP("LR",$J,LRPNM)) Q:LRPNM=""!($D(DTOUT))!($D(DUOUT))!($D(DIRUT)) S PNM=$P(LRPNM,U),SSN=$P(LRPNM,U,2) D L26
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
F S LRPNM=$O(^TMP("LR",$J,LRPNM)) Q:LRPNM=""!($D(DTOUT))!($D(DUOUT))!($D(DIRUT)) S PNM=$P(LRPNM,U),HRCN=$P(LRPNM,U,2) D L26 ;IHS/ANMC/CLS 08/18/96
;----- END IHS MODIFICATIONS
W !! G:$D(DTOUT)!($D(DUOUT))!($D(DIRUT)) END
W !,"END OF REPORT",! G END
L22 F LRAN=LRFAN-1:0 S LRAN=$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN)) Q:LRAN<1!(LRAN>LRLAN)!($D(DTOUT))!($D(DUOUT))!($D(DIRUT))!(S=0) D L23
Q
L23 I '$D(LRALL),'$O(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,4,0)) Q
I $G(LRINST),'$D(LRINST(+$P($G(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,.3)),U,3))) Q
;Q:'$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0)) Q:'$D(^(3)) S LRDFN=+^(0),LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D DEM^LRX S:$L(PNM) ^TMP("LR",$J,PNM_U_SSN,LRAA,LRAN)=DOB Q
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
Q:'$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0)) Q:'$D(^(3)) S LRDFN=+^(0),LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D DEM^LRX S:$L(PNM) ^TMP("LR",$J,PNM_U_HRCN,LRAA,LRAN)=DOB Q ;IHS/ANMC/CLS 08/18/96
;----- END IHS MODIFICATIONS
L26 F LRAA=0:0 S LRAA=$O(^TMP("LR",$J,LRPNM,LRAA)) Q:LRAA<1!($D(DTOUT))!($D(DUOUT))!($D(DIRUT))!(S=0) D L28
Q
L28 F LRAN=0:0 S LRAN=$O(^TMP("LR",$J,LRPNM,LRAA,LRAN)) Q:LRAN<1!($D(DTOUT))!($D(DUOUT))!($D(DIRUT))!(S=0) D PR
Q
PR ;
I '$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0)) W !!?10," Accession ",LRAN," deleted ",!!,$C(7) Q
I $G(LRINST),'$D(LRINST(+$P($G(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,.3)),U,3))) Q
Q:'$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,3))
S LRIDT=9999999-^(3),LRDFN=+^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0),LRINT=$P(^(0),U,5),LRODT=$P(^(0),U,4) G PR1:LRDATE<1
S LRSET=0 F I=1,5,8,11,16 I $D(^LR(LRDFN,"MI",LRIDT,I)),+^(I)=LRDATE S LRSET=1 Q
Q:'LRSET
PR1 S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D DEM^LRX
;I $E(IOST,1,2)="C-",$Y>(IOSL-8) N X,Y K DIR S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(S=0) W @IOF D HDR S S=$Y
;I IOST?1"P".E&($Y>(IOSL-6)) W @IOF D HDR ;ONLY FOR USE ON A PRINTER
X DX(0) Q:S=0
;D DASH^LRX W !!,PNM,?40,SSN,!,LRAA(LRAA,1)," ACC: ",$S($D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.2)):^(.2),1:"no acc")
;----- BEGIN IHS MODIFICATIONS
D DASH^LRX W !!,PNM,?40,HRCN,!,LRAA(LRAA,1)," ACC: ",$S($D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.2)):^(.2),1:"no acc") ;IHS/ANMC/CLS 08/18/96
;----- END IHS MODIFICATIONS
W ?45,$S($D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.1)):" ORDER #: "_^(.1),1:"")
I LRINT S LRINT=$S($D(^LRO(69,LRODT,1,LRINT,0)):$P(^(0),U,2),1:"") I LRINT S LRINT=$P($G(^VA(200,LRINT,0)),U,1) W !,"Person placing order: ",LRINT
I $D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,4)) D
. S LRIN=+$O(^(4,"B",0))
. I LRIN,$D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,4,LRIN)) D
.. S LRIN=$P($G(^(LRIN,0)),U,4)
.. S:$G(LRIN) LRIN=$E($P(^VA(200,LRIN,0),U),1,10)
.. W:$L(LRIN) " Person performing test: ",LRIN
X DX(0) Q:S=0
I '$D(LRSS(+$G(LRAA))) W !," ACCESSION #: ",LRAN," HAS AN ERROR NOTIFY SYSTEM MANAGER >>> ",!! Q
IF '$D(^LR(LRDFN,LRSS(LRAA),LRIDT,0)) W !," ACCESSION #: ",LRAN," >>>>ERROR PLEASE NOTIFY SYSTEM MANAGER<<<<<",! Q
W ! S DIC="^LR("_LRDFN_","""_LRSS(LRAA)_""",",DR="0"_$S(LRLONG:":99999999",1:""),DA=LRIDT
X DX(0) Q:S=0 D EN^LRDIQ Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
I $G(LRLONG)=2 F DR="ORU","ORUT" Q:S=0 X DX(0) Q:S=0 D EN^LRDIQ Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
Q
TOF Q:S=0 X DX(0)
;S S=$Y I $E(IOST,1,2)="P-",$Y>(IOSL-6) W @IOF D HDR S S=$Y Q
;I $E(IOST,1,2)="C-",$Y>(IOSL-8) N X,Y S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(S=0) W @IOF D HDR S S=$Y
Q
END W ! W:$E(IOST,1,2)="P-" @IOF D ^%ZISC
K DIC,D1,DIR,A,AGE,DFN,DOB,DR,LRAN,LRINST,S,SEX,T,ZZ,ZZY
K LRNG1,LRNG11,LRNG12,LRNG2,LRNG3,LRNG4,LRNG5
K DTOUT,DUOUT,DIRUT,LR,LRDFN,LRDPF,LRIDT,LRODT,LRPRAC,LRRB,LRTREA,LRWRD,PNM
K SSN,VA,LREQ
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
K SSN,HRCN,VA,LREQ ;IHS/ANMC/CLS 08/18/96
;----- END IHS MODIFICATIONS
K ^TMP("LR",$J),LRPNM,LRDATE,LRLONG,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK,%H
K C1,D0,DA,DICS,DL,DSC,DX,LRL,LAST,LRAA,LRAD,LRALL,LRDX,LREDT,LREND,LRFAN
K LRIN,LRINT,LRLAN,LRLINE,LRNL,LRSET,LRSS,LRWDTL,LRRDT,LRRPG,LRX,POP,IO("Q")
;D KVAR^VADPT Q
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
D @$S($$ISPIMS^BLRUTIL:"KVAR^VADPT",1:"KVAR^BLRDPT") Q ;IHS/DIR TUC/AAB 06/19/98
;----- END IHS MODIFICATIONS
HDR I $G(LRDBUG),$S($D(DTOUT):1,$D(DUOUT):1,$D(DIRUT):1,S=0:1,1:0) W !,"88888"
Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))!(S=0)
I '$G(LRRPG) S LRRPG=1 W:$E(IOST,1,2)="C-" @IOF
HD1 W "SUMMARY LIST (SUPERVISORS') FOR DATE: ",LRRDT,?(IOM-12),"PAGE: ",LRRPG,!
W " >> NOT FOR WARD USE <<" W:$L(LRRDT)=4 ?40,"Report for date: ",$$FMTE^XLFDT($S(LRDATE>0:LRDATE,1:$$NOW^XLFDT),"D")
W !,"ACCESSION AREA(S) :" F ZZ=1:1:LRNL W LRAA(ZZ,1)," "
I $O(LRINST(0)) W !,"Collecting Site(s) " S ZZ=0 F S ZZ=$O(LRINST(ZZ)) Q:ZZ="" W $P(^DIC(4,ZZ,0),U)," / "
W !,LREQ S S=$Y
S LRRPG=LRRPG+1
Q
RANGE K DIR,DIRUT S DIR("B")="S",DIR(0)="S^L:LONG;S:SHORT;E:EXTENDED",LRLONG=0
S DIR("?")="Long listing shows verified results where short list does not."
S DIR("?",1)="Extened provides demographics results and normal ranges."
D ^DIR K DIR
Q:$D(DTOUT)!($D(DUOUT))!($D(DIRUT))
S LRLONG=$S(Y["L":1,Y["E":2,1:0)
D LRAN^LRWU3 Q
TST S LRAA(1)=42,LRAA(1,1)="CHEMISTRY",LRNL=1,LRALL="",LRSS(1)="CH"
;LRAD=DATE TO SCAN,LRRDT=DATE PRINT FORMAT,LRFAN=STARTING NUMBER
;LRX=REPORT SORT,LRLAN=LAST ACCESSION #
DQ U IO S:$D(ZTQUEUED) ZTREQ="@"
S:'$D(LRLONG) LRLONG=1
I '$G(LRAD) S X="T-1",%DT="X" D ^%DT S LRAD=Y
I '$L($G(LRRDT)) S LRRDT=$$DDDATE^LRAFUNC1(LRAD)
S:'$G(LRX) LRX=2 S:'$D(LRFAN) LRFAN=1
S:'$G(LRLAN) LRLAN=30
S:'$G(LRDATE) LRDATE=-1
G C2
LRLIST ;SLC/RWF/CJS - LAB RESULTS LIST ;2/19/91 10:39 [ 04/14/2003 9:05 AM ]
+1 ;;5.2T9;LR;**1004,1006,1018**;Nov 17, 2004
+2 ;;5.2;LAB SERVICE;**44,86,153**;Sep 27, 1994
+3 WRITE !,"Summary List (Supervisors') >>> NOT FOR WARD USE <<<",!
EN KILL ^TMP("LR",$JOB),LRAA
+1 DO DATE^LRWU
IF Y<1
GOTO END
SET LRAD=Y
SET DIC="^LRO(68,"
SET DIC(0)="AEQ"
SET LRNL=0
+2 SET LRRDT=$$DDDATE^LRAFUNC1(Y,1)
+3 FOR
DO ^DIC
IF Y<1
QUIT
DO CHKDAT^LRLSTWRL
IF Y<1
QUIT
SET DIC("A")="ANOTHER ONE: "
SET LRNL=LRNL+1
SET LRAA(LRNL)=+Y
SET LRAA(LRNL,1)=$PIECE(Y,U,2)
SET LRSS(LRNL)=$PIECE(^LRO(68,LRAA(LRNL),0),U,2)
+4 KILL DIC
IF $GET(LRNL)<1
GOTO EN
+5 SET LRDATE=-1
IF $PIECE(^LRO(68,LRAA(1),0),U,2)="MI"
SET %DT("A")="Report date approved to display: "
DO DATE^LRWU
IF $GET(LREND)
GOTO END
SET LRDATE=Y
C KILL DIRUT,DIR
SET DIR("A")="List By"
SET DIR(0)="S^1:ACCESSION NUMBER;2:PATIENT"
+1 DO ^DIR
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
GOTO END
+2 SET LRX=Y
+3 DO RANGE
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
GOTO C
INST KILL DIR
SET DIR(0)="PO^4:AQENM"
SET DIR("A")="Optional - Select Collecting Institution "
+1 FOR
DO ^DIR
IF Y=""!($EXTRACT(Y=U))!(Y<1)
QUIT
IF Y
SET LRINST=+Y
SET LRINST(LRINST)=""
SET DIR("A")="Select Another Collecting Institution "
+2 KILL DIR,DIRUT
IF $EXTRACT(Y)=U
GOTO END
ALL WRITE !!?5,"Do you wish to see all tests including Common Accessions "
SET %=1
DO YN^DICN
IF %=0
GOTO ALL
IF %<1
GOTO END
IF %=1
SET LRALL=""
+1 SET %ZIS="MQ"
DO ^%ZIS
IF POP
GOTO END
+2 IF $DATA(IO("Q"))
SET ZTRTN="DQ^LRLIST"
SET ZTIO=ION
SET ZTDESC="Summary List (Supervisors')"
SET ZTSAVE("LR*")=""
DO ^%ZTLOAD
GOTO END
C2 SET $PIECE(LREQ,"=",IOM)=""
SET S=1
KILL DX
SET DX(0)="Q"
+1 IF $EXTRACT(IOST,1,2)="C-"
SET DX(0)="S S=$Y I S>(IOSL-8) N X,Y K DIR S DIR(0)=""E"" D ^DIR K DIR S S=$S($D(DIRUT):0,1:1) Q:$D(DIRUT) W @IOF D HDR^LRLIST S S=$S($D(DIRUT):0,1:1)"
+2 IF IOST?1"P".E
SET DX(0)="S S=$Y I S>(IOSL-8) W @IOF D HDR^LRLIST S S=$Y"
+3 USE IO
DO HDR
IF LRX=1
GOTO L10
IF LRX=2
GOTO L20
GOTO END
L10 IF $DATA(LRALL)
FOR LRAA=1:1:LRNL
FOR LRL=LRFAN-1:0
SET LRL=$ORDER(^LRO(68,LRAA(LRAA),1,LRAD,1,LRL))
IF (LRL>LRLAN)!(LRL<LRFAN)!(S=0)
QUIT
SET ^TMP("LR",$JOB,LRL,LRAA)=""
+1 IF '$DATA(LRALL)
FOR LRAA=1:1:LRNL
SET LRL=LRFAN-1
FOR
SET LRL=$ORDER(^LRO(68,LRAA(LRAA),1,LRAD,1,LRL))
IF (LRL>LRLAN)!(LRL<LRFAN)
QUIT
IF $ORDER(^(LRL,4,0))
SET ^TMP("LR",$JOB,LRL,LRAA)=""
+2 FOR LRAN=0:0
SET LRAN=$ORDER(^TMP("LR",$JOB,LRAN))
IF LRAN<1!($DATA(DIRUT))!($DATA(DUOUT))!($DATA(DUOUT))
QUIT
FOR LRAA=0:0
SET LRAA=$ORDER(^TMP("LR",$JOB,LRAN,LRAA))
IF LRAA<1
QUIT
DO PR
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
QUIT
+3 WRITE !!
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
GOTO END
+4 WRITE "END OF REPORT",!
GOTO END
L20 FOR LRAA=1:1:LRNL
DO L22
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))!(S=0)
QUIT
+1 SET LRPNM=""
+2 ;F S LRPNM=$O(^TMP("LR",$J,LRPNM)) Q:LRPNM=""!($D(DTOUT))!($D(DUOUT))!($D(DIRUT)) S PNM=$P(LRPNM,U),SSN=$P(LRPNM,U,2) D L26
+3 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+4 ;IHS/ANMC/CLS 08/18/96
FOR
SET LRPNM=$ORDER(^TMP("LR",$JOB,LRPNM))
IF LRPNM=""!($DATA(DTOUT))!($DATA(DUOUT))!($DATA(DIRUT))
QUIT
SET PNM=$PIECE(LRPNM,U)
SET HRCN=$PIECE(LRPNM,U,2)
DO L26
+5 ;----- END IHS MODIFICATIONS
+6 WRITE !!
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
GOTO END
+7 WRITE !,"END OF REPORT",!
GOTO END
L22 FOR LRAN=LRFAN-1:0
SET LRAN=$ORDER(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN))
IF LRAN<1!(LRAN>LRLAN)!($DATA(DTOUT))!($DATA(DUOUT))!($DATA(DIRUT))!(S=0)
QUIT
DO L23
+1 QUIT
L23 IF '$DATA(LRALL)
IF '$ORDER(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,4,0))
QUIT
+1 IF $GET(LRINST)
IF '$DATA(LRINST(+$PIECE($GET(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,.3)),U,3)))
QUIT
+2 ;Q:'$D(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0)) Q:'$D(^(3)) S LRDFN=+^(0),LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3) D DEM^LRX S:$L(PNM) ^TMP("LR",$J,PNM_U_SSN,LRAA,LRAN)=DOB Q
+3 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+4 ;IHS/ANMC/CLS 08/18/96
IF '$DATA(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0))
QUIT
IF '$DATA(^(3))
QUIT
SET LRDFN=+^(0)
SET LRDPF=$PIECE(^LR(LRDFN,0),U,2)
SET DFN=$PIECE(^(0),U,3)
DO DEM^LRX
IF $LENGTH(PNM)
SET ^TMP("LR",$JOB,PNM_U_HRCN,LRAA,LRAN)=DOB
QUIT
+5 ;----- END IHS MODIFICATIONS
L26 FOR LRAA=0:0
SET LRAA=$ORDER(^TMP("LR",$JOB,LRPNM,LRAA))
IF LRAA<1!($DATA(DTOUT))!($DATA(DUOUT))!($DATA(DIRUT))!(S=0)
QUIT
DO L28
+1 QUIT
L28 FOR LRAN=0:0
SET LRAN=$ORDER(^TMP("LR",$JOB,LRPNM,LRAA,LRAN))
IF LRAN<1!($DATA(DTOUT))!($DATA(DUOUT))!($DATA(DIRUT))!(S=0)
QUIT
DO PR
+1 QUIT
PR ;
+1 IF '$DATA(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0))
WRITE !!?10," Accession ",LRAN," deleted ",!!,$CHAR(7)
QUIT
+2 IF $GET(LRINST)
IF '$DATA(LRINST(+$PIECE($GET(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,.3)),U,3)))
QUIT
+3 IF '$DATA(^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,3))
QUIT
+4 SET LRIDT=9999999-^(3)
SET LRDFN=+^LRO(68,LRAA(LRAA),1,LRAD,1,LRAN,0)
SET LRINT=$PIECE(^(0),U,5)
SET LRODT=$PIECE(^(0),U,4)
IF LRDATE<1
GOTO PR1
+5 SET LRSET=0
FOR I=1,5,8,11,16
IF $DATA(^LR(LRDFN,"MI",LRIDT,I))
IF +^(I)=LRDATE
SET LRSET=1
QUIT
+6 IF 'LRSET
QUIT
PR1 SET LRDPF=$PIECE(^LR(LRDFN,0),U,2)
SET DFN=$PIECE(^(0),U,3)
DO DEM^LRX
+1 ;I $E(IOST,1,2)="C-",$Y>(IOSL-8) N X,Y K DIR S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(S=0) W @IOF D HDR S S=$Y
+2 ;I IOST?1"P".E&($Y>(IOSL-6)) W @IOF D HDR ;ONLY FOR USE ON A PRINTER
+3 XECUTE DX(0)
IF S=0
QUIT
+4 ;D DASH^LRX W !!,PNM,?40,SSN,!,LRAA(LRAA,1)," ACC: ",$S($D(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.2)):^(.2),1:"no acc")
+5 ;----- BEGIN IHS MODIFICATIONS
+6 ;IHS/ANMC/CLS 08/18/96
DO DASH^LRX
WRITE !!,PNM,?40,HRCN,!,LRAA(LRAA,1)," ACC: ",$SELECT($DATA(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.2)):^(.2),1:"no acc")
+7 ;----- END IHS MODIFICATIONS
+8 WRITE ?45,$SELECT($DATA(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,.1)):" ORDER #: "_^(.1),1:"")
+9 IF LRINT
SET LRINT=$SELECT($DATA(^LRO(69,LRODT,1,LRINT,0)):$PIECE(^(0),U,2),1:"")
IF LRINT
SET LRINT=$PIECE($GET(^VA(200,LRINT,0)),U,1)
WRITE !,"Person placing order: ",LRINT
+10 IF $DATA(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,4))
Begin DoDot:1
+11 SET LRIN=+$ORDER(^(4,"B",0))
+12 IF LRIN
IF $DATA(^LRO(68,+LRAA(LRAA),1,LRAD,1,LRAN,4,LRIN))
Begin DoDot:2
+13 SET LRIN=$PIECE($GET(^(LRIN,0)),U,4)
+14 IF $GET(LRIN)
SET LRIN=$EXTRACT($PIECE(^VA(200,LRIN,0),U),1,10)
+15 IF $LENGTH(LRIN)
WRITE " Person performing test: ",LRIN
End DoDot:2
End DoDot:1
+16 XECUTE DX(0)
IF S=0
QUIT
+17 IF '$DATA(LRSS(+$GET(LRAA)))
WRITE !," ACCESSION #: ",LRAN," HAS AN ERROR NOTIFY SYSTEM MANAGER >>> ",!!
QUIT
+18 IF '$DATA(^LR(LRDFN,LRSS(LRAA),LRIDT,0))
WRITE !," ACCESSION #: ",LRAN," >>>>ERROR PLEASE NOTIFY SYSTEM MANAGER<<<<<",!
QUIT
+19 WRITE !
SET DIC="^LR("_LRDFN_","""_LRSS(LRAA)_""","
SET DR="0"_$SELECT(LRLONG:":99999999",1:"")
SET DA=LRIDT
+20 XECUTE DX(0)
IF S=0
QUIT
DO EN^LRDIQ
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))!(S=0)
QUIT
+21 IF $GET(LRLONG)=2
FOR DR="ORU","ORUT"
IF S=0
QUIT
XECUTE DX(0)
IF S=0
QUIT
DO EN^LRDIQ
IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))!(S=0)
QUIT
+22 QUIT
TOF IF S=0
QUIT
XECUTE DX(0)
+1 ;S S=$Y I $E(IOST,1,2)="P-",$Y>(IOSL-6) W @IOF D HDR S S=$Y Q
+2 ;I $E(IOST,1,2)="C-",$Y>(IOSL-8) N X,Y S DIR(0)="E" D ^DIR K DIR Q:$D(DIRUT)!($D(DUOUT))!($D(DTOUT))!(S=0) W @IOF D HDR S S=$Y
+3 QUIT
END WRITE !
IF $EXTRACT(IOST,1,2)="P-"
WRITE @IOF
DO ^%ZISC
+1 KILL DIC,D1,DIR,A,AGE,DFN,DOB,DR,LRAN,LRINST,S,SEX,T,ZZ,ZZY
+2 KILL LRNG1,LRNG11,LRNG12,LRNG2,LRNG3,LRNG4,LRNG5
+3 KILL DTOUT,DUOUT,DIRUT,LR,LRDFN,LRDPF,LRIDT,LRODT,LRPRAC,LRRB,LRTREA,LRWRD,PNM
+4 KILL SSN,VA,LREQ
+5 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+6 ;IHS/ANMC/CLS 08/18/96
KILL SSN,HRCN,VA,LREQ
+7 ;----- END IHS MODIFICATIONS
+8 KILL ^TMP("LR",$JOB),LRPNM,LRDATE,LRLONG,ZTRTN,ZTIO,ZTDESC,ZTSAVE,ZTSK,%H
+9 KILL C1,D0,DA,DICS,DL,DSC,DX,LRL,LAST,LRAA,LRAD,LRALL,LRDX,LREDT,LREND,LRFAN
+10 KILL LRIN,LRINT,LRLAN,LRLINE,LRNL,LRSET,LRSS,LRWDTL,LRRDT,LRRPG,LRX,POP,IO("Q")
+11 ;D KVAR^VADPT Q
+12 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+13 ;IHS/DIR TUC/AAB 06/19/98
DO @$SELECT($$ISPIMS^BLRUTIL:"KVAR^VADPT",1:"KVAR^BLRDPT")
QUIT
+14 ;----- END IHS MODIFICATIONS
HDR IF $GET(LRDBUG)
IF $SELECT($DATA(DTOUT):1,$DATA(DUOUT):1,$DATA(DIRUT):1,S=0:1,1:0)
WRITE !,"88888"
+1 IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))!(S=0)
QUIT
+2 IF '$GET(LRRPG)
SET LRRPG=1
IF $EXTRACT(IOST,1,2)="C-"
WRITE @IOF
HD1 WRITE "SUMMARY LIST (SUPERVISORS') FOR DATE: ",LRRDT,?(IOM-12),"PAGE: ",LRRPG,!
+1 WRITE " >> NOT FOR WARD USE <<"
IF $LENGTH(LRRDT)=4
WRITE ?40,"Report for date: ",$$FMTE^XLFDT($SELECT(LRDATE>0:LRDATE,1:$$NOW^XLFDT),"D")
+2 WRITE !,"ACCESSION AREA(S) :"
FOR ZZ=1:1:LRNL
WRITE LRAA(ZZ,1)," "
+3 IF $ORDER(LRINST(0))
WRITE !,"Collecting Site(s) "
SET ZZ=0
FOR
SET ZZ=$ORDER(LRINST(ZZ))
IF ZZ=""
QUIT
WRITE $PIECE(^DIC(4,ZZ,0),U)," / "
+4 WRITE !,LREQ
SET S=$Y
+5 SET LRRPG=LRRPG+1
+6 QUIT
RANGE KILL DIR,DIRUT
SET DIR("B")="S"
SET DIR(0)="S^L:LONG;S:SHORT;E:EXTENDED"
SET LRLONG=0
+1 SET DIR("?")="Long listing shows verified results where short list does not."
+2 SET DIR("?",1)="Extened provides demographics results and normal ranges."
+3 DO ^DIR
KILL DIR
+4 IF $DATA(DTOUT)!($DATA(DUOUT))!($DATA(DIRUT))
QUIT
+5 SET LRLONG=$SELECT(Y["L":1,Y["E":2,1:0)
+6 DO LRAN^LRWU3
QUIT
TST SET LRAA(1)=42
SET LRAA(1,1)="CHEMISTRY"
SET LRNL=1
SET LRALL=""
SET LRSS(1)="CH"
+1 ;LRAD=DATE TO SCAN,LRRDT=DATE PRINT FORMAT,LRFAN=STARTING NUMBER
+2 ;LRX=REPORT SORT,LRLAN=LAST ACCESSION #
DQ USE IO
IF $DATA(ZTQUEUED)
SET ZTREQ="@"
+1 IF '$DATA(LRLONG)
SET LRLONG=1
+2 IF '$GET(LRAD)
SET X="T-1"
SET %DT="X"
DO ^%DT
SET LRAD=Y
+3 IF '$LENGTH($GET(LRRDT))
SET LRRDT=$$DDDATE^LRAFUNC1(LRAD)
+4 IF '$GET(LRX)
SET LRX=2
IF '$DATA(LRFAN)
SET LRFAN=1
+5 IF '$GET(LRLAN)
SET LRLAN=30
+6 IF '$GET(LRDATE)
SET LRDATE=-1
+7 GOTO C2