Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: BLRAG05B

BLRAG05B.m

Go to the documentation of this file.
BLRAG05B ; IHS/MSC/SAT - LABORATORY ACCESSION GUI RPCS ;
 ;;5.2;IHS LABORATORY;**1031**;NOV 01, 1997;Build 185
EP ; EP
 N BLRLOG1
 N LRPWL,LRPWDT,LRPWLE
 D DT^LRX
 Q:$G(LRKIL)
 ;D:$D(XRTL) T0^%ZOSV ; START RESPONSE TIME LOGGING
 ; S LRCDT=+^LRO(69,LRODT,1,LRSN,1),LREAL=$P(^(1),U,2),X=^(0),LRLLOC=$P(X,U,7),LROLLOC=$P(X,U,9),LRORIFN=$P(X,"^",11)
 ; ----- BEGIN IHS/OIT/MKK -- LR*5.2*1025 MODIFICATIONS
 ;      Need to remove the naked references because they are causing
 ;      <UNDEFINED> errors at numerous IHS sites.
 S LRCDT=+$G(^LRO(69,LRODT,1,LRSN,1))
 S LREAL=$P($G(^LRO(69,LRODT,1,LRSN,1)),U,2)
 S X=$G(^LRO(69,LRODT,1,LRSN,0))
 S LRLLOC=$P(X,U,7)
 S LROLLOC=$P(X,U,9)
 S LRORIFN=$P(X,"^",11)
 ; ----- END IHS/OIT/MKK -- LR*5.2*1025 MODIFICATIONS
 D LRAA
 Q:BLREF
 ;
 S BLRLOG1=BLRLOG,BLRLOG=1
 S BLROPT1=BLROPT,BLROPT="ADDACC"
 S:LRCDT<1 LRCDT=$$NOW^XLFDT
 ;
 S:$G(MSCRLCLA)="" MSCRLCLA=$G(BLRRLCLA)
 D ^LRWLST1
 S BLRRLCLA=MSCRLCLA
 ;
 S BLRLOG=BLRLOG1
 S BLROPT=BLROPT1
 ;
 S LRCDT=(+LRCDT)_"^"_LREAL
 N BLR69DT,BLR69SP,BLR69TS,BLRMSCDT
 S BLR69DT=$P($P($P(BLRTSTL,U,BLRJ),"|",1),":",1)
 S BLR69SP=$P($P($P(BLRTSTL,U,BLRJ),"|",1),":",2)
 S BLR69TS=$P($P($P(BLRTSTL,U,BLRJ),"|",1),":",3)
 S BLRMSCDT=+$P($G(^LRO(69,BLR69DT,1,BLR69SP,2,BLR69TS,0)),U,3) S:BLRMSCDT'=0 ^LRO(69,"AFMSC",BLRMSCDT,BLR69DT_"|"_BLR69SP_"|"_BLR69TS)=""
 S:BLRRLCLA $P(^LRO(69,BLR69DT,1,BLR69SP,2,BLR69TS,"MSC"),U,1)=BLRRLCLA
 ;
 I '$L($P($G(^LRO(69,LRODT,1,LRSN,1)),"^",7)) S CONTROL=$S($L(LRORIFN):"SC",1:"SN") D NEW^LR7OB1(LRODT,LRSN,CONTROL,,,6)
 K LRTSTS,^TMP("BLR",$J,"TMP"),LRNM,DIC,I,LRORIFN,LRBACK
 ;I $D(XRT0) S XRTN=$T(+0) D T1^%ZOSV ; STOP RESPONSE TIME LOGGING
 Q
