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

BLRLINK.m

Go to the documentation of this file.
BLRLINK ; IHS/DIR/FJE - LAB HOOK FOR APCDALV (PCC) ; 22-Oct-2013 09:22 ; MKK
 ;;5.2;LR;**1001,1003,1008,1019,1021,1024,1030,1033**;NOV 01, 1997
 ;
 ;; This routine makes use of the PCC MASTER CONTROL FILE
 ;; The flag field of this file for the lab package contains the
 ;; following:  1st piece - 0 = outpatient facility only
 ;;                         1 = outpatient/inpatient facility
 ;;
 ;; THE FOLLOWING ARE NOT USED IN BLR5.2
 ;;             2nd piece - 0 = don't ask OP/IP prompt
 ;;                         1 = ask OP/IP prompt
 ;;             3rd piece - 0 = don't ask for ordering facility
 ;;                         1 = ask for ordering facility
 ;;             4th piece - 0 = don't pass clinic code
 ;;                         1 = pass clinic code
 ;; each piece is delimited by "~"
 ;
TSK ; EP - entry point for background job -- EP is IHS/OIT/MKK 1021 Change
 ;
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER TSK^BLRLINK")
 D ENTRYAUD^BLRUTIL("ENTER TSK^BLRLINK")   ; IHS/OIT/MKK - LR*5.2*1033
 L +^BLRLOCK:5 Q:'$T
 Q:$P($G(^AUTTSITE(1,0)),U,8)'="Y"
 S BLRQUIET=$G(BLRQUIET)
