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

BLRFLTL.m

Go to the documentation of this file.
BLRFLTL(BLRCMF,BLRVARS,BLRFLDS) ; IHS/DIR/MJL - SILENT DIE CALLS TO UPDATE TRANSACTION LOG ; 22-Oct-2013 09:22 ; MKK
 ;;5.2;LR;**1001,1003,1006,1007,1008,1009,1021,1027,1033**;NOV 01, 1997
 ;
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER ^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER ^BLRFLTL")     ; IHS/OIT/MKK - LR*5.2*1033
 S U="^",BLRFID=9009022,BLRERR=0,BLRICNT=0 S:BLRCMF="C" BLRICNT=1  ;IHS/OIRM TUC/MJL 2/10/98
 D SETVALS
 I 'BLRERR S:'BLRPCC BLRFDA(BLRFID,BLRIEN,BLRF(0,"PCC ERROR FLAG"))="PCC LINK DISABLED" D FILE
 I BLRPCC,'$D(BLRERF),'BLRERR D LOG
 ;D:BLRERR BULERR
 I '(+$G(BLRDTER)),BLRERR D BULERR  ;IHS/DIR TUC/AAB 05/18/98
 D KILL
 Q
 ;
SETVALS ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER SETVALS^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER SETVALS^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 F BLRI=1:1:$L(BLRVARS,"~") S BLRARRAY=0,BLRVRS=$P(BLRVARS,"~",BLRI),BLRVR=$P(BLRVRS,"_",1),BLRVL=$P(BLRVRS,"_",2) D  Q:BLRERR  I 'BLRARRAY,$D(BLRF(0,BLRVR)),BLR(BLRVR)'="" S BLRFDA(BLRFID,BLRIEN,BLRF(0,BLRVR))=BLR(BLRVR)
 .I $E(BLRVR)'="@" D  Q
 ..I BLRVL?.N S BLR(BLRVR)=BLRVL Q
 ..I BLRVL?1"""".E1"""" S BLR(BLRVR)=$E(BLRVL,2,$L(BLRVL)-1) Q
 ..I $E(BLRVL)=U S BLR(BLRVR)=@BLRVL Q
 ..I BLRVL?1U.UN D  Q
 ...I '$D(BLRF(0,BLRVR,"TYPE")) S BLR(BLRVR)=@BLRVL Q
 ...S BLRARRAY=1
 ...I BLRF(0,BLRVR,"TYPE")="M" D MULTI Q
 ...D WORD Q
 ..X "S BLR(BLRVR)="_BLRVL Q
 .S BLRVR=$P(BLRVR,"@",2)
 .I BLRVL?.N S @BLRVR=BLRVL Q
 .I BLRVL?1"""".E1"""" S @BLRVR=$E(BLRVL,2,$L(BLRVL)-1) Q
 .I $E(BLRVL)=U S @BLRVR=@BLRVL Q
 .I BLRVL?1U.UN S @BLRVR=@BLRVL Q
 .X "S @BLRVR="_BLRVL Q
 Q
 ;
MULTI ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER MULTI^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER MULTI^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 I BLRCMF="M",BLRVR="COMMENTS" S BLRMI="" F  S BLRMI=$O(^BLRTXLOG(BLRENT,30,BLRMI)) Q:BLRMI=""  S DA=BLRMI,DA(1)=BLRENT,DIK="^BLRTXLOG("_DA(1)_","_30_"," D ^DIK  ;IHS/OIRM TUC/AAB 2/10/98
 S BLRSFID=BLRFID,BLRSIEN=BLRIEN,BLRFID=BLRF(0,BLRVR,"FILE"),BLRVL=@BLRVL
 ;F BLRIII=1:1:$L(BLRVL,$C(20)) S BLRIEN=(BLRIII+BLRENT)_","_BLRSIEN,(BLRSSTR,BLRFDA(BLRFID,BLRIEN,BLRF(0,BLRVR)))=$P(BLRVL,$C(20),BLRIII)
 F BLRIII=1:1:$L(BLRVL,$C(20)) S BLRICNT=BLRICNT+1,BLRIEN="+"_BLRICNT_","_BLRSIEN,(BLRSSTR,BLRFDA(BLRFID,BLRIEN,BLRF(0,BLRVR)))=$P(BLRVL,$C(20),BLRIII)  ;IHS/OIRM TUC/MJL 2/10/98
 S BLRFID=BLRSFID,BLRIEN=BLRSIEN
 Q
 ;
