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

BLRPSTST.m

Go to the documentation of this file.
BLRPST ; IHS/HQT/MJL - Show processor status ; [ 08/01/2002  7:58 AM ]
 ;;5.2;LR;**1011**;MAY 01, 2001
 ;
 D INIT
 F  D DSP Q:BLRF
 D KILL
 Q
 ;
DSP ;
 S BLRX=$G(^BLRSITE(BLRSITE,0))  ;0 NODE
 S BLRPDH=$P(BLRX,U,6)           ;'START PROCESSING DATE'
 S BLREDH=$P(BLRX,U,7)           ;'START EVENT DATE'
 S BLRLOG=$P(BLRX,U,2)           ;'LAB LOG TRANSACTION'
 S BLRPCC=$P(BLRX,U,3)           ;'LAB LOG TO PCC'
 S BLRSTOP=$P(BLRX,U,9)          ;'STOP PROCESSOR'
 S:'BLRPDH BLRPDH=+$H            ;IF NULL WE'RE STARTING TODAY
 S:'BLREDH BLREDH=+$H            ;IF NULL WE'RE STARTING TODAY
 ;
 ;'PROCESSING DATE' INFORMATION
 S BLRX=$G(^BLRSITE(BLRSITE,21,BLRPDH,0))
 S BLRLTA=+$P(BLRX,U,2)          ;'LAST TRANSACTION SEQ ASSIGNED'
 S BLRLTP=+$P(BLRX,U,3)          ;'LAST TRANSACTION SEQ PROCESSED'
 ;
 ;LAST TRANSACTION # ASSIGNED
 S BLRLSQA=+$G(^BLRSITE(BLRSITE,21,BLRPDH,BLRLTA))
 ;
 ;LAST TRANSACTION # PROCESSED
 S BLRLSQP=+$G(^BLRSITE(BLRSITE,21,BLRPDH,BLRLTP))
 ;
 S BLREPHAS=$P($G(^BLRSITE(BLRSITE,20,1,BLRPDH,0)),U,2)
 S BLREOPTN=$P($G(^BLRSITE(BLRSITE,20,1,BLRPDH,0)),U,3)
 ;
 ;GET THE 'EVENT DATE' INFO
 S BLRX=$G(^BLRSITE(BLRSITE,20,BLREDH,0))
 ;
 S BLRLEA=+$P(BLRX,U,2) ;LAST EVENT ASSIGNED
 S BLRLEP=+$P(BLRX,U,3) ;LAST EVENT PROCESSED
 ;
 S:BLRLTA-BLRLTP>1 BLRNSQP=+$G(^BLRSITE(BLRSITE,21,BLRPDH,BLRLTP+1))
 ;
 S:'BLRLTA BLRLSQA=0
 S:'BLRLTP BLRLSQP=0
 ;
 I BLREDH'=BLRLEDH!(BLRPDH'=BLRLPDH) S %H=BLREDH D YX^%DTC S BLRED=Y S %H=BLRPDH D YX^%DTC S BLRPD=Y,BLRLEDH=BLREDH,BLRLPDH=BLRPDH
 ;
 D
 .;I BLREDH=BLRPDH S BLRHDR="Currently processing day "_BLRPD,BLRHDR=$J("",75-$L(BLRHDR)/2)_BLRHDR Q
 .;S BLRHDR="Currently Processing      "_BLRED,BLRHDR=BLRHDR_$J("",42-$L(BLRHDR))_BLRPD
 .;
 .S %H=BLREDH D YX^%DTC S CURPRDT=Y
 .S SUBTITLE="Currently Processing events from "_$G(CURPRDT)
 .W !!,$J("",$G(IOM)-$L(SUBTITLE)/2),SUBTITLE Q
 ;
 D HDR
 W !!,"Last Event # Assigned"
 W ?23,$J($FN(BLRLEA,","),10)  ;'LAST EVENT ASSIGNED'
 W ?41,$J($FN(BLRLTA,","),10)  ;'LAST TRANSACTION SEQ ASSIGNED'
 W ?64,$J($FN(BLRLSQA,","),10) ;LAST TRANSACTION # ASSIGNED (#9009022)
 ;
 W !!,"Last Event # Processed"
 W ?23,$J($FN(BLRLEP,","),10)  ;'LAST EVENT PROCESSED'
 W ?41,$J($FN(BLRLTP,","),10)  ;'LAST TRANSACTION SEQ ASSIGNED'
 W ?64,$J($FN(BLRLSQP,","),10) ;LAST TRANSACTION # ASSIGNED' (#9009022)
 ;
 ;
 D:BLRLEA-BLRLEP>1!(BLRLTA-BLRLTP>1)
 .W !!,"Now Processing Event #"
 .W:BLRLEA-BLRLEP>1 ?23,$J($FN(BLRLEP+1,","),10)  ;
 .W:BLRLTA-BLRLTP>1 ?41,$J($FN(BLRLTP+1,","),10),?64,$J($FN(BLRNSQP,","),10)
 .W:BLRLEA-BLRLEP>1 !!?23,$G(BLREPHAS),?31,$G(BLREOPTN)
 ;
 L +^BLRLOCK:0 I $T S BLRF=1
 I BLRF!'BLRLOG!'BLRPCC D
 .I 'BLRLOG W !! W:BLRF "Processor is not running due to 'LAB LOG TRANSACTION' is off"
 .E  I 'BLRPCC W !! W:BLRF "Processor is not running. The 'LAB LOG TO PCC' is off"               ;D  W "!"
 .I BLRSTOP W " -- Halted by user" Q
 L -^BLRLOCK
 I $G(BLRNPMT) Q
 I BLRF R !!,"Press Enter to exit: ",BLR:DTIME,! Q
 R !!,"Press Enter to continue: ",BLR:5,! S BLRF=$T S BLRCNT=$S(BLRF:0,1:BLRCNT+1),BLRF=$S(BLR="^":1,1:BLRCNT=(DTIME\5))
 ;
 Q
 ;
