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

BLRSLTLR.m

Go to the documentation of this file.
BLRSLTLR ; IHS/DIR/FJE - SET IHS LAB TRANSACTION LOG ;  [ 11/04/1999  9:21 AM ]
 ;;5.2;BLR;**1008,1009**;AUG 1, 1999
 I BLROPT1="MICRO" S BLROPT1="" D ^BLRMLTL Q
 I BLROPT1="BBANK" S BLROPT1="" D ^BLRBLTL Q
 I BLROPT1="BYPASS" S BLRCMF="C",BLRTEST=$G(LRTY,LRTNUM),BLRODT=LRODT,BLRSEQ=LRSN D ^BLRSLTL1 S BLRCMF="M",BLRPHASE="R" D RES Q
 I BLROPT1="ACCORD" D  Q
 .I $D(LRTNUM) S BLRTEST=LRTNUM,BLRCMF="M",BLRODT=LRODT,BLRSEQ=LRSN D ^BLRSLTL1 S BLRPHASE="R" D RES Q
 .D RES Q
 D RES Q
 Q
 ;
RES ;
 S:$D(LRACC)'=0 BLRACCN=LRACC S:$D(LRACC)=0 BLRACCN=^LRO(68,LRAA,1,LRAD,1,LRAN,.2) S BLRCMP=$P($G(^LRO(68,LRAA,1,LRAD,1,LRAN,3)),U,4)'=""
 S BLRDN="" F  S BLRDN=$O(LRSB(BLRDN)) Q:BLRDN=""  S BLRCREF=LRSS_";"_BLRDN_";1",BLRTEST1=$O(^LAB(60,"C",BLRCREF,"")) I BLRTEST1'="",$D(^BLRTXLOG("AAT",BLRACCN,BLRTEST1)) D
 .S BLRRES=$P(LRSB(BLRDN),U,1),BLRNAF=$P(LRSB(BLRDN),U,2) D RES1
 D SETPRNT
 Q
 ;
RES1 ;
 S BLRSEQ=$O(^BLRTXLOG("AAT",BLRACCN,BLRTEST1,""),-1) I BLRSEQ'="" S BLRDEL=$G(^BLRTXLOG(BLRSEQ,1)),BLRDEL=$P(BLRDEL,U,2)="D" Q:BLRDEL   ;;**NEW
 S BLRSPEC=$G(LRSPEC)
 S:BLRSPEC'="" BLRZ=$G(^LAB(60,BLRTEST1,1,BLRSPEC,0))
 S BLRRL=$P(BLRZ,U,2),BLRRH=$P(BLRZ,U,3)
 X:BLRRH'?.N "S BLRRH="_BLRRH
 X:BLRRL'?.N "S BLRRL="_BLRRL
 S BLRSTR="SEQUENCE NUMBER_$$GETIEN(BLRACCN,BLRTEST1)~STATUS FLAG_BLRPHASE~"
 S BLRSTR=BLRSTR_"REFERENCE HIGH_BLRRH~REFERENCE LOW_BLRRL~RESULT_BLRRES~RESULT N/A FLAG_BLRNAF"
 D ^BLRFLTL("M",BLRSTR)
 Q
 ;
SETPRNT ;
 ;S BLRLSEQ=9999999,BLRHSEQ=0
 ;S BLRLTST=0 F  S BLRLTST=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST)) Q:BLRLTST=""  S BLRSEQ=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST,""),-1) I BLRSEQ'="" S:BLRSEQ<BLRLSEQ BLRLSEQ=BLRSEQ S:BLRSEQ>BLRHSEQ BLRHSEQ=BLRSEQ
 ;F BLRSEQ=BLRHSEQ:-1:BLRLSEQ S BLRDEL=$G(^BLRTXLOG(BLRSEQ,1)),BLRPAR=$P(BLRDEL,U),BLRDEL=$P(BLRDEL,U,2)="D" S:BLRPAR'="" BLRPAR(BLRPAR)=$G(BLRPAR(BLRPAR)) D
 ;S BLRLTST=0 F  S BLRLTST=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST)) Q:BLRLTST=""  S BLRSEQ=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST,""),-1) S:BLRSEQ'="" BLRANSEQ(BLRSEQ)=""  ;IHS/DIR/MJL 02/12/98
 S:'$D(BLRCDT) BLRCDT=LRCDT
 ;S BLRLTST=0 F  S BLRLTST=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST)) Q:BLRLTST=""  S BLRSEQ=$O(^BLRTXLOG("AAT",BLRACCN,BLRLTST,""),-1) I BLRSEQ'="",$P(^BLRTXLOG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