WORD ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 Q
 ;
FILE ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ;
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER FILE^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER FILE^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 L +^BLRTXLOG(BLRENT):300
 ; If after attempting for 300 seconds the lock fails proceed anyway
 S BLRFDA="BLRFDA"
 D
 .I BLRCMF="C" D UPDATE^DIE("",BLRFDA,BLRENTS,"BLREMSG") Q
 .D UPDATE^DIE("",BLRFDA,"","BLREMSG") Q
 S:$D(BLREMSG) BLRERR=1
 L -^BLRTXLOG(BLRENT) ;IHS/OIRM TUC/MJL 5/21/98
 Q
 ;
GETIEN(BLRSB1,BLRSB2,BLRSB3) ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER GETIEN^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER GETIEN^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 D
 .I BLRCMF="C" D GETNEW Q
 .I BLRPHASE="O" S BLRCRGL="^BLRTXLOG(""AOT"","_BLRSB1_","_BLRSB2_","_BLRSB3_")",BLRENT=$O(^BLRTXLOG("AOT",BLRSB1,BLRSB2,BLRSB3,""),-1) D:'BLRENT CKORD D:BLRERR EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 .I $D(BLRSB3) S BLRCRGL="^BLRTXLOG(""AOT"","_BLRSB1_","_BLRSB2_","_BLRSB3_")",BLRENT=$O(^BLRTXLOG("AOT",BLRSB1,BLRSB2,BLRSB3,""),-1) D:'BLRENT CKORD D:BLRERR EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 .;S BLRCRGL="^BLRTXLOG(""AAT"","_BLRSB1_","_BLRSB2_")" S BLRENT=$O(^BLRTXLOG("AAT",BLRSB1,BLRSB2,""),-1) D:'BLRENT EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 .;IHS/DIR TUC/AAB 05/07/98
 .S BLRCRGL="^BLRTXLOG(""AAT"","_BLRSB1_","_BLRSB2_")" S BLRENT=$O(^BLRTXLOG("AAT",BLRSB1,BLRSB2,""),-1)
 .D:'BLRENT EMSG Q:BLRERR
 .S BLRCDT=$P(^BLRTXLOG(BLRENT,12),U)
 .I $E(BLRCDT,1,3)=$E(DT,1,3) S BLRIEN=BLRENT_"," Q
 .I ($E(BLRCDT,1,3)+1)'=$E(DT,1,3) S BLRERR=1,BLRDTER=1 Q  ;MORE THAN 1 YEAR AHEAD
 .I $E(BLRCDT,4,5)<11 S BLRERR=1,BLRDTER=1 Q
 .S BLRIEN=BLRENT_"," Q
 Q BLRENT
 ;
GETOGIEN(BLRSB1,BLRSB2,BLRSB3) ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER GETOGIEN^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER GETOGIEN^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 D
 .I BLRCMF="C" D GETNEW Q
 .I '$D(BLRSB3) S BLRCRGL="^BLRTXLOG(""AOG"","_BLRSB1_","_BLRSB2_")",BLRENT=$O(^BLRTXLOG("AOG",BLRSB1,BLRSB2,""),-1) D:'BLRENT EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 .S BLRCRGL="^BLRTXLOG(""AOD"","_BLRSB1_","_BLRSB2_","_BLRSB3_")",BLRENT=$O(^BLRTXLOG("AOD",BLRSB1,BLRSB2,BLRSB3,""),-1) D:'BLRENT EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 Q BLRENT
 ;