START ; EP
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER START^BLRLINK")
 D ENTRYAUD^BLRUTIL("ENTER START^BLRLINK")     ; IHS/OIT/MKK - LR*5.2*1033
 S BLRQSITE=$P($G(^AUTTSITE(1,0)),U)  ;IHS/DIR TUC/AAB 04/07/98
 S APCDALVR("BLRLINK")=1
 S BLRDH=$P($G(^BLRSITE(BLRQSITE,0)),U,6)
 ;----- BEGIN IHS MODIFICATIONS LR*5.2*1019 - IHS/OIT/MKK
 ; S BLR200CV=$P($P(^DD(9000010.09,1202,0),U,2),"'")="P200"  ;IHS/DIR TUC/AAB 04/07/98
 S BLR200CV=$P($P($G(^DD(9000010.09,1202,0)),U,2),"'")["P200"
 ;----- END IHS MODIFICATIONS LR*5.2*1019 - IHS/OIT/MKK
 S:BLRDH="" BLRDH=+$H,$P(^BLRSITE(BLRQSITE,0),U,6)=BLRDH  ;IHS/DIR TUC/AAB 04/07/98
 S BLRLTP=+$P($G(^BLRSITE(BLRQSITE,21,BLRDH,0)),U,3),BLRHCNT=0  ;IHS/DIR TUC/AAB 04/07/98
 ;
 F  Q:'$P(^BLRSITE(BLRQSITE,0),U,3)  D  Q:BLRHCNT>600  H:BLRHCNT 1  ;IHS/DIR TUC/AAB 04/07/98
 .S APCDALVR("BLRLINK")=1
 .S BLRERR=0
 .S BLRBUL=0
 .S BLRPCC=""
 .S BLRLTA=+$P($G(^BLRSITE(BLRQSITE,21,BLRDH,0)),U,2) S:'BLRLTA BLRLTP=0  ;IHS/DIR TUC/AAB 04/07/98
 .I BLRLTP=BLRLTA D  Q
 .. S BLRHCNT=BLRHCNT+1 Q:BLRDH=+$H
 .. S BLRHCNT=0
 .. S BLRDH=BLRDH+1
 .. S $P(^BLRSITE(BLRQSITE,0),U,6)=BLRDH
 .. S BLRLTP=0 Q  ;IHS/DIR TUC/AAB 04/07/98
 .;
 .S BLRLTP=BLRLTP+1
 .S BLRHCNT=0
 . ;----- BEGIN IHS MODIFICATIONS LR*5.2*1019 - IHS/OIT/MKK -- Get rid of Naked Reference
 .; S BLRLOGDA=^BLRSITE(BLRQSITE,21,BLRDH,BLRLTP)  ;IHS/DIR TUC/AAB 04/07/98
 .S BLRLOGDA=$G(^BLRSITE(BLRQSITE,21,BLRDH,BLRLTP))
 . ;----- END IHS MODIFICATIONS LR*5.2*1019 - IHS/OIT/MKK
 .L +^BLRTXLOG(BLRLOGDA):60
 .D PROC
 .D:BLRPCC'="" ERR
 .L -^BLRTXLOG(BLRLOGDA) ;IHS/OIRM TUC/MJL 5/21/98
 .; D:BLRBUL BULTNS
 .D:BLRBUL BULTNS^BLRUTIL3   ; IHS/OIT/MKK - LR*5.2*1030
 .;S $P(^BLRSITE(DUZ(2),21,BLRDH,0),U,3)=BLRLTP
 .S $P(^BLRSITE(BLRQSITE,21,BLRDH,0),U,3)=BLRLTP  ;IHS/DIR TUC/AAB 04/07/98
 .D CLNUP
 D EOJ
 L -^BLRLOCK
 Q
 ;
PROC ; EP
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("PROC^BLRLINK 1.0")
 D ENTRYAUD^BLRUTIL("PROC^BLRLINK 1.0","APCDALVR")   ; IHS/OIT/MKK - LR*5.2*1033
 ;
 D ^BLRLINK1 Q:BLRERR
 D ENTRYAUD^BLRUTIL("PROC^BLRLINK 2.0","APCDALVR")   ; IHS/OIT/MKK - LR*5.2*1033
 D ^BLRLINK2 Q:BLRERR
 D ENTRYAUD^BLRUTIL("PROC^BLRLINK 3.0","APCDALVR")   ; IHS/OIT/MKK - LR*5.2*1033
 D ^BLRLINK3
 Q
 ;
 ;
ERR ; EP - update transaction log with PCC error message value (if transaction is a modification then any previous value needs to be removed)
 K DIE,DA,DR
 S DIE="^BLRTXLOG(",DA=BLRLOGDA,DR="106///^S X=BLRPCC"
 D ^DIE Q
 S BLRBUL=2,BLRPCC="Update to IHS transaction log to the PCC error flag field not done..REFILE"
 W:'BLRQUIET !,"Another user is editing this file entry....update to IHS transaction log to the PCC error flag field not done"
 Q
 ;
SETNUL ; EP - update transaction log with PCC error message value (if transaction is a modification then any previous value needs to be removed) -- EP is IHS/OIT/MKK - 1021 Change
 K DIE,DA,DR
 S DIE="^BLRTXLOG(",DA=BLRLOGDA,DR="106////@"
 D ^DIE Q
 S BLRBUL=2,BLRPCC="PCC error flag field not nulled."
 W:'BLRQUIET !,"PCC error flag field not nulled"
 Q
 ;
CALLDIK ;EP - DELETE PCC VISIT AND UPDATE BLRTXLOG
 ; D:$G(SNAPSHOT) ENTRYAUD^BLRUTIL("ENTER CALLDIK^BLRLINK")
 D ENTRYAUD^BLRUTIL("ENTER CALLDIK^BLRLINK")   ; IHS/OIT/MKK - LR*5.2*1033
 I '$L(BLRVIEN) S BLRPCC="Lab deleted test...PCC entries already deleted" D ERR^BLRLINK Q
 N (BLRLOGDA,DA,DIK,DT,DUZ,U,DTIME,IO,IOSL,IOM,IOXY,IOST,XQDIC,XQPSM,XQY,XQYO,ZTQUEUED)
 S BLRBUL=2,BLRPCC="Lab deleted test...PCC entries deleted"
 D ^DIK,DTXVP
 Q
 ;
DTXVP ; EP - update transaction log to delete PCC file and v ien when lab deletes the test,
 ; or if PCC entries are missing.
 K DIE,DA,DR
 S DIE="^BLRTXLOG(",DA=BLRLOGDA
 S DR="104////@;105////@;106///^S X=BLRPCC"
 D ^DIE Q
 S BLRPCC=BLRPCC_"PCC error flag field not set.",BLRBUL=2
 W:'BLRQUIET !,BLRPCC,!
 Q
 ;
DEBUG ; EP 
 ; Used for debugging only -- called by ^BLRDBG
 ;
 S BLRERR=0,BLRPCC="",BLRQUIET=$G(BLRQUIET),BLR200CV=$P($P(^DD(9000010.09,1202,0),U,2),"'")="P200"
 D PROC,ERR:BLRPCC'="",CLNUP,EOJ
 Q
 ;
CLNUP ; EP
 K APCDALVR,BLR,BLRABNL,BLRACC,BLRANT,BLRANTN,BLRBILL,BLRBUL,BLRBTN,BLRCD,BLRCDT,BLRCLIN,BLRCLNAM,BLRCOM,BLRCOST,BLRCPT,BLRCPTST,BLRDFN,BLRDUZ,BLREPNM,BLRERR,BLREPRV,BLRERR,BLRFILE,BLRVFN
 K BLRIEN,BLRLINK,BLRLIT,BLRLOGDA,BLRMOD,BLRNAME,BLRNCOM,BLRNMSPC,BLRODT,BLROPNM,BLROPRV,BLRORD,BLRORDL,BLRORG,BLRORGN,BLRPAREN,BLRPATCD,BLRPCC,BLRPMSG,BLRPNAM,BLRPROG,BLRRES,BLRRFH,BLRVFILE,BLRVGL,BLRVFN
 K BLRORDL1,BLRCOMPD,BLRCOLSP  ;IHS/DIR TUC/AAB 04/08/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