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

BLRSLTLD.m

Go to the documentation of this file.
BLRSLTLD ; IHS/DIR/FJE - SET IHS LAB TRANSACTION LOG ; [ 10/05/1999  8:47 AM ]
 ;;5.2;BLR;**1009**;OCT 01, 1999
 S BLRFLG="D"
 I BLROPT1="DELORD" D  Q
 .S BLRPHASE="O",BLRODTM=$P(LROD0,U,5)
 .I BLRPARAM["TESTS" S BLRLRSN=+T(J),BLRTEST=$P(T(J),U,3) D DELTST Q
 .S BLRII="" F  S BLRII=$O(T(BLRII)) Q:BLRII=""  S BLRLRSN=+T(BLRII),BLRTEST=$P(T(BLRII),U,3) D DELTST
 I BLROPT1="DELACC" S BLRPHASE="A",BLRACCN=^LRO(68,LRAA,1,LRAD,1,LRAN,.2),BLRTEST=LRTSTS D DELTST Q
 I BLROPT1="REMACC" S BLRTST="" F  S BLRTST=$O(^BLRTXLOG("AAT",BLRACCN,BLRTST)) Q:BLRTST=""  S BLRSTR="SEQUENCE NUMBER_$$GETIEN(BLRACCN,BLRTST)~STATUS FLAG_BLRFLG" D ^BLRFLTL("M",BLRSTR)
 Q
 ;
DELTST ;
 S BLRLEV=1,BLRTEST1=BLRTEST,BLRLEV(1)=BLRTEST D DELTST2 F  D DELTST1 Q:'BLRLEV
 Q
 ;
DELTST1 ;
 S BLRATOM=$O(^LAB(60,BLRLEV(BLRLEV),2,0))="" I BLRATOM,BLRLEV=1 S BLRLEV=0 Q
 S:'BLRATOM BLRLEV=BLRLEV+1 S BLRLEV(BLRLEV,0)=$O(^LAB(60,BLRLEV(BLRLEV-1),2,+$G(BLRLEV(BLRLEV,0))))
 I BLRLEV(BLRLEV,0) S BLRTEST1=$P(^LAB(60,BLRLEV(BLRLEV-1),2,$G(BLRLEV(BLRLEV,0),0),0),U),BLRLEV(BLRLEV)=BLRTEST1 D DELTST2 Q  ;IHS/DIR/MJL 09/22/99
 S BLRLEV(BLRLEV,0)=0,BLRLEV=BLRLEV-2
 Q
 ;
DELTST2 ;
 I BLRPHASE="O",'$D(^BLRTXLOG("AOT",BLRODTM,BLRLRSN,BLRTEST1)) D CHGDATE Q
 S BLRSTR="SEQUENCE NUMBER_$$GETIEN("_$S(BLRPHASE="O":"BLRODTM,BLRLRSN,BLRTEST1",1:"BLRACCN,BLRTEST1")_")~STATUS FLAG_BLRFLG" D ^BLRFLTL("M",BLRSTR)
 Q
 ;
CHGDATE ;
 S BLRDT=BLRODTM,BLRQ=0 F  S BLRDT=$O(^BLRTXLOG("AOT",BLRDT),-1) Q:(BLRDT=""!(BLRQ))  I $D(^BLRTXLOG("AOT",BLRDT,BLRLRSN,BLRTEST1)) D GETDATE
 K BLRQ
 Q
GETDATE ;
 S BLRXSEQ=$O(^BLRTXLOG("AOT",BLRDT,BLRLRSN,BLRTEST1,""),-1)
 Q:$P(^BLRTXLOG(BLRXSEQ,0),U,3)'=$G(LRDFN)
 Q:$P(^BLRTXLOG(BLRXSEQ,11),U,3)'=$G(LRORD)
 S BLRSTR="SEQUENCE NUMBER_$$GETIEN(BLRDT,BLRLRSN,BLRTEST1)~STATUS FLAG_BLRFLG" D ^BLRFLTL("M",BLRSTR) S BLRQ=1
 Q