GETBIEN(BLRSB1,BLRSB2,BLRSB3) ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER GETBIEN^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER GETBIEN^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 D
 .I BLRCMF="C" D GETNEW Q
 .;I '$D(BLRSB3) S BLRCRGL="^BLRTXLOG(""AOB"","_BLRSB1_","_BLRSB2_")",BLRENT=$O(^BLRTXLOG("AOB",BLRSB1,BLRSB2,""),-1) D:'BLRENT EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 .I '$D(BLRSB3) S BLRCRGL="^BLRTXLOG(""AOB"","_BLRSB1_","_BLRSB2_")",BLRENT=$O(^BLRTXLOG("AOB",BLRSB1,BLRSB2,""),-1) D CHKDT Q  ;IHS/DIR TUC/AAB 05/07/98
 .;S BLRCRGL="^BLRTXLOG(""AOA"","_BLRSB1_","_BLRSB2_","_BLRSB3_")",BLRENT=$O(^BLRTXLOG("AOA",BLRSB1,BLRSB2,BLRSB3,""),-1) D:'BLRENT EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 .S BLRCRGL="^BLRTXLOG(""AOA"","_BLRSB1_","_BLRSB2_","_BLRSB3_")",BLRENT=$O(^BLRTXLOG("AOA",BLRSB1,BLRSB2,BLRSB3,""),-1) D CHKDT Q  ;IHS/DIR TUC/AAB 05/07/98
 Q BLRENT
 ;
CHKDT ; EP - IHS/OIT/MKK -- Need "EP" for SAC -- IHS/DIR TUC/AAB 05/07/98
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER CHKDT^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER CHKDT^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 D:'BLRENT EMSG Q:BLRERR
 S BLRCDT=$P(^BLRTXLOG(BLRENT,12),U)
 I $E(BLRCDT,1,3)=$E(DT,1,3) S BLRIEN=BLRENT_"," Q
 I ($E(BLRCDT,1,3)+1)'=$E(DT,1,3) S BLRERR=1,BLRDTER=1 Q  ;MORE THAN 1 YEAR AHEAD
 I $E(BLRCDT,4,5)<11 S BLRERR=1,BLRDTER=1 Q
 S BLRIEN=BLRENT_"," Q
 Q
GETOSIEN(BLRSB1,BLRSB2,BLRSB3)         ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER GETOSIEN^BLRFLTL")
 D ENTRYAUD^BLRUTIL("ENTER GETOSIEN^BLRFLTL")   ; IHS/OIT/MKK - LR*5.2*1033
 D
 .I BLRCMF="C" D GETNEW Q
 .I '$D(BLRSB3) S BLRCRGL="^BLRTXLOG(""AOG"","_BLRSB1_","_BLRSB2_")",BLRENT=$O(^BLRTXLOG("AOG",BLRSB1,BLRSB2,""),-1) D:'BLRENT EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 .S BLRCRGL="^BLRTXLOG(""AOS"","_BLRSB1_","_BLRSB2_","_BLRSB3_")",BLRENT=$O(^BLRTXLOG("AOS",BLRSB1,BLRSB2,BLRSB3,""),-1) D:'BLRENT EMSG Q:BLRERR  S BLRIEN=BLRENT_"," Q
 Q BLRENT
 ;
EMSG ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; Log an error because the crossreference isn't set.
 I 'BLRENT D
 .S BLRERR=1,BLRERROR(1)="Something wrong -- problem with IHS Lab Transaction Log Cross Reference: "_BLRCRGL
 Q
 ;
CKORD ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 S BLRERR=1,BLRENT=^BLRTXLOG("SEQ")+1 ;IHS/DIR/MJL BLRERR=1 7/15/99
 F BLRTRY=1:1:1000 S BLRENT=$O(^BLRTXLOG(BLRENT),-1) Q:'BLRENT  I $P(^BLRTXLOG(BLRENT,11),U,3)=$G(BLR("ORDER NUMBER"),LRORD),$P(^BLRTXLOG(BLRENT,0),U,6)=BLRSB3 S BLRERR=0 Q
 S:BLRERR BLRENT=0 K BLRTRY
 Q
 ;
