LRPHLIS1 ;VA/SLC/CJS - PRINT COLLECTION LIST (CONT.) ; 15-Jun-2016 14:02 ; MKK
;;5.2;LR;**1,161,1018,1039**;NOV 01, 1997;Build 38
L1 ;
D PSET^LRLABLD ; Setup barcode variables
S LRLLOC=LRSTA,LRODT=DT
F S LRLLOC=$O(^LRO(69.1,"LRPH",1,LRLLOC)) Q:LRLLOC="" Q:(LRLLOC]LRFIN&(LRFIN'="")) D L2
K LRBAR0,LRBAR1
D KVA^VADPT
Q
;
L2 D HEAD:LRLL=1 D WARDHD:LRLL=2
S LRRB=""
F S LRRB=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB)) Q:LRRB="" D L3
Q
;
L3 S LRDFN=0
F S LRDFN=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN)),LRPORD=0 Q:LRDFN<1 D L4
Q
;
L4 S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3),LRINFW=$S($D(^(.091)):$P(^(.091),U),1:"")
D
. N LRRB,LRLLOC,I ; Protect these variables, used in loop below.
. D PT^LRX
I $D(LRMULTI),$D(LRDIV) S LRDIVLOC=$S($D(^LR(LRDFN,.2)):^(.2),1:"") I LRDIVLOC,$P($G(^SC(LRDIVLOC,0)),U,4)'=LRDIV Q ;multidivison
S LRSN=0
F S LRSN=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN)) Q:LRSN<1 S LRTJ=^(LRSN) D L5:LRLL=1,B5:LRLL=2
Q
;
L5 S LRTVOL=0,LRTOP=$P(^LAB(62,+LRTJ,0),U,3),LRURG=$S($D(^LAB(62.05,+$P(LRTJ,U,2),0)):$P(^(0),U),1:"ROUTINE"),LRODT=$P(LRTJ,U,3)
S LRAA=0
F S LRAA=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA)) Q:LRAA<1 D L6
K LRBAR
Q
;
L6 S LRORD=$S($D(^LRO(69,LRODT,1,LRSN,.1)):^(.1),1:""),LRAD=$P(^LRO(68,LRAA,0),U,3),LRAD=$S(LRAD="Y":$E(DT,1,3)_"0000","D"[LRAD:DT,"M"[LRAD:$E(DT,1,5)_"00","Q"[LRAD:$E(DT,1,3)_"0000"+(($E(DT,4,5)-1)\3*300+100),1:DT)
;I LRORD'=LRPORD S LRPORD=LRORD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " INF WARN: ",LRINFW W ?45,SSN,?60,"Order #: ",LRORD
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
; I LRORD'=LRPORD S LRPORD=LRORD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " INF WARN: ",LRINFW W ?45,HRCN,?60,"Order #: ",LRORD ;IHS/ANMC/CLS 08/18/96
I LRORD'=LRPORD S LRPORD=LRORD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " INF WARN: ",LRINFW W ?45,HRCN,?57,"Order #: ",LRORD ;IHS/MSC/MKK - LR*5.2*1039
;----- END IHS MODIFICATIONS
S LRWLEC=0 S LRAN=0 F S LRAN=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN)) Q:LRAN<1 S LRWLEC=LRWLEC+1 W:LRWLEC>1 !! S LRACC=$S($D(^LRO(68,LRAA,1,LRAD,1,LRAN,.2)):^(.2),1:"") S LRTVOL=0 D REM,L7
Q
L7 S T=0 F S T=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN,T)) Q:T<1 S LRTV=^(T) D S7 W !,?21,$E($P(^LAB(60,+LRTV,0),U),1,20) W:LRVOL>0 ?42,$J(LRVOL,6,1),"ML"
W ?52,LRTOP,?65,LRACC W:LRTVOL>0 !,?65,$J(LRTVOL,6,1),"ML T" Q
S7 S LRVOL=0,LRSSP=0
F S LRSSP=$O(^LAB(60,+LRTV,3,LRSSP)) Q:LRSSP<1 I +LRTJ=+^(LRSSP,0) S LRVOL=$P(^(0),U,4),LRTVOL=LRTVOL+LRVOL Q
Q
;
B5 S LRODT=$P(LRTJ,U,3)
Q:$D(^LRO(69,LRODT,1,LRSN,0))[0
S LRAA=0
F S LRAA=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA)) Q:LRAA<1 D
. D LBLTYP^LRLABLD ; Get lab routine to use
. D LRBAR^LRLABLD
. D B6
K LRBAR
Q
;
B6 Q:$P(^LRO(68,LRAA,0),U,12) S LRAD=$P(^(0),U,3),LRAD=$S(LRAD="Y":$E(DT,1,3)_"0000","D"[LRAD:DT,"M"[LRAD:$E(DT,1,5)_"00","Q"[LRAD:$E(DT,1,3)_"0000"+(($E(DT,4,5)-1)\3*300+100),1:DT)
S LRAN=0
F S LRAN=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN)) Q:LRAN<1 D B7
Q
;
B7 S:$L($G(LRRB)) LRRBX=LRRB
S LRACC=$S($D(^LRO(68,LRAA,1,LRAD,1,LRAN,.2)):^(.2),1:"") Q:LRACC']"" S LRCE=^(.1)
D GO^LRLABLD
S:$D(LRRBX) LRRB=LRRBX K LRRBX
Q
;
LRTOP S:$D(^LRO(68,LRAA,1,LRLBLD,1,LRAN,5,1,0)) LRTOP=+^(0),LRTOP=$S($D(^LAB(61,LRTOP,0)):$P(^(0),U),1:"") Q
Q
;
HEAD S N=$P(^LAB(69.9,1,5),"^",15) W @IOF,!!,?34,"COLLECTION LIST ",LRDT0,!,?34,N,$S(N=1:"ST",N=2:"ND",N=3:"RD",1:"TH")," PRINTING"
;W !,"Ward",!,?5,"Bed",?15,"Name",?45,"SSN",?65,"Accession",!,LRLLOC
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
W !,"Ward",!,?5,"Bed",?15,"Name",?45,"HRCN",?65,"Accession",!,LRLLOC ;IHS/ANMC/CLS 08/18/96
;----- END IHS MODIFICATIONS
Q
;
REM S LREM=0,T=0 F S T=$O(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN,T)) Q:T<1 S LREM=LREM+2
;I $Y>(IOSL-LREM-4) D HEAD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " PT INFO : ",LRINFW W ?45,SSN,?60,"Order #: ",LRORD,!
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
; I $Y>(IOSL-LREM-4) D HEAD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " PT INFO : ",LRINFW W ?45,HRCN,?60,"Order #: ",LRORD,! ;IHS/ANMC/CLS 08/18/96
I $Y>(IOSL-LREM-4) D HEAD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " PT INFO : ",LRINFW W ?45,HRCN,?57,"Order #: ",LRORD,! ;IHS/MSC/MKK - LR*5.2*1039
;----- END IHS MODIFICATIONS
Q
;
WARDHD ;
N LRAA,LRACC,LRAD,LRAN,LRBAR,LRBARID,LRCE,LRDAT,LRINFW,LRPREF,LRRB,LRTOP,LRTS,LRUID,LRURG0,LRURGA,LRXL
;N I,N,PNM,SSN
;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
N I,N,SSN,HRCN
Q:'$D(LRLLOC)#2
S PNM=LRLLOC,LRDAT="XX/XX/XX",SSN="XXX-XX-XXXX",LRACC=LRLLOC,HRCN="XXXXXX"
S (LRAA,LRAD)=0,LRAN="0000",LRCE="000"
S LRRB=1,LRPREF="XXXXX",LRTOP=" ",LRTS(1)="DON'T USE",LRTS(2)="NEW LOCATION"
S LRURG0=9
D LBLTYP^LRLABLD ; Get lab routine to use
D LRBAR^LRLABLD
D UID^LRLABLD,BARID^LRLABLD
S LRURGA=$$URGA^LRLABLD(LRURG0)
S LRINFW=" ",I=1,N=1,LRXL=0
D @LRLABEL
Q
LRPHLIS1 ;VA/SLC/CJS - PRINT COLLECTION LIST (CONT.) ; 15-Jun-2016 14:02 ; MKK
+1 ;;5.2;LR;**1,161,1018,1039**;NOV 01, 1997;Build 38
L1 ;
+1 ; Setup barcode variables
DO PSET^LRLABLD
+2 SET LRLLOC=LRSTA
SET LRODT=DT
+3 FOR
SET LRLLOC=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC))
IF LRLLOC=""
QUIT
IF (LRLLOC]LRFIN&(LRFIN'=""))
QUIT
DO L2
+4 KILL LRBAR0,LRBAR1
+5 DO KVA^VADPT
+6 QUIT
+7 ;
L2 IF LRLL=1
DO HEAD
IF LRLL=2
DO WARDHD
+1 SET LRRB=""
+2 FOR
SET LRRB=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB))
IF LRRB=""
QUIT
DO L3
+3 QUIT
+4 ;
L3 SET LRDFN=0
+1 FOR
SET LRDFN=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN))
SET LRPORD=0
IF LRDFN<1
QUIT
DO L4
+2 QUIT
+3 ;
L4 SET LRDPF=$PIECE(^LR(LRDFN,0),U,2)
SET DFN=$PIECE(^(0),U,3)
SET LRINFW=$SELECT($DATA(^(.091)):$PIECE(^(.091),U),1:"")
+1 Begin DoDot:1
+2 ; Protect these variables, used in loop below.
NEW LRRB,LRLLOC,I
+3 DO PT^LRX
End DoDot:1
+4 ;multidivison
IF $DATA(LRMULTI)
IF $DATA(LRDIV)
SET LRDIVLOC=$SELECT($DATA(^LR(LRDFN,.2)):^(.2),1:"")
IF LRDIVLOC
IF $PIECE($GET(^SC(LRDIVLOC,0)),U,4)'=LRDIV
QUIT
+5 SET LRSN=0
+6 FOR
SET LRSN=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN))
IF LRSN<1
QUIT
SET LRTJ=^(LRSN)
IF LRLL=1
DO L5
IF LRLL=2
DO B5
+7 QUIT
+8 ;
L5 SET LRTVOL=0
SET LRTOP=$PIECE(^LAB(62,+LRTJ,0),U,3)
SET LRURG=$SELECT($DATA(^LAB(62.05,+$PIECE(LRTJ,U,2),0)):$PIECE(^(0),U),1:"ROUTINE")
SET LRODT=$PIECE(LRTJ,U,3)
+1 SET LRAA=0
+2 FOR
SET LRAA=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA))
IF LRAA<1
QUIT
DO L6
+3 KILL LRBAR
+4 QUIT
+5 ;
L6 SET LRORD=$SELECT($DATA(^LRO(69,LRODT,1,LRSN,.1)):^(.1),1:"")
SET LRAD=$PIECE(^LRO(68,LRAA,0),U,3)
SET LRAD=$SELECT(LRAD="Y":$EXTRACT(DT,1,3)_"0000","D"[LRAD:DT,"M"[LRAD:$EXTRACT(DT,1,5)_"00","Q"[LRAD:$EXTRACT(DT,1,3)_"0000"+(($EXTRACT(DT,4,5)-1)\3*300+100),1:DT)
+1 ;I LRORD'=LRPORD S LRPORD=LRORD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " INF WARN: ",LRINFW W ?45,SSN,?60,"Order #: ",LRORD
+2 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+3 ; I LRORD'=LRPORD S LRPORD=LRORD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " INF WARN: ",LRINFW W ?45,HRCN,?60,"Order #: ",LRORD ;IHS/ANMC/CLS 08/18/96
+4 ;IHS/MSC/MKK - LR*5.2*1039
IF LRORD'=LRPORD
SET LRPORD=LRORD
WRITE !!?5,$SELECT(LRRB=0:"",1:LRRB),?15,$EXTRACT(PNM,1,28)
IF $LENGTH(LRINFW)
WRITE " INF WARN: ",LRINFW
WRITE ?45,HRCN,?57,"Order #: ",LRORD
+5 ;----- END IHS MODIFICATIONS
+6 SET LRWLEC=0
SET LRAN=0
FOR
SET LRAN=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN))
IF LRAN<1
QUIT
SET LRWLEC=LRWLEC+1
IF LRWLEC>1
WRITE !!
SET LRACC=$SELECT($DATA(^LRO(68,LRAA,1,LRAD,1,LRAN,.2)):^(.2),1:"")
SET LRTVOL=0
DO REM
DO L7
+7 QUIT
L7 SET T=0
FOR
SET T=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN,T))
IF T<1
QUIT
SET LRTV=^(T)
DO S7
WRITE !,?21,$EXTRACT($PIECE(^LAB(60,+LRTV,0),U),1,20)
IF LRVOL>0
WRITE ?42,$JUSTIFY(LRVOL,6,1),"ML"
+1 WRITE ?52,LRTOP,?65,LRACC
IF LRTVOL>0
WRITE !,?65,$JUSTIFY(LRTVOL,6,1),"ML T"
QUIT
S7 SET LRVOL=0
SET LRSSP=0
+1 FOR
SET LRSSP=$ORDER(^LAB(60,+LRTV,3,LRSSP))
IF LRSSP<1
QUIT
IF +LRTJ=+^(LRSSP,0)
SET LRVOL=$PIECE(^(0),U,4)
SET LRTVOL=LRTVOL+LRVOL
QUIT
+2 QUIT
+3 ;
B5 SET LRODT=$PIECE(LRTJ,U,3)
+1 IF $DATA(^LRO(69,LRODT,1,LRSN,0))[0
QUIT
+2 SET LRAA=0
+3 FOR
SET LRAA=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA))
IF LRAA<1
QUIT
Begin DoDot:1
+4 ; Get lab routine to use
DO LBLTYP^LRLABLD
+5 DO LRBAR^LRLABLD
+6 DO B6
End DoDot:1
+7 KILL LRBAR
+8 QUIT
+9 ;
B6 IF $PIECE(^LRO(68,LRAA,0),U,12)
QUIT
SET LRAD=$PIECE(^(0),U,3)
SET LRAD=$SELECT(LRAD="Y":$EXTRACT(DT,1,3)_"0000","D"[LRAD:DT,"M"[LRAD:$EXTRACT(DT,1,5)_"00","Q"[LRAD:$EXTRACT(DT,1,3)_"0000"+(($EXTRACT(DT,4,5)-1)\3*300+100),1:DT)
+1 SET LRAN=0
+2 FOR
SET LRAN=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN))
IF LRAN<1
QUIT
DO B7
+3 QUIT
+4 ;
B7 IF $LENGTH($GET(LRRB))
SET LRRBX=LRRB
+1 SET LRACC=$SELECT($DATA(^LRO(68,LRAA,1,LRAD,1,LRAN,.2)):^(.2),1:"")
IF LRACC']""
QUIT
SET LRCE=^(.1)
+2 DO GO^LRLABLD
+3 IF $DATA(LRRBX)
SET LRRB=LRRBX
KILL LRRBX
+4 QUIT
+5 ;
LRTOP IF $DATA(^LRO(68,LRAA,1,LRLBLD,1,LRAN,5,1,0))
SET LRTOP=+^(0)
SET LRTOP=$SELECT($DATA(^LAB(61,LRTOP,0)):$PIECE(^(0),U),1:"")
QUIT
+1 QUIT
+2 ;
HEAD SET N=$PIECE(^LAB(69.9,1,5),"^",15)
WRITE @IOF,!!,?34,"COLLECTION LIST ",LRDT0,!,?34,N,$SELECT(N=1:"ST",N=2:"ND",N=3:"RD",1:"TH")," PRINTING"
+1 ;W !,"Ward",!,?5,"Bed",?15,"Name",?45,"SSN",?65,"Accession",!,LRLLOC
+2 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+3 ;IHS/ANMC/CLS 08/18/96
WRITE !,"Ward",!,?5,"Bed",?15,"Name",?45,"HRCN",?65,"Accession",!,LRLLOC
+4 ;----- END IHS MODIFICATIONS
+5 QUIT
+6 ;
REM SET LREM=0
SET T=0
FOR
SET T=$ORDER(^LRO(69.1,"LRPH",1,LRLLOC,LRRB,LRDFN,LRSN,LRAA,LRAN,T))
IF T<1
QUIT
SET LREM=LREM+2
+1 ;I $Y>(IOSL-LREM-4) D HEAD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " PT INFO : ",LRINFW W ?45,SSN,?60,"Order #: ",LRORD,!
+2 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+3 ; I $Y>(IOSL-LREM-4) D HEAD W !!?5,$S(LRRB=0:"",1:LRRB),?15,$E(PNM,1,28) W:$L(LRINFW) " PT INFO : ",LRINFW W ?45,HRCN,?60,"Order #: ",LRORD,! ;IHS/ANMC/CLS 08/18/96
+4 ;IHS/MSC/MKK - LR*5.2*1039
IF $Y>(IOSL-LREM-4)
DO HEAD
WRITE !!?5,$SELECT(LRRB=0:"",1:LRRB),?15,$EXTRACT(PNM,1,28)
IF $LENGTH(LRINFW)
WRITE " PT INFO : ",LRINFW
WRITE ?45,HRCN,?57,"Order #: ",LRORD,!
+5 ;----- END IHS MODIFICATIONS
+6 QUIT
+7 ;
WARDHD ;
+1 NEW LRAA,LRACC,LRAD,LRAN,LRBAR,LRBARID,LRCE,LRDAT,LRINFW,LRPREF,LRRB,LRTOP,LRTS,LRUID,LRURG0,LRURGA,LRXL
+2 ;N I,N,PNM,SSN
+3 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
+4 NEW I,N,SSN,HRCN
+5 IF '$DATA(LRLLOC)#2
QUIT
+6 SET PNM=LRLLOC
SET LRDAT="XX/XX/XX"
SET SSN="XXX-XX-XXXX"
SET LRACC=LRLLOC
SET HRCN="XXXXXX"
+7 SET (LRAA,LRAD)=0
SET LRAN="0000"
SET LRCE="000"
+8 SET LRRB=1
SET LRPREF="XXXXX"
SET LRTOP=" "
SET LRTS(1)="DON'T USE"
SET LRTS(2)="NEW LOCATION"
+9 SET LRURG0=9
+10 ; Get lab routine to use
DO LBLTYP^LRLABLD
+11 DO LRBAR^LRLABLD
+12 DO UID^LRLABLD
DO BARID^LRLABLD
+13 SET LRURGA=$$URGA^LRLABLD(LRURG0)
+14 SET LRINFW=" "
SET I=1
SET N=1
SET LRXL=0
+15 DO @LRLABEL
+16 QUIT