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

BLRNFLTL.m

Go to the documentation of this file.
BLRNFLTL ;IHS/HQT/MJL - SILENT DIE CALLS TO UPDATE TRANSACTION LOG ; 22-Oct-2013 09:22 ; MKK
 ;;5.2;IHS LABORATORY;**1010,1013,1015,1027,1033**;NOV 01, 1997
 ;
 S U="^"
 S BLRFID=9009022
 S (BLRERR,BLRICNT)=0
 S:BLRCMF="C" BLRICNT=1
 D SETVALS
 I 'BLRERR S:'BLRXPCC BLRFDA(BLRFID,BLRIEN,BLRF(0,"PCC ERROR FLAG"))="PCC LINK DISABLED" D FILE
 I BLRXPCC,'$D(BLRERF),'BLRERR D LOG
 I '(+$G(BLRDTER)),BLRERR D BULERR
 D KILL
 Q
 ;
SETVALS ; EP
 S:$G(BLR("SIGN OR SYMPTOM"))["^" BLR("SIGN OR SYMPTOM")=$P(BLR("SIGN OR SYMPTOM"),"^")  ; IHS/OIT/MKK - LR*5.2*1027
 S:$G(BLRDIAG)["^" BLRDIAG=$P(BLRDIAG,"^")                                               ; IHS/OIT/MKK - LR*5.2*1027
 S BLRI=0 F  S BLRI=$O(BLR(BLRI)) Q:BLRI'?.N.1"."1N.N  M BLR(BLRF(1,BLRI))=BLR(BLRI)
 S BLRI=" " F  S BLRI=$O(BLR(BLRI)) Q:BLRI=""  S BLRVR=BLRI D
 .I $D(BLRF(0,BLRVR,"TYPE")) D  Q
 ..I BLRF(0,BLRVR,"TYPE")="M" D MULTI Q
 ..I BLRF(0,BLRVR,"TYPE")="W" D WORD Q
 .I $D(BLRF(0,BLRVR)),BLR(BLRVR)'="" S BLRFDA(BLRFID,BLRIEN,BLRF(0,BLRVR))=BLR(BLRVR)
 Q
 ;
MULTI ; EP
 ; Used for multiples
 I BLRCMF="M",$G(BLRF(0,BLRVR,"DIK"))'="" X BLRF(0,BLRVR,"DIK")
 S BLRSFID=BLRFID,BLRSIEN=BLRIEN,BLRFID=BLRF(0,BLRVR,"FILE"),BLRVL=BLR(BLRVR)
 F BLRIII=1:1:$L(BLRVL,$C(20))-1 S BLRICNT=BLRICNT+1,BLRIEN="+"_BLRICNT_","_BLRSIEN,(BLRSSTR,BLRFDA(BLRFID,BLRIEN,BLRF(0,BLRVR)))=$P(BLRVL,$C(20),BLRIII)
 S BLRFID=BLRSFID
 S BLRIEN=BLRSIEN
 Q
 ;
WORD ; EP
 Q
 ;
FILE ; EP
 ;
 D
 .I BLRCMF="C"  D UPDATE^DIE("","BLRFDA","BLRENTS","BLREMSG")  Q     ; IHS/OIT/MKK - LR*5.2*1033
 .D UPDATE^DIE("","BLRFDA","","BLREMSG") Q                           ; IHS/OIT/MKK - LR*5.2*1033
 ;
 S:$D(BLREMSG) BLRERR=1
 ;
 Q
 ;
EMSG ; EP
 ; 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
 ;
LOG ; EP
 S BLRDH=+$H
 S BLRLTA=$P($G(^BLRSITE(BLRQSITE,21,BLRDH,0)),U,2)+1
 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(BLRQSITE,21,BLRDH,BLRLTA)=BLRENT,$P(^BLRSITE(BLRQSITE,21,BLRDH,0),U,2)=BLRLTA
 Q
 ;
BULERR ; EP
 NEW ERROR714      ; IHS/OIT/MKK - LR*5.2*1027
 S ERROR714="NO"   ; IHS/OIT/MKK - LR*5.2*1027
 ;
 ;BLRTXLOG ERROR
 D:$D(BLREMSG)
 .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:+$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
 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
 K BLRARRAY,BLREMSG,BLRENTS,BLRERR,BLRERROR,BLRFDA,BLRI,BLRICNT,BLRIEN,BLRIENS,BLRIII,BLRLOGDA,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/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