GETNEW ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ; L +^BLRTXLOG("SEQ")
 L +^BLRTXLOG("SEQ"):5  I '$T  H 5  G GETNEW     ; IHS/OIT/MKK - LR*5.2*1033
 S BLRENT=$G(^BLRTXLOG("SEQ"))
 I 'BLRENT S BLRENT=$O(^BLRTXLOG("@"),-1) I BLRENT,'$D(^BLRTXLOG(1)) S BLRENT=0
 ;IHS/DIR TUC/MJL 12/4/98
 ;S BLRENT=BLRENT+1 S:$D(^BLRTXLOG(BLRENT)) BLRENT=$O(^BLRTXLOG("@"),-1)+1
 ;IHS/DIR TUC/MJL 12/4/98
 F BLRENT=BLRENT+1:1 Q:'$D(^BLRTXLOG(BLRENT))
 S BLRENTS="BLRENTS",BLRENTS(1)=BLRENT,^BLRTXLOG("SEQ")=BLRENT,BLRIEN="+1,"
 L -^BLRTXLOG("SEQ")
 Q
 ;
LOG ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ;S BLRDH=+$H,BLRLTA=$P($G(^BLRSITE(DUZ(2),21,BLRDH,0)),U,2)+1
 S BLRDH=+$H
 ; L +^BLRSITE(BLRQSITE,21,BLRDH,0)
 L +^BLRSITE(BLRQSITE,21,BLRDH,0):5  I '$T  H 5  G LOG     ; IHS/OIT/MKK - LR*5.2*1033
 S BLRLTA=$P($G(^BLRSITE(BLRQSITE,21,BLRDH,0)),U,2)+1
 ;I BLRLTA=1 S %H=$H D YX^%DTC S $P(^BLRSITE(DUZ(2),21,BLRDH,0),U,1)=X
 I BLRLTA=1 S %H=$H D YX^%DTC S $P(^BLRSITE(BLRQSITE,21,BLRDH,0),U,1)=X  ;IHS/DIR TUC/AAB 04/07/98
 ;S ^BLRSITE(DUZ(2),21,BLRDH,BLRLTA)=BLRENT,$P(^BLRSITE(DUZ(2),21,BLRDH,0),U,2)=BLRLTA
 S ^BLRSITE(BLRQSITE,21,BLRDH,BLRLTA)=BLRENT,$P(^BLRSITE(BLRQSITE,21,BLRDH,0),U,2)=BLRLTA  ;IHS/DIR TUC/AAB 04/07/09
 L -^BLRSITE(BLRQSITE,21,BLRDH,0)
 Q
 ;