LRAA ;
 K LRTSTS,^TMP("BLR",$J,"TMP")
 S LRTSTS=0,LRIX=0,S5=0,LRTN=0
 S LRTN=BLRTST
 S X=^LRO(69,LRODT,1,LRSN,2,LRTN,0)
 I '$P(X,U,3),'$P(X,U,6),'$P(X,U,8),'$P(X,U,11) D
 .S LRORIFN=$P(X,"^",7),LRBACK=$P(X,"^",14)
 .D OR,SET ;OE/RR 2.5 can remove call to OR after 3.0
 E  I LRTN=BLRTST D
 .; S BLR60NAM=$$GET1^DIQ(60,$P(X,U,1)_",",.01)
 .S BLR60NAM=$$TESTNAME^BLRAGUT(+$P(X,U,1))
 .S:$P(X,U,3) BLRRET="BLRAG05B: This Test has previously been accessioned: "_BLR60NAM,BLREF=1
 .S:$P(X,U,6) BLRRET="BLRAG05B: This test has been 'Combined On Order': "_BLR60NAM,BLREF=1
 .S:$P(X,U,8) BLRRET="BLRAG05B: Panel has no accession area and has been exploded and accessioned: "_BLR60NAM,BLREF=1
 .S:$P(X,U,11) BLRRET="BLRAG05B: This test has been Canceled: "_BLR60NAM,BLREF=1
WL1 ;
 S LRIX=$O(^TMP("BLR",$J,"TMP",LRIX)) Q:LRIX<1  S X=^TMP("BLR",$J,"TMP",LRIX) S LRTSTS=+X,LRURG=$P(X,"^",2),LRORIFN=$P(X,"^",4),LRBACK=$P(X,"^",5)
 S LRST=^LAB(60,LRTSTS,0),LRAA=$S($D(^LAB(60,LRTSTS,8,$S($D(LRDUZ(2)):LRDUZ(2),1:DUZ(2)),0)):$P(^(0),U,2),1:""),LRNM=$P(LRST,U),LRUNQ=+$P(LRST,U,7)
 D WL2
 G WL1
WL2 ;
 D FWL:LRAA="" Q:LRAA=""
 S LRWL0=^LRO(68,LRAA,0),LRSS=$P(LRWL0,U,2),LRIDIV=$S($L($P(LRWL0,U,19)):$P(LRWL0,U,19),1:"CP")
 I '$D(LRPHSET),$D(LRNCWL) S X="Y" Q:X="^"  IF X["N" S LRAA="" G WL2
 ;added following line to support unique ID/DALISC/JRR
 I $P($G(^LRO(68,LRAA,.4)),U)="" D  S LRAA="" Q
 . S BLRRET="BLRAG05B: You must enter a 'Numeric Identifier' in field .4 of the Accession file. "_"Accession Area "_$P($G(^LRO(68,+$G(LRAA),0)),U)
 . ;W:'$D(LRPHSET) !!?5,"You must enter a 'Numeric Identifier' in field .4 of the Accession file!!",!?10,"Accession Area ",$P($G(^LRO(68,+$G(LRAA),0)),U),!
 . S BLREF=1
 . D UNDO
 S LRPWL=$P($G(^LRO(68,LRAA,0)),U,4)
 I LRPWL,$P($G(^LRO(68,LRPWL,.4)),U)="" D  S LRAA="" Q
 . S BLRRET="BLRAG05B: You must enter a 'Numeric Identifier' in field .4 of the Accession file. "_"COMMON Accession Area "_$P($G(^LRO(68,+$G(LRPWL),0)),U)
 . ;W:'$D(LRPHSET) !!?5,"You must enter a 'Numeric Identifier' in field .4 of the Accession file!!"
 . ;W !?10,"COMMON Accession Area ",$P($G(^LRO(68,+$G(LRPWL),0)),U),!
 . D UNDO
 ;
 S LRWLC=$P(LRWL0,U,4)
 S:'LRWLC LRWLC=LRAA
 S LRTSTS(LRWLC,LRUNQ,LRAA)=LRSS_U_$P(LRWL0,U,12),LRTSTS(LRWLC,LRUNQ,LRAA,LRIX)=^TMP("BLR",$J,"TMP",LRIX)
 Q
SET ;
 S S5=S5+1,I5=$G(^LRO(69,LRODT,1,LRSN,2,LRTN,0))
 I I5 S ^TMP("BLR",$J,"TMP",S5)=$P(I5,U)_U_$P(I5,U,2)_U_LRTN_U_LRORIFN_U_LRBACK_U_$S($G(LRTSP):LRTSP,1:$P(I5,U)),I5=LRTN
 Q