INIT ;
 S U="^",BLRF=0,BLRLN="",$P(BLRLN,"-",81)="",BLRCNT=0
 S BLRSITE=$P($G(^AUTTSITE(1,0)),U)
 S:BLRSITE="" BLRSITE="UNKNOWN"
 S (BLRLEDH,BLRLPDH)=""
 S BLRSNAME=$P($G(^AUTTLOC(BLRSITE,0)),U,2)
 S:BLRSNAME="" BLRNAME="UNKNOWN SITE"
 I '$D(IOF) S IOP="HOME" D ^%ZIS K IOP
 Q
 ;
HDR ;
 D NOW^%DTC S Y=%,%DT="S" D DD^%DT S BLRDTM=Y
 W @IOF
 S TITLE="Processor Status (Test)"
 W $J("",$G(IOM)-$L(TITLE)/2),TITLE,!,$J("",$G(IOM)-$L(BLRDTM)/2),Y
 ;W !!,$G(BLRHDR)
 W !!,$G(SUBTITLE)
 ;
 ;"Event # of the day" refers to the 5th subscript in node 20
 ;^BLRSITE(1575,20,58714,1,1,0)="M^R^^^HE 0924 5^1575^746"
 ;"Entry Position in Queue" refers to the 4th subscript in node 21
 ;^BLRSITE(1575,21,58714,1)="9552"
 ;
 W !!,?43,"Position",?59,"IHS Lab Transaction"
 W !,?28,"Event",?43,"in",?61,"Sequence Number"
 W !,?28,"# of",?43,"Transaction",?63,"Assigned"
 W !,?28,$G(CURPRDT),?43,"Queue"
 W !,$G(BLRLN)
 Q
 ;IF NUMBER OF BLR ERRORS IN ^%ZTER IS GREATER THAN
 ;THE NUMBER SET IN 'ERROR OVERFLOW LIMIT' IN BLR MASTER CONTROL FILE
 ;IF GREATER THAN DISPLAY ALRM ON SCREEN AND STOP THE BLR PROCESSOR
ALERT ;
 S X="IORVON;IORVOFF;IOBON;IOBOFF"
 D ENDR^%ZISS
 W !,IORVON,"THERE IS SOMETHNG WRONG WITH THE PCC LINK!"
 W !,"TOO MANY ERRORS HAVE BEEN FOUND IN THE ERROR LOG!"
 W !,IOBON,"THE PCC LINK IS BEING TURNED OFF!!",IOBOFF
 W !,IORVON,"CALL YOUR SITE MANAGER IMMEDIATELY!",IORVOFF
 Q
 ;
KILL ;
 K %,%DT,%H,%I,BLR,BLRCNT,BLRLEDH,BLRLPDH,BLREDH,BLRPDH,BLRDTM,BLRF,BLRHDR,BLRLN,BLRLSQA,BLRLSQP,BLRNSQP,BLRLEA,BLRLEP,BLRLTA,BLRLTP,BLRPCC,BLRED,BLRPD,BLRSITE,BLRSTOP,BLRX,X,Y
 Q
 ;
ENT ;
 D INIT,DSP,KILL
 Q