LRMIBL ;AVAMC/REG - BATCH ORDERING/ACCESSION LOGING ; 8/25/87 08:37 ;
;;5.2;LAB SERVICE;**121,153**;Sep 27, 1994
;from option LRMIBL
BEGIN S LRBLEND=0 D BLOG
END K %,A,DFN,DIC,DQ,DX,H8,J,K,L,LRAA,LRACC,LRAC,LRAN,LRBLEND,LRCCOM,LRCDT,LRCOM,LRCSN,LRDFN,LRDPF,LREAL,LREND,LREXP,LRIDT,LRIN,LRIX,LRLBLBP,LRLLOC,LRM,LRNT,LRORD,LROU,LROUTINE,LRPR,LRPRAC,LRRB,LRSN,LRSSP,LRSSX,LRST,LRSUM,LRSXN,LRTS,LRTSTNM
K LRUNQ,LRWLC,LRWP,LRYR,PNM,S,SSN,X,X1,Y,Z,LRFIRST,DIC,LRSAME,LRSAMP,LRSPEC,LRORDR,LRECT,LRODT,LRURG,LRFLOG,LRCS,LROT,LRTN,LRTOP,LRTP,LRTSTN,LRTY,LRUR,LRUSNM,LRWL0,LRWPC,LRXL,S5
K LRTCOM,%H,%X,%Y,DIWL,DIWR,DO,DPF,I1,I2,I5,LABEL,LRADDTST,LRBED,LRCE,LRCSS,LRDAT,LRDTO,LRECOM,LRINFW,LRLWC,LRMAX,LRNCWL,LRNIDT,LROCN,LROID,LROLRDFN,LRORDER,LRORDTIM,LROSN,LRPHSET,LRPREF,LRSLIP,LRSNO,LRSPCDSC,LRSVSN,LRTEST,LRTJ
K ^TMP("LRSTIK",$J)
Q
BLOG K ^TMP("LRSTIK",$J),DIC,LRURG,LRSAME,LRCOM,LRTCOM S LRORDR="" D DT^LRX W !!," BATCH LOG-IN",!
S LRODT=DT,U="^",LRECT=0,LROUTINE=$P(^LAB(69.9,1,3),U,2)
F W !!,"WANT TO ENTER COLLECTION TIMES" S %=1 D YN^DICN S LRECT=$S(%=2:0,1:1) S:%<0 LRBLEND=1 Q:% W !,"Yes or No"
Q:LRBLEND
G1 S LRWP=0 F D GET Q:LRBLEND
Q
GET S DIC="^LAB(60,",DIC(0)="AEMOQ",DIC("S")="I ""AUSP""'[$P(^(0),U,4)!($P(^(0),U,4)="""")"_$S('$D(^XUSEC("LRLAB",DUZ)):"&(""NO""'[$P(^(0),U,3))",1:"")
D ^DIC K DIC("S") S:Y<1 LRBLEND=1 Q:LRBLEND S LRWP=LRWP+1,^TMP("LRSTIK",$J,LRWP)=$P(Y,U,1,2),^TMP("LRSTIK",$J,"B",LRWP)=LRWP
S LRTSTS=+^TMP("LRSTIK",$J,LRWP) D GS^LRORD3 S:+LRSAMP=-1&(LRSPEC=-1) LRBLEND=1 Q:LRBLEND S ^TMP("LRSTIK",$J,LRWP)=^TMP("LRSTIK",$J,LRWP)_U_LRSAMP_U_U_LRSPEC
G5 S:'$D(^LRO(69,LRODT,0)) ^(0)=$P(^LRO(69,0),U,1,2)_U_LRODT_U_(1+$P(^(0),U,4)),^LRO(69,LRODT,0)=LRODT,^LRO(69,"B",LRODT,LRODT)=""
S LRSSX=LRWP,LRST=0,LRSAMP=$P(^TMP("LRSTIK",$J,LRSSX),U,3),LRSPEC=$P(^TMP("LRSTIK",$J,LRSSX),U,5),LRTSTS=+^TMP("LRSTIK",$J,LRSSX) D Q20,URGG
S LRM=0,PNM="",SSN="" D ENSTIK^LROW3 Q:'$D(LROT) S:'$D(%) LRWP=0 Q:'$D(%) S:%["N" LRBLEND=1 Q:LRBLEND S %X="LROT(",%Y="LROU(" D %XY^%RCR
F D L2 Q:LRBLEND
Q
L2 K LRSAME,LRGCOM,DFN,DIC S PNM="",DIC(0)="EMQ"_$S($P(LRPARAM,U,6)&$D(^XUSEC("LRLAB",DUZ)):"L",1:"") W ! D ^LRDPA I (LRDFN=-1)!$D(DUOUT)!$D(DTOUT) S LRBLEND=1 Q
S LRDPF=$P(^LR(LRDFN,0),U,2),DFN=$P(^(0),U,3)
D LOC^LRWU D:LREND DROP Q:LREND D PRAC^LRWU1 I LREND D DROP Q
D ORDER^LROW2
S II=0
F S II=$O(LROT(II)) Q:II<1 D
. S J=0
. F S J=$O(LROT(II,J)) Q:J<1 D
. . S K=0
. . F S K=$O(LROT(II,J,K)) Q:K<1 S ^LRO(69,LRODT,1,"AB",$S($D(^TMP("LRSTIK",$J,K)):+^TMP("LRSTIK",$J,K),1:+LROT(II,J,K)),J,LRDFN)=""
I LRECT D TIME^LRWU1 I LRCDT<1 D DROP Q
S LRORDTIM=$P($H,",",2)\3600*100+($P($H,",",2)\60#60)/10000,LRNT=LRORDTIM+DT,LRORDTIM=$P(LRORDTIM,".",2) S:'LRECT LRCDT=LRNT_"^1"
S LRIDT=9999999-LRCDT
S %X="LROU(",%Y="LROT(" D %XY^%RCR D ^LRORDST
Q
Q20 D:LRSAMP="" GSS^LRORD3 I (LRSAMP<1)!(LRSPEC<1) W !,"Sample and source incompletely defined, test skipped." K LRSAME Q
S LROT(LRSAMP,LRSPEC,LRSSX)=LRTSTS D:LRST URGG
S LREXP=$S($D(^LAB(60,LRTSTS,3,+LRSAMP,0)):$P(^(0),U,6),$P(^LAB(60,LRTSTS,0),U,19):$P(^(0),U,19),1:0) S:LREXP LROT(LRSAMP,LRSPEC,LRSSX,2)=LREXP
Q
URGG W !,"For ",$P(^TMP("LRSTIK",$J,LRWP),U,2) D URG^LRORD2
Q
DROP W !!,"ORDER CANCELED",$C(7),!!
Q
;LRORDR =TYPE OF ORDER, LRECT =ASK COLECTION TIME
;LRFLOG =ACCESSION TEST GROUP, IF DEFINED ON ENTRY, PRESELECTS GROUP
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HLRMIBL 3381 printed Oct 16, 2024@18:17:41 Page 2
LRMIBL ;AVAMC/REG - BATCH ORDERING/ACCESSION LOGING ; 8/25/87 08:37 ;
+1 ;;5.2;LAB SERVICE;**121,153**;Sep 27, 1994
+2 ;from option LRMIBL
BEGIN SET LRBLEND=0
DO BLOG
END KILL %,A,DFN,DIC,DQ,DX,H8,J,K,L,LRAA,LRACC,LRAC,LRAN,LRBLEND,LRCCOM,LRCDT,LRCOM,LRCSN,LRDFN,LRDPF,LREAL,LREND,LREXP,LRIDT,LRIN,LRIX,LRLBLBP,LRLLOC,LRM,LRNT,LRORD,LROU,LROUTINE,LRPR,LRPRAC,LRRB,LRSN,LRSSP,LRSSX,LRST,LRSUM,LRSXN,LRTS,LRTSTNM
+1 KILL LRUNQ,LRWLC,LRWP,LRYR,PNM,S,SSN,X,X1,Y,Z,LRFIRST,DIC,LRSAME,LRSAMP,LRSPEC,LRORDR,LRECT,LRODT,LRURG,LRFLOG,LRCS,LROT,LRTN,LRTOP,LRTP,LRTSTN,LRTY,LRUR,LRUSNM,LRWL0,LRWPC,LRXL,S5
+2 KILL LRTCOM,%H,%X,%Y,DIWL,DIWR,DO,DPF,I1,I2,I5,LABEL,LRADDTST,LRBED,LRCE,LRCSS,LRDAT,LRDTO,LRECOM,LRINFW,LRLWC,LRMAX,LRNCWL,LRNIDT,LROCN,LROID,LROLRDFN,LRORDER,LRORDTIM,LROSN,LRPHSET,LRPREF,LRSLIP,LRSNO,LRSPCDSC,LRSVSN,LRTEST,LRTJ
+3 KILL ^TMP("LRSTIK",$JOB)
+4 QUIT
BLOG KILL ^TMP("LRSTIK",$JOB),DIC,LRURG,LRSAME,LRCOM,LRTCOM
SET LRORDR=""
DO DT^LRX
WRITE !!," BATCH LOG-IN",!
+1 SET LRODT=DT
SET U="^"
SET LRECT=0
SET LROUTINE=$PIECE(^LAB(69.9,1,3),U,2)
+2 FOR
WRITE !!,"WANT TO ENTER COLLECTION TIMES"
SET %=1
DO YN^DICN
SET LRECT=$SELECT(%=2:0,1:1)
if %<0
SET LRBLEND=1
if %
QUIT
WRITE !,"Yes or No"
+3 if LRBLEND
QUIT
G1 SET LRWP=0
FOR
DO GET
if LRBLEND
QUIT
+1 QUIT
GET SET DIC="^LAB(60,"
SET DIC(0)="AEMOQ"
SET DIC("S")="I ""AUSP""'[$P(^(0),U,4)!($P(^(0),U,4)="""")"_$SELECT('$DATA(^XUSEC("LRLAB",DUZ)):"&(""NO""'[$P(^(0),U,3))",1:"")
+1 DO ^DIC
KILL DIC("S")
if Y<1
SET LRBLEND=1
if LRBLEND
QUIT
SET LRWP=LRWP+1
SET ^TMP("LRSTIK",$JOB,LRWP)=$PIECE(Y,U,1,2)
SET ^TMP("LRSTIK",$JOB,"B",LRWP)=LRWP
+2 SET LRTSTS=+^TMP("LRSTIK",$JOB,LRWP)
DO GS^LRORD3
if +LRSAMP=-1&(LRSPEC=-1)
SET LRBLEND=1
if LRBLEND
QUIT
SET ^TMP("LRSTIK",$JOB,LRWP)=^TMP("LRSTIK",$JOB,LRWP)_U_LRSAMP_U_U_LRSPEC
G5 if '$DATA(^LRO(69,LRODT,0))
SET ^(0)=$PIECE(^LRO(69,0),U,1,2)_U_LRODT_U_(1+$PIECE(^(0),U,4))
SET ^LRO(69,LRODT,0)=LRODT
SET ^LRO(69,"B",LRODT,LRODT)=""
+1 SET LRSSX=LRWP
SET LRST=0
SET LRSAMP=$PIECE(^TMP("LRSTIK",$JOB,LRSSX),U,3)
SET LRSPEC=$PIECE(^TMP("LRSTIK",$JOB,LRSSX),U,5)
SET LRTSTS=+^TMP("LRSTIK",$JOB,LRSSX)
DO Q20
DO URGG
+2 SET LRM=0
SET PNM=""
SET SSN=""
DO ENSTIK^LROW3
if '$DATA(LROT)
QUIT
if '$DATA(%)
SET LRWP=0
if '$DATA(%)
QUIT
if %["N"
SET LRBLEND=1
if LRBLEND
QUIT
SET %X="LROT("
SET %Y="LROU("
DO %XY^%RCR
+3 FOR
DO L2
if LRBLEND
QUIT
+4 QUIT
L2 KILL LRSAME,LRGCOM,DFN,DIC
SET PNM=""
SET DIC(0)="EMQ"_$SELECT($PIECE(LRPARAM,U,6)&$DATA(^XUSEC("LRLAB",DUZ)):"L",1:"")
WRITE !
DO ^LRDPA
IF (LRDFN=-1)!$DATA(DUOUT)!$DATA(DTOUT)
SET LRBLEND=1
QUIT
+1 SET LRDPF=$PIECE(^LR(LRDFN,0),U,2)
SET DFN=$PIECE(^(0),U,3)
+2 DO LOC^LRWU
if LREND
DO DROP
if LREND
QUIT
DO PRAC^LRWU1
IF LREND
DO DROP
QUIT
+3 DO ORDER^LROW2
+4 SET II=0
+5 FOR
SET II=$ORDER(LROT(II))
if II<1
QUIT
Begin DoDot:1
+6 SET J=0
+7 FOR
SET J=$ORDER(LROT(II,J))
if J<1
QUIT
Begin DoDot:2
+8 SET K=0
+9 FOR
SET K=$ORDER(LROT(II,J,K))
if K<1
QUIT
SET ^LRO(69,LRODT,1,"AB",$SELECT($DATA(^TMP("LRSTIK",$JOB,K)):+^TMP("LRSTIK",$JOB,K),1:+LROT(II,J,K)),J,LRDFN)=""
End DoDot:2
End DoDot:1
+10 IF LRECT
DO TIME^LRWU1
IF LRCDT<1
DO DROP
QUIT
+11 SET LRORDTIM=$PIECE($HOROLOG,",",2)\3600*100+($PIECE($HOROLOG,",",2)\60#60)/10000
SET LRNT=LRORDTIM+DT
SET LRORDTIM=$PIECE(LRORDTIM,".",2)
if 'LRECT
SET LRCDT=LRNT_"^1"
+12 SET LRIDT=9999999-LRCDT
+13 SET %X="LROU("
SET %Y="LROT("
DO %XY^%RCR
DO ^LRORDST
+14 QUIT
Q20 if LRSAMP=""
DO GSS^LRORD3
IF (LRSAMP<1)!(LRSPEC<1)
WRITE !,"Sample and source incompletely defined, test skipped."
KILL LRSAME
QUIT
+1 SET LROT(LRSAMP,LRSPEC,LRSSX)=LRTSTS
if LRST
DO URGG
+2 SET LREXP=$SELECT($DATA(^LAB(60,LRTSTS,3,+LRSAMP,0)):$PIECE(^(0),U,6),$PIECE(^LAB(60,LRTSTS,0),U,19):$PIECE(^(0),U,19),1:0)
if LREXP
SET LROT(LRSAMP,LRSPEC,LRSSX,2)=LREXP
+3 QUIT
URGG WRITE !,"For ",$PIECE(^TMP("LRSTIK",$JOB,LRWP),U,2)
DO URG^LRORD2
+1 QUIT
DROP WRITE !!,"ORDER CANCELED",$CHAR(7),!!
+1 QUIT
+2 ;LRORDR =TYPE OF ORDER, LRECT =ASK COLECTION TIME
+3 ;LRFLOG =ACCESSION TEST GROUP, IF DEFINED ON ENTRY, PRESELECTS GROUP