FWL ;
 I $O(^LAB(60,LRTSTS,2,0))>0 D EXP S $P(^LRO(69,LRODT,1,LRSN,2,$P(^TMP("BLR",$J,"TMP",LRIX),U,3),0),U,8)=1 Q
 I '$D(LRNCWL),$D(LRPHSET),LRPHSET S BLRRET="BLRAG05B: NO ACCESSION AREA FOR ORDER NUMBER "_^LRO(69,LRODT,1,LRSN,.1)_" TEST "_$P(^LAB(60,LRTSTS,0),U) S BLREF=1 D UNDO Q
 ;I '$D(LRNCWL),$D(LRPHSET),LRPHSET W !,"NO ACCESSION AREA FOR ORDER NUMBER ",^LRO(69,LRODT,1,LRSN,.1)," TEST ",$P(^LAB(60,LRTSTS,0),U),! D UNDO Q
 I '$D(LRNCWL) S BLRRET="BLRAG05B: "_LRNM_" does not have an appropriate accession area."_"ORDER # "_LRORD_" IS NOT ACCESSIONED" S BLREF=1 S LRAA="" D UNDO Q
 ;I '$D(LRNCWL) W !,LRNM," does not have an appropriate accession area.",!,"ORDER # ",LRORD," IS NOT ACCESSIONED",! S LRAA="" D UNDO Q
 ;
 ;W !,"For test: ",LRNM
 K DIC
 S DIC("S")="I '$L($P(^(0),U,17))",DIC="^LRO(68,",DIC(0)="FOZ"
 D ^DIC
 K DIC
 I $D(DUOUT) S LRAA="" Q
 G:Y<1 FWL
 S LRAA=+Y
 Q
EXP ;
 S I=0
 F  S I=$O(^LAB(60,LRTSTS,2,I)) Q:I<1  S J=+^(I,0) I $D(^LAB(60,J,8,DUZ(2),0)) S S5=S5+1,I5=I5+1,^TMP("BLR",$J,"TMP",S5)=J_"^"_LRURG_"^"_I5_"^"_LRORIFN_"^"_LRBACK_"^"_$S($G(LRTSP):LRTSP,1:LRTSTS)
 Q
PRESET ; not used by GUI
 Q
PR2 ; not used by GUI
 Q
 S LRNIDT=9999999-LRCDT
 IF $D(^LR(LRDFN,LRSS,LRNIDT,0)) S LRCDT=LRCDT+.00001 G PR2
 I $P(^LR(LROLRDFN,LRSS,LRIDT,0),U,3) S LREND=1 S BLRRET="BLRAG05B: CAN'T DO IT.  The data has been verified for that log number." S BLREF=1 Q
 S ^LR(LRDFN,LRSS,LRNIDT,0)=LRCDT_U_LREAL_U_$P(^LR(LROLRDFN,LRSS,LRIDT,0),U,3,4)_U_U_$P(^(0),U,6,99)
 S J=0 F  S J=$O(^LR(LROLRDFN,LRSS,LRIDT,J)) Q:J<1  S ^LR(LRDFN,LRSS,LRNIDT,J)=^LR(LROLRDFN,LRSS,LRIDT,J)
 S X=^LRO(68,LRAA,1,LRAD,1,LRAN,0),LROSN=$P(X,U,5),LROID=$P(X,U,6),LROCN=$S($D(^(.1)):$P(^(.1),U),1:"")
 K:$L(LROID) ^LRO(68,LRAA,1,LRAD,1,"C",LROID,LRAN)
 K:$L(LROCN) ^LRO(68,LRAA,1,LRAD,1,"D",LROCN,LRAN)
 K ^LRO(68,LRAA,1,LRAD,1,LRAN),^LR(LROLRDFN,LRSS,LRIDT)
 Q
YN ;
 Q
