BLRCLRAL ;IHS/OIT/MKK - Clear ALL Lab Module Errors in the Error Trap ; 22-Apr-2016 15:09 ; MKK
;;5.2;LR;**1024,1039**;NOV 01, 1997;Build 38
;
;Clear ALL BLR Errors from ERROR LOG, no matter the date
;Code cloned from CLRERRS^BLRUTIL.
CLRALLER ; EP
NEW BLRERLIM,BLRERRS,CURUCI,ERRDT,ERRNUM,HEADER,RTN,TODAY,TONLERRS
NEW ERRTOTAL ; IHS/MSC/MKK - LR*5.2*1039
;
S HEADER(1)="CLEAR ALL BLR ERRORS IN ERROR TRAP"
D HEADERDT^BLRGMENU
W ?4 ; IHS/MSC/MKK - LR*5.2*1039
;
S STARTDT=$O(^%ZTER(1,0)) ; Earliest date in Error Trap
S TODAY=+$H
S BLRQSITE=$P($G(^AUTTSITE(1,0)),U) ; Division
S BLRERLIM=$P($G(^BLRSITE(BLRQSITE,0)),U,11) ; GET ERROR OVERFLOW LIMIT
X ^%ZOSF("UCI")
; S CURUCI=Y
S CURUCI=$P(Y,",") ; IHS/MSC/MKK - LR*5.2*1039
;
S ERRTOTAL=0 ; IHS/MSC/MKK - LR*5.2*1039
S (BLRERRS,TONLERRS)=0
; F ERRDT=STARTDT:1:TODAY Q:+$G(BLRERRS)>5 D ; <<<<<<<DEBUG
F ERRDT=STARTDT:1:TODAY D ; IHS/MSC/MKK - LR*5.2*1039 -- Remove DEBUG limit
. S ERRNUM=0
. F S ERRNUM=$O(^%ZTER(1,ERRDT,1,ERRNUM)) Q:ERRNUM=""!(ERRNUM'?.N) D
.. ; Q:$P($G(^%ZTER(1,ERRDT,1,ERRNUM,"J")),U,4)'=CURUCI
.. ;
.. ; ----- BEGIN IHS/MSC/MKK - LR*5.2*1039
.. S ERRUCI=$P($G(^%ZTER(1,ERRDT,1,ERRNUM,"J")),U,4)
.. S ERRUCI=$S(ERRUCI[":":$P(ERRUCI,":"),1:$P(ERRUCI,","))
.. Q:ERRUCI'=CURUCI
.. ;
.. S ERRTOTAL=ERRTOTAL+1
.. I (ERRTOTAL#100)=0 W "." W:$X>74 !,?4
.. ; ----- END IHS/MSC/MKK - LR*5.2*1039
.. ;
.. I $G(^%ZTER(1,ERRDT,1,ERRNUM,"ZE"))'[("^BLR") D Q
... S TONLERRS=1+$G(TONLERRS) ; Count # of Non-BLR errors
.. ;
.. S BLRERRS(ERRDT)=1+$G(BLRERRS(ERRDT))
.. S BLRERRS=1+$G(BLRERRS)
.. ; K ^%ZTER(1,ERRDT,1,ERRNUM)
.. ; S $P(^%ZTER(1,ERRDT,0),U,2)=$P($G(^%ZTER(1,ERRDT,0)),U,2)-1
.. ; ----- BEGIN IHS/MSC/MKK - LR*5.2*1039
.. D ^XBFMK
.. S DA=ERRNUM,DA(1)=ERRDT
.. S DIK="^%ZTER(1,"_DA(1)_",1,"
.. D ^DIK
.. ;
.. ; If deletion successful, have to manually reset the Error Counter
.. S:$D(^%ZTER(1,ERRDT,1,ERRNUM))<1 $P(^%ZTER(1,ERRDT,0),U,2)=$P($G(^%ZTER(1,ERRDT,0)),U,2)-1
.. ; ----- END IHS/MSC/MKK - LR*5.2*1039
;
; W !!
; I +$G(TONLERRS)>0 W ?5,"Total Non-Link Errors = ",TONLERRS,!
W !!,?4,$FN(ERRTOTAL,",")," Errors analyzed.",! ; IHS/MSC/MKK - LR*5.2*1039
;
I +$G(BLRERRS)<1 D
. ; W !,?5,"No link errors were found for Date Range: "
. W !,?9,"No link errors were found for Date Range: " ; IHS/MSC/MKK - LR*5.2*1039
. W $$HTE^XLFDT(STARTDT,"2DZ")
. W " thru "
. W $$HTE^XLFDT(TODAY,"2DZ")
. W !
;
I +$G(BLRERRS)>0 D
. W !
. ; W +$G(BLRERRS)
. ; W ?5,"Link Errors were found and cleared from the error log!",!!
. W ?9,BLRERRS," Link Errors were found and cleared from the error log.",! ; IHS/MSC/MKK - LR*5.2*1039
. S ERRDT=0
. F S ERRDT=$O(BLRERRS(ERRDT)) Q:ERRDT="" D
.. ; W ?10,"Date: "
.. W ?14,"Date: " ; IHS/MSC/MKK - LR*5.2*1039
.. W $$HTE^XLFDT(ERRDT,"2DZ") ; External Date format
.. W " had "
.. W +$G(BLRERRS(ERRDT)) ; # of errors on that date
.. W " link error"
.. I +$G(BLRERRS(ERRDT))>1 W "s" ; if > 1 then make plural
.. W "."
.. W !
. S $P(^BLRSITE(BLRQSITE,0),U,9)=0 ; Clear BLR MASTER CONTROL (#9009029) file's STOP PROCESSOR field
;
D BLRGPGR^BLRGMENU(20) ; Press Return
;
Q
BLRCLRAL ;IHS/OIT/MKK - Clear ALL Lab Module Errors in the Error Trap ; 22-Apr-2016 15:09 ; MKK
+1 ;;5.2;LR;**1024,1039**;NOV 01, 1997;Build 38
+2 ;
+3 ;Clear ALL BLR Errors from ERROR LOG, no matter the date
+4 ;Code cloned from CLRERRS^BLRUTIL.
CLRALLER ; EP
+1 NEW BLRERLIM,BLRERRS,CURUCI,ERRDT,ERRNUM,HEADER,RTN,TODAY,TONLERRS
+2 ; IHS/MSC/MKK - LR*5.2*1039
NEW ERRTOTAL
+3 ;
+4 SET HEADER(1)="CLEAR ALL BLR ERRORS IN ERROR TRAP"
+5 DO HEADERDT^BLRGMENU
+6 ; IHS/MSC/MKK - LR*5.2*1039
WRITE ?4
+7 ;
+8 ; Earliest date in Error Trap
SET STARTDT=$ORDER(^%ZTER(1,0))
+9 SET TODAY=+$HOROLOG
+10 ; Division
SET BLRQSITE=$PIECE($GET(^AUTTSITE(1,0)),U)
+11 ; GET ERROR OVERFLOW LIMIT
SET BLRERLIM=$PIECE($GET(^BLRSITE(BLRQSITE,0)),U,11)
+12 XECUTE ^%ZOSF("UCI")
+13 ; S CURUCI=Y
+14 ; IHS/MSC/MKK - LR*5.2*1039
SET CURUCI=$PIECE(Y,",")
+15 ;
+16 ; IHS/MSC/MKK - LR*5.2*1039
SET ERRTOTAL=0
+17 SET (BLRERRS,TONLERRS)=0
+18 ; F ERRDT=STARTDT:1:TODAY Q:+$G(BLRERRS)>5 D ; <<<<<<<DEBUG
+19 ; IHS/MSC/MKK - LR*5.2*1039 -- Remove DEBUG limit
FOR ERRDT=STARTDT:1:TODAY
Begin DoDot:1
+20 SET ERRNUM=0
+21 FOR
SET ERRNUM=$ORDER(^%ZTER(1,ERRDT,1,ERRNUM))
IF ERRNUM=""!(ERRNUM'?.N)
QUIT
Begin DoDot:2
+22 ; Q:$P($G(^%ZTER(1,ERRDT,1,ERRNUM,"J")),U,4)'=CURUCI
+23 ;
+24 ; ----- BEGIN IHS/MSC/MKK - LR*5.2*1039
+25 SET ERRUCI=$PIECE($GET(^%ZTER(1,ERRDT,1,ERRNUM,"J")),U,4)
+26 SET ERRUCI=$SELECT(ERRUCI[":":$PIECE(ERRUCI,":"),1:$PIECE(ERRUCI,","))
+27 IF ERRUCI'=CURUCI
QUIT
+28 ;
+29 SET ERRTOTAL=ERRTOTAL+1
+30 IF (ERRTOTAL#100)=0
WRITE "."
IF $X>74
WRITE !,?4
+31 ; ----- END IHS/MSC/MKK - LR*5.2*1039
+32 ;
+33 IF $GET(^%ZTER(1,ERRDT,1,ERRNUM,"ZE"))'[("^BLR")
Begin DoDot:3
+34 ; Count # of Non-BLR errors
SET TONLERRS=1+$GET(TONLERRS)
End DoDot:3
QUIT
+35 ;
+36 SET BLRERRS(ERRDT)=1+$GET(BLRERRS(ERRDT))
+37 SET BLRERRS=1+$GET(BLRERRS)
+38 ; K ^%ZTER(1,ERRDT,1,ERRNUM)
+39 ; S $P(^%ZTER(1,ERRDT,0),U,2)=$P($G(^%ZTER(1,ERRDT,0)),U,2)-1
+40 ; ----- BEGIN IHS/MSC/MKK - LR*5.2*1039
+41 DO ^XBFMK
+42 SET DA=ERRNUM
SET DA(1)=ERRDT
+43 SET DIK="^%ZTER(1,"_DA(1)_",1,"
+44 DO ^DIK
+45 ;
+46 ; If deletion successful, have to manually reset the Error Counter
+47 IF $DATA(^%ZTER(1,ERRDT,1,ERRNUM))<1
SET $PIECE(^%ZTER(1,ERRDT,0),U,2)=$PIECE($GET(^%ZTER(1,ERRDT,0)),U,2)-1
+48 ; ----- END IHS/MSC/MKK - LR*5.2*1039
End DoDot:2
End DoDot:1
+49 ;
+50 ; W !!
+51 ; I +$G(TONLERRS)>0 W ?5,"Total Non-Link Errors = ",TONLERRS,!
+52 ; IHS/MSC/MKK - LR*5.2*1039
WRITE !!,?4,$FNUMBER(ERRTOTAL,",")," Errors analyzed.",!
+53 ;
+54 IF +$GET(BLRERRS)<1
Begin DoDot:1
+55 ; W !,?5,"No link errors were found for Date Range: "
+56 ; IHS/MSC/MKK - LR*5.2*1039
WRITE !,?9,"No link errors were found for Date Range: "
+57 WRITE $$HTE^XLFDT(STARTDT,"2DZ")
+58 WRITE " thru "
+59 WRITE $$HTE^XLFDT(TODAY,"2DZ")
+60 WRITE !
End DoDot:1
+61 ;
+62 IF +$GET(BLRERRS)>0
Begin DoDot:1
+63 WRITE !
+64 ; W +$G(BLRERRS)
+65 ; W ?5,"Link Errors were found and cleared from the error log!",!!
+66 ; IHS/MSC/MKK - LR*5.2*1039
WRITE ?9,BLRERRS," Link Errors were found and cleared from the error log.",!
+67 SET ERRDT=0
+68 FOR
SET ERRDT=$ORDER(BLRERRS(ERRDT))
IF ERRDT=""
QUIT
Begin DoDot:2
+69 ; W ?10,"Date: "
+70 ; IHS/MSC/MKK - LR*5.2*1039
WRITE ?14,"Date: "
+71 ; External Date format
WRITE $$HTE^XLFDT(ERRDT,"2DZ")
+72 WRITE " had "
+73 ; # of errors on that date
WRITE +$GET(BLRERRS(ERRDT))
+74 WRITE " link error"
+75 ; if > 1 then make plural
IF +$GET(BLRERRS(ERRDT))>1
WRITE "s"
+76 WRITE "."
+77 WRITE !
End DoDot:2
+78 ; Clear BLR MASTER CONTROL (#9009029) file's STOP PROCESSOR field
SET $PIECE(^BLRSITE(BLRQSITE,0),U,9)=0
End DoDot:1
+79 ;
+80 ; Press Return
DO BLRGPGR^BLRGMENU(20)
+81 ;
+82 QUIT