BULERR ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 NEW ERROR714      ; IHS/OIT/MKK - LR*5.2*1027
 S ERROR714="NO"   ; IHS/OIT/MKK - LR*5.2*1027
 ;BLRTXLOG ERROR
 D:$D(BLREMSG)
 .; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("BULERR^BLRFLTL 1.0","BLREMSG")
 . D ENTRYAUD^BLRUTIL("BULERR^BLRFLTL 1.0","BLREMSG")   ; IHS/OIT/MKK - LR*5.2*1033
 .S (BLRECNT,BLRTCNT)=0 F  S BLRECNT=$O(BLREMSG("DIERR",BLRECNT)) Q:'BLRECNT  D
 ..S BLRTCNT=BLRTCNT+1,BLRERROR(BLRTCNT)="Error code = "_BLREMSG("DIERR",BLRECNT)
 ..S:+$G(BLREMSG("DIERR",BLRECNT))=714 ERROR714="YES"      ; IHS/OIT/MKK - LR*5.2*1027
 ..S BLRELCNT=0 F  S BLRELCNT=$O(BLREMSG("DIERR",BLRECNT,"TEXT",BLRELCNT)) Q:'BLRELCNT  S BLRTCNT=BLRTCNT+1,BLRERROR(BLRTCNT)=BLREMSG("DIERR",BLRECNT,"TEXT",BLRELCNT)
 .K BLRECNT,BLRELCNT
 ;D:$D(BLR)
 D:+$G(BLR("SEQUENCE NUMBER"))  ;IHS/DIR TUC/AAB 03/27/98
 .S BLRV="",BLRTCNT=$G(BLRTCNT,1),BLRERROR(BLRTCNT+1)="",BLRERROR(BLRTCNT+2)="VARIABLES:",BLRERROR(BLRTCNT+3)="",BLRTCNT=BLRTCNT+3
 .S BLRV="" F  S BLRV=$O(BLR(BLRV)) Q:BLRV=""  S BLRTCNT=BLRTCNT+1,BLRERROR(BLRTCNT)=$J("",10)_BLRV_$J("",35-$L(BLRV))_BLR(BLRV)
 S BLRTCNT=$G(BLRTCNT,1)
 F BLRPC=1:1 S BLRESTR=$P($T(PARSE+BLRPC),";",3) Q:BLRESTR=""  D
 .S BLRXQY0=$P(XQY0,U,2) S:$D(BLRTEST1) BLRPT=$P(^LAB(60,BLRTEST1,0),U)
 .S:$D(@($P(BLRESTR,"|",2))) BLRTCNT=BLRTCNT+1,BLRERROR(BLRTCNT)=$P(BLRESTR,"|")_@($P(BLRESTR,"|",2))
 ; S XMB="BLRTXERR",XMTEXT="BLRERROR" S BLRDUZ=DUZ,DUZ=.5 D ^XMB S DUZ=BLRDUZ K ^TMP("XMBTEXT",$J)
 ; ----- BEGIN IHS/OIT/MKK - LR*5.2*1027
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("BULERR^BLRFLTL 2.0","BLRERROR")
 D ENTRYAUD^BLRUTIL("BULERR^BLRFLTL 2.0","BLRERROR")   ; IHS/OIT/MKK - LR*5.2*1033
 S XMB="BLRTXERR"
 S XMTEXT="BLRERROR"
 S XMDUZ=$S(ERROR714="YES":"714 Error",1:"POSTMASTER")
 D ^XMB
 K ^TMP("XMBTEXT",$J)
 ; ----- END IHS/OIT/MKK - LR*5.2*1027
 Q
 ;
KILL ; EP - IHS/OIT/MKK -- Need "EP" for SAC
 ;K BLR,BLRARRAY,BLREMSG,BLRENTS,BLRERR,BLRERROR,BLRFDA,BLRI,BLRIEN,BLRIENS,BLRIII,BLRLOGDA,BLRQUIET,BLRSFID,BLRSIEN,BLRT,BLRTCNT,BLRVL,BLRVR,BLRVRS,ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE
 K BLR,BLRARRAY,BLREMSG,BLRENTS,BLRERR,BLRERROR,BLRFDA,BLRI,BLRICNT,BLRIEN,BLRIENS,BLRIII,BLRLOGDA,BLRQUIET,BLRSFID,BLRSIEN,BLRT,BLRTCNT,BLRVL,BLRVR,BLRVRS
 K ZTDESC,ZTDTH,ZTIO,ZTRTN,ZTSAVE,BLRESTR,BLRPT,BLRXQY0,BLRPC,BLRMI,BLRDTER  ;IHS/OIRM TUC/MJL 2/10/98
 Q
PARSE ; EP - IHS/OIT/MKK -- Need "EP" for SAC - IHS/DIR TUC/AAB 03/27/98
 ;;Patient Name: |PNM
 ;;Panel/Test: |BLRPT
 ;;Order Number: |LRORD
 ;;Accession Number: |BLRACCN
 ;;DUZ: |DUZ
 ;;DUZ(2): |BLRDUZ2
 ;;BLROPT1: |BLROPT1
 ;;BLROPT(0): |BLROPT(0)
 ;;XQY0: |BLRXQY0
 Q