UNDO ;Clean up ^LRO(69
 N X,TST
 S LRIFN=+$O(^LRO(69,LRODT,1,LRSN,2,"B",LRTSTS,0))  Q:LRIFN<1
 S $P(^LRO(69,LRODT,1,LRSN,1),U,4)="U",$P(^(1),U,6)=LRNM_" NOT ACCESSIONED - TEST DEFINITION INCOMPLETE"
 S X=$G(^LRO(69,LRODT,1,LRSN,2,LRIFN,0)) Q:'X  S TST(+X)=""
 S X=$S($D(^LRO(69,LRODT,1,LRSN,2,LRIFN,1.1,0)):$P(^(0),"^",3),1:0)+1,^(0)="^^"_X_"^"_X_"^"_DT,^(X,0)="Not accessioned - Test definition incomplete"
 D NEW^LR7OB1(LRODT,LRSN,"OC",,.TST)
 S BLRMSCDT=$P(^LRO(69,LRODT,1,LRSN,2,LRIFN,0),"^",3)
 S $P(^LRO(69,LRODT,1,LRSN,2,LRIFN,0),"^",3,6)="^^^",$P(^(0),"^",9,11)="CA^L^"_DUZ
 K:$G(BLRMSCDT)'="" ^LRO(69,"AFMSC",BLRMSCDT,LRODT_"|"_LRSN_"|"_LRIFN)
 Q
OR ;from LRPHITEM
 I $G(LRORDRR)="R" S LRTEST(LRTN)=$G(^LRO(69,LRODT,1,LRSN,2,LRTN,0)) Q
 ;IHS/ITSC/TPF TESTING ; SET LRSAMP AND LRSPEC EVEN IF OE/RR 3 IS IN NEEDED FOR IHS MODS
 I $$VER^LR7OU1>2.5 S LRI=LRTN,LRORD=+^LRO(69,LRODT,1,LRSN,.1),LRLWC=$P(^(0),"^",4),LRSAMP=$P(^(0),"^",3),LRSPEC=$S($O(^(4,0))'="":$P(^($O(^(0)),0),"^"),1:""),LRTEST(LRI)=^LRO(69,LRODT,1,LRSN,2,LRTN,0) Q
 ;I 'LRORIFN S LRI=LRTN,LRORD=+^LRO(69,LRODT,1,LRSN,.1),LRLWC=$P(^(0),"^",4),LRSAMP=$P(^(0),"^",3),LRSPEC=$S($O(^(4,0))'="":$P(^($O(^(0)),0),"^"),1:""),LRTEST(LRI)=^LRO(69,LRODT,1,LRSN,2,LRTN,0) D SET^LROR
 ;BEGIN IHS MODIFCATION LR*5.2*1018 FIXED DURING ALPHA IHS/ITSC/TPF 2/10/2004
 ;RESTORE ABOVE LINE. IT WAS INCORRECTLY COMMENTED OUT
 ;FOUND BECAUSE SPECIMEN WAS NOT PROPERLY DEFINED FOR MICROS
 ;RECEIVED MAIL MESSAGES FOR 'INCORRECT PROVIDER. ALSO DEFAULT PROMPT AT RESULTING USING
 ;RE WAS 0
 I 'LRORIFN S LRI=LRTN,LRORD=+^LRO(69,LRODT,1,LRSN,.1),LRLWC=$P(^(0),"^",4),LRSAMP=$P(^(0),"^",3),LRSPEC=$S($O(^(4,0))'="":$P(^($O(^(0)),0),"^"),1:""),LRTEST(LRI)=^LRO(69,LRODT,1,LRSN,2,LRTN,0) D SET^LROR
 ;BEGIN IHS MODIFCATION LR*5.2*1018 FIXED DURING ALPHA IHS/ITSC/TPF 2/10/2004
 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1018
 ;RESTORE CALL TO ORX
 I LRORIFN S ORIFN=LRORIFN,ORSTS=6 D ST^ORX K ORSTS,ORIFN
 ;----- BEGIN IHS MODIFICATION LR*5.2*1018 MAY NOT NEED
 ;I LRORIFN S ORIFN=LRORIFN,ORSTS=6 K ORSTS,ORIFN  ;IHS/DIR TUC/AAB 06/15/98
 ;----- END IHS MODIFICATION
 Q