HLCSLM ;SFCIOFO/AC - HL7 LINK MANAGER ;03/19/2008 10:01
;;1.6;HEALTH LEVEL SEVEN;**49,57,109,123,140**;Oct 13, 1995;Build 5
;Per VHA Directive 2004-038, this routine should not be modified.
;
EN ;Entry point for start up task
N %,HLEVLCHK,HLTSKCNT
F %=1:1:10 L +^HLCS("HLCSLM"):2 Q:$T
E Q
I $G(ZTQUEUED) S Y=$$PSET^%ZTLOAD(ZTQUEUED)
D INIT,SAVDOLRH
D SETNM^%ZOSV($E("HLmgr:"_$G(ZTQUEUED),1,15))
;
LOOP ;
D CHKQUE
I $$CKLMSTOP G EXIT
D SAVDOLRH
D CHECKMST^HLEVMST ;HL*1.6*109 - Make sure event monitor current
; patch HL*1.6*140
; H 10
H 5
G LOOP
;
EXIT N HLJ,X
S X=1
F L +^HLCS(869.3,X,5):2 Q:$T
;52=Link Manager task number
S HLJ(869.3,X_",",52)="@"
D FILE^HLDIE("","HLJ","","EXIT","HLCSLM") ;HL*1.6*109
L -^HLCS(869.3,X,5)
L -^HLCS("HLCSLM")
Q
;
SAVDOLRH ;Save Last Known $H
N HLJ,X
S X=1
F L +^HLCS(869.3,X,5):2 Q:$T
;54=LM LAST KNOWN $H
S HLJ(869.3,X_",",54)=$H
D FILE^HLDIE("","HLJ","","SAVDOLRH","HLCSLM") ;HL*1.6*109
L -^HLCS(869.3,X,5)
Q
;
CHKQUE ;Check queues for messages to send
;HLTSKCNT(logical link)=task #^$H
N HLDA,HLDP,HLMSG,HLTSK,Y
S (HLDA,HLMSG)=""
F HLDP=0:0 S HLDP=+$O(^HLMA("AC","O",HLDP)) Q:HLDP'>0 S HLMSG=+$O(^(HLDP,0)) I HLMSG D L -^HLCS("HLCSLSM",HLDP)
.;quit if persistent link
.Q:$P($G(^HLCS(870,HLDP,400)),U,4)="Y"
.L +^HLCS("HLCSLSM",HLDP):0 E K HLTSKCNT(HLDP) Q
.Q:'$$LLOK(+HLDP)
.;get tasknumber from file 870 and HLTSKCNT array
.S Y=$$TASKNUM(HLDP),HLTSK=$G(HLTSKCNT(HLDP))
. ;
. ;patch HL*1.6*123 start
. S HLDP("TASK-ACTIVE")=0
. ;
. I Y D
.. N ZTSK
.. S ZTSK=Y
.. ; Check status of task
.. D STAT^%ZTLOAD
.. I "12"[ZTSK(1) S HLDP("TASK-ACTIVE")=1
. Q:HLDP("TASK-ACTIVE")
. ;
. I HLTSK D
.. N ZTSK
.. S ZTSK=+HLTSK
.. ; Check status of task
.. D STAT^%ZTLOAD
.. I "12"[ZTSK(1) S HLDP("TASK-ACTIVE")=1
. Q:HLDP("TASK-ACTIVE")
. ;
. ;no tasknumber, link not running nor queued, task it
. I 'HLTSK!'Y D TASKLSUB(HLDP),SAVTSK(HLDP) Q
; comment out the following lines
; .;link was tasked, check time
; .S Y=$P(HLTSK,U,2)
; .;check that time task is less than 30 minutes
; .Q:$$HDIFF^XLFDT($H,Y,2)<1800
; .;shutdown and send alert
; .D SDFLD^HLCSTCP,EXITS^HLCSTCP("Shutdown"),SNDALERT
; loop through links that have been tasked
; F HLDP=0:0 S HLDP=$O(HLTSKCNT(HLDP)) Q:HLDP'>0 K:'$D(^HLMA("AC","O",HLDP)) HLTSKCNT(HLDP)
F HLDP=0:0 S HLDP=$O(HLTSKCNT(HLDP)) Q:HLDP'>0 D
. N ZTSK
. S ZTSK=+HLTSKCNT(HLDP)
. ; Check status of task
. D STAT^%ZTLOAD
. ; kill HLTSKCNT(HLDP) if process is not active
. I "12"'[ZTSK(1) K HLTSKCNT(HLDP)
; patch HL*1.6*123 end
Q
;
INIT ;Create Task number and clear Stop flag.
N HLJ,X
S X=1
F L +^HLCS(869.3,X,5):2 Q:$T
;52=Link Manager task number,53=Stop Link Manager
S HLJ(869.3,X_",",52)=$G(ZTQUEUED)
S HLJ(869.3,X_",",53)="@"
D FILE^HLDIE("","HLJ","","INIT","HLCSLM") ;HL*1.6*109
L -^HLCS(869.3,X,5)
Q
TASKNUM(X) ;Look-up task number
N %,DA,Y
S DA=X
;
;**109**
;F L +^HLCS(870,+DA,0):2 Q:$T
;
S Y=$$GET1^DIQ(870,DA_",",11)
;
;**109
;L -^HLCS(870,+DA,0)
;
Q Y
STATUS(X) ;Status of task
N Y,ZTSK
S ZTSK=X
D STAT^%ZTLOAD
S Y=ZTSK(1)
Q Y
;
LLOK(X) ;Function to check whether LL ok.
;return value 1 = ok, 0 = not ok.
Q:'$G(X)
N HLDP,HLDP0,HLPARM4,HLTYPTR
S HLDP=+X,HLDP0=$G(^HLCS(870,HLDP,0)),HLPARM4=$G(^(400)) Q:HLDP0="" 0
;must be a client
Q:$P(HLPARM4,U,3)'="C" 0
;
; patch HL*1.6*123
;shutdown LLP must be 0
; Q:$P(HLDP0,U,15)'=0 0
; change to 1, in case the data is empty
Q:$P(HLDP0,U,15)=1 0
;
;must have LLP Type of TCP
S HLTYPTR=+$P(HLDP0,U,3) Q:$P($G(^HLCS(869.1,HLTYPTR,0)),U)'="TCP" 0
Q 1
;
SAVTSK(X) ;
N HLDP,HLJ
S HLDP=X
;
;**109**
F L +^HLCS(870,HLDP,0):2 Q:$T
;
;4=status,10=Time Stopped,9=Time Started,11=Task Number,3=Online ?
S X=$NA(HLJ(870,HLDP_",")),@X@(11)=$G(ZTSK)
;S HLJ(870,HLDP_",",11)=$G(ZTSK)
D FILE^HLDIE("","HLJ","","SAVTSK","HLCSLM") ; HL*1.6*109
S HLTSKCNT(HLDP)=$G(ZTSK)_"^"_$H
;
;**109**
L -^HLCS(870,HLDP,0)
;
Q
;
STRTSTOP ;ENTRY POINT TO START/STOP TCP LINK MANAGER
N DIR,DIRUT,Y
L +^HLCS("HLCSLM"):3 E D Q
.W !,*7,"Link Manager already running!"
.W ! S DIR(0)="YO",DIR("A")="Would you like to stop the Link Manager now",DIR("B")="NO" D ^DIR K DIR
.I $D(DIRUT)!'Y Q
.D STOPLM
W !,*7,"Link Manager is NOT currently running!"
W ! S DIR(0)="YO",DIR("A")="Would you like to start the Link Manager now",DIR("B")="YES" D ^DIR K DIR
I '$D(DIRUT)&Y D TASKLM
L -^HLCS("HLCSLM")
Q
;
STOPLM ;ENTRY POINT TO STOP LINK MANAGER
N DIC,X,Y,DTOUT,DUOUT,DLAYGO,DIE,DA,DR
S DIC="^HLCS(869.3,"
S X=1
D ^DIC
S DA=+Y,DIE=DIC
S DR="53////1"
D ^DIE
W !,"Link Manager has been asked to stop"
Q
STAT() ;Status of LINK MANAGER--up, down or unable to determine.
N %,DA,X,Y
S DA=1
S X=$$GET1^DIQ(869.3,DA_",",52)
Q:X']"" 0
S X=$$GET1^DIQ(869.3,DA_",",54)
Q:X']"" 0
I $$HDIFF^XLFDT($H,X,2)>500 Q 0
Q 1
;
TASKLSUB(X) ;Task LINK SUB-MANAGER.
;This may be a place to log the time which the LINK SUBMANAGER is tasked.
N HLDP,HLDP0,HLDAPP,HLTYPTR,HLBGR,HLENV,HLPARM,HLPARM4,HLQUIT,ZTRTN,ZTDESC,ZTCPU,ZTSAVE
;ZTSK is not Newed here because it will be needed by SAVTSK.
S HLDP=X,HLDP0=$G(^HLCS(870,HLDP,0)),HLPARM4=$G(^(400))
; Q:"N"'[$P(HLPARM4,U,4) ; patch HL*1.6*123: comment out
;quit if no LLP TYPE
S HLDAPP=$P(HLDP0,U),HLTYPTR=$P(HLDP0,U,3) Q:'HLTYPTR
S HLBGR=$G(^HLCS(869.1,HLTYPTR,100)),HLENV=$G(^(200))
I HLENV'="" K HLQUIT X HLENV Q:$D(HLQUIT)
S ZTRTN="^HLCSLSM",HLBGR=$P(HLBGR," ",2)
S ZTDESC=HLDAPP_" Low Level Protocol",ZTSAVE("HLDP")="",ZTSAVE("HLBGR")=""
S ZTIO="",ZTDTH=$H
;get startup node
I $P(HLPARM4,U,6),$D(^%ZIS(14.7,+$P(HLPARM4,U,6),0)) S ZTCPU=$P(^(0),U)
D ^%ZTLOAD
D MON^HLCSTCP("Tasked") ;HL*1.6*123
Q
;
TASKLM ;Task Link Manager
;Declare variables
N ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSK,TMP
S ZTIO=""
S ZTDTH=$H
;Task Link Manager
S ZTRTN="EN^HLCSLM"
S ZTDESC="HL7 Link Manager"
;Call TaskMan
D ^%ZTLOAD
I $G(ZTSK) W !,"Link Manager queued as task number ",ZTSK
E W $C(7),!!,"Unable to start/restart Link Manager"
Q
;
CKLMSTOP() ;Check whether Link Manager should stop
N PTRMAIN,NODE5,STOP
S PTRMAIN=+$O(^HLCS(869.3,0))
L +^HLCS(869.3,PTRMAIN,5):1
I $T L -^HLCS(869.3,PTRMAIN,5)
S NODE5=$G(^HLCS(869.3,PTRMAIN,5))
S STOP=+$P(NODE5,"^",3)
Q:STOP STOP
S STOP=$$S^%ZTLOAD
Q STOP
;
SNDALERT ;Send Alert
N XQA,XQAMSG,XQAOPT,XQAROU,XQAID,Z
S Z=$P($$PARAM^HLCS2,U,8) Q:Z=""
S XQA("G."_Z)="",XQAMSG="HL7 Logical Link "_$P(^HLCS(870,HLDP,0),U)_" shutdown due to TaskMan unable to process task request"
D SETUP^XQALERT
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLCSLM 6770 printed Oct 16, 2024@17:57:28 Page 2
HLCSLM ;SFCIOFO/AC - HL7 LINK MANAGER ;03/19/2008 10:01
+1 ;;1.6;HEALTH LEVEL SEVEN;**49,57,109,123,140**;Oct 13, 1995;Build 5
+2 ;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
EN ;Entry point for start up task
+1 NEW %,HLEVLCHK,HLTSKCNT
+2 FOR %=1:1:10
LOCK +^HLCS("HLCSLM"):2
if $TEST
QUIT
+3 IF '$TEST
QUIT
+4 IF $GET(ZTQUEUED)
SET Y=$$PSET^%ZTLOAD(ZTQUEUED)
+5 DO INIT
DO SAVDOLRH
+6 DO SETNM^%ZOSV($EXTRACT("HLmgr:"_$GET(ZTQUEUED),1,15))
+7 ;
LOOP ;
+1 DO CHKQUE
+2 IF $$CKLMSTOP
GOTO EXIT
+3 DO SAVDOLRH
+4 ;HL*1.6*109 - Make sure event monitor current
DO CHECKMST^HLEVMST
+5 ; patch HL*1.6*140
+6 ; H 10
+7 HANG 5
+8 GOTO LOOP
+9 ;
EXIT NEW HLJ,X
+1 SET X=1
+2 FOR
LOCK +^HLCS(869.3,X,5):2
if $TEST
QUIT
+3 ;52=Link Manager task number
+4 SET HLJ(869.3,X_",",52)="@"
+5 ;HL*1.6*109
DO FILE^HLDIE("","HLJ","","EXIT","HLCSLM")
+6 LOCK -^HLCS(869.3,X,5)
+7 LOCK -^HLCS("HLCSLM")
+8 QUIT
+9 ;
SAVDOLRH ;Save Last Known $H
+1 NEW HLJ,X
+2 SET X=1
+3 FOR
LOCK +^HLCS(869.3,X,5):2
if $TEST
QUIT
+4 ;54=LM LAST KNOWN $H
+5 SET HLJ(869.3,X_",",54)=$HOROLOG
+6 ;HL*1.6*109
DO FILE^HLDIE("","HLJ","","SAVDOLRH","HLCSLM")
+7 LOCK -^HLCS(869.3,X,5)
+8 QUIT
+9 ;
CHKQUE ;Check queues for messages to send
+1 ;HLTSKCNT(logical link)=task #^$H
+2 NEW HLDA,HLDP,HLMSG,HLTSK,Y
+3 SET (HLDA,HLMSG)=""
+4 FOR HLDP=0:0
SET HLDP=+$ORDER(^HLMA("AC","O",HLDP))
if HLDP'>0
QUIT
SET HLMSG=+$ORDER(^(HLDP,0))
IF HLMSG
Begin DoDot:1
+5 ;quit if persistent link
+6 if $PIECE($GET(^HLCS(870,HLDP,400)),U,4)="Y"
QUIT
+7 LOCK +^HLCS("HLCSLSM",HLDP):0
IF '$TEST
KILL HLTSKCNT(HLDP)
QUIT
+8 if '$$LLOK(+HLDP)
QUIT
+9 ;get tasknumber from file 870 and HLTSKCNT array
+10 SET Y=$$TASKNUM(HLDP)
SET HLTSK=$GET(HLTSKCNT(HLDP))
+11 ;
+12 ;patch HL*1.6*123 start
+13 SET HLDP("TASK-ACTIVE")=0
+14 ;
+15 IF Y
Begin DoDot:2
+16 NEW ZTSK
+17 SET ZTSK=Y
+18 ; Check status of task
+19 DO STAT^%ZTLOAD
+20 IF "12"[ZTSK(1)
SET HLDP("TASK-ACTIVE")=1
End DoDot:2
+21 if HLDP("TASK-ACTIVE")
QUIT
+22 ;
+23 IF HLTSK
Begin DoDot:2
+24 NEW ZTSK
+25 SET ZTSK=+HLTSK
+26 ; Check status of task
+27 DO STAT^%ZTLOAD
+28 IF "12"[ZTSK(1)
SET HLDP("TASK-ACTIVE")=1
End DoDot:2
+29 if HLDP("TASK-ACTIVE")
QUIT
+30 ;
+31 ;no tasknumber, link not running nor queued, task it
+32 IF 'HLTSK!'Y
DO TASKLSUB(HLDP)
DO SAVTSK(HLDP)
QUIT
End DoDot:1
LOCK -^HLCS("HLCSLSM",HLDP)
+33 ; comment out the following lines
+34 ; .;link was tasked, check time
+35 ; .S Y=$P(HLTSK,U,2)
+36 ; .;check that time task is less than 30 minutes
+37 ; .Q:$$HDIFF^XLFDT($H,Y,2)<1800
+38 ; .;shutdown and send alert
+39 ; .D SDFLD^HLCSTCP,EXITS^HLCSTCP("Shutdown"),SNDALERT
+40 ; loop through links that have been tasked
+41 ; F HLDP=0:0 S HLDP=$O(HLTSKCNT(HLDP)) Q:HLDP'>0 K:'$D(^HLMA("AC","O",HLDP)) HLTSKCNT(HLDP)
+42 FOR HLDP=0:0
SET HLDP=$ORDER(HLTSKCNT(HLDP))
if HLDP'>0
QUIT
Begin DoDot:1
+43 NEW ZTSK
+44 SET ZTSK=+HLTSKCNT(HLDP)
+45 ; Check status of task
+46 DO STAT^%ZTLOAD
+47 ; kill HLTSKCNT(HLDP) if process is not active
+48 IF "12"'[ZTSK(1)
KILL HLTSKCNT(HLDP)
End DoDot:1
+49 ; patch HL*1.6*123 end
+50 QUIT
+51 ;
INIT ;Create Task number and clear Stop flag.
+1 NEW HLJ,X
+2 SET X=1
+3 FOR
LOCK +^HLCS(869.3,X,5):2
if $TEST
QUIT
+4 ;52=Link Manager task number,53=Stop Link Manager
+5 SET HLJ(869.3,X_",",52)=$GET(ZTQUEUED)
+6 SET HLJ(869.3,X_",",53)="@"
+7 ;HL*1.6*109
DO FILE^HLDIE("","HLJ","","INIT","HLCSLM")
+8 LOCK -^HLCS(869.3,X,5)
+9 QUIT
TASKNUM(X) ;Look-up task number
+1 NEW %,DA,Y
+2 SET DA=X
+3 ;
+4 ;**109**
+5 ;F L +^HLCS(870,+DA,0):2 Q:$T
+6 ;
+7 SET Y=$$GET1^DIQ(870,DA_",",11)
+8 ;
+9 ;**109
+10 ;L -^HLCS(870,+DA,0)
+11 ;
+12 QUIT Y
STATUS(X) ;Status of task
+1 NEW Y,ZTSK
+2 SET ZTSK=X
+3 DO STAT^%ZTLOAD
+4 SET Y=ZTSK(1)
+5 QUIT Y
+6 ;
LLOK(X) ;Function to check whether LL ok.
+1 ;return value 1 = ok, 0 = not ok.
+2 if '$GET(X)
QUIT
+3 NEW HLDP,HLDP0,HLPARM4,HLTYPTR
+4 SET HLDP=+X
SET HLDP0=$GET(^HLCS(870,HLDP,0))
SET HLPARM4=$GET(^(400))
if HLDP0=""
QUIT 0
+5 ;must be a client
+6 if $PIECE(HLPARM4,U,3)'="C"
QUIT 0
+7 ;
+8 ; patch HL*1.6*123
+9 ;shutdown LLP must be 0
+10 ; Q:$P(HLDP0,U,15)'=0 0
+11 ; change to 1, in case the data is empty
+12 if $PIECE(HLDP0,U,15)=1
QUIT 0
+13 ;
+14 ;must have LLP Type of TCP
+15 SET HLTYPTR=+$PIECE(HLDP0,U,3)
if $PIECE($GET(^HLCS(869.1,HLTYPTR,0)),U)'="TCP"
QUIT 0
+16 QUIT 1
+17 ;
SAVTSK(X) ;
+1 NEW HLDP,HLJ
+2 SET HLDP=X
+3 ;
+4 ;**109**
+5 FOR
LOCK +^HLCS(870,HLDP,0):2
if $TEST
QUIT
+6 ;
+7 ;4=status,10=Time Stopped,9=Time Started,11=Task Number,3=Online ?
+8 SET X=$NAME(HLJ(870,HLDP_","))
SET @X@(11)=$GET(ZTSK)
+9 ;S HLJ(870,HLDP_",",11)=$G(ZTSK)
+10 ; HL*1.6*109
DO FILE^HLDIE("","HLJ","","SAVTSK","HLCSLM")
+11 SET HLTSKCNT(HLDP)=$GET(ZTSK)_"^"_$HOROLOG
+12 ;
+13 ;**109**
+14 LOCK -^HLCS(870,HLDP,0)
+15 ;
+16 QUIT
+17 ;
STRTSTOP ;ENTRY POINT TO START/STOP TCP LINK MANAGER
+1 NEW DIR,DIRUT,Y
+2 LOCK +^HLCS("HLCSLM"):3
IF '$TEST
Begin DoDot:1
+3 WRITE !,*7,"Link Manager already running!"
+4 WRITE !
SET DIR(0)="YO"
SET DIR("A")="Would you like to stop the Link Manager now"
SET DIR("B")="NO"
DO ^DIR
KILL DIR
+5 IF $DATA(DIRUT)!'Y
QUIT
+6 DO STOPLM
End DoDot:1
QUIT
+7 WRITE !,*7,"Link Manager is NOT currently running!"
+8 WRITE !
SET DIR(0)="YO"
SET DIR("A")="Would you like to start the Link Manager now"
SET DIR("B")="YES"
DO ^DIR
KILL DIR
+9 IF '$DATA(DIRUT)&Y
DO TASKLM
+10 LOCK -^HLCS("HLCSLM")
+11 QUIT
+12 ;
STOPLM ;ENTRY POINT TO STOP LINK MANAGER
+1 NEW DIC,X,Y,DTOUT,DUOUT,DLAYGO,DIE,DA,DR
+2 SET DIC="^HLCS(869.3,"
+3 SET X=1
+4 DO ^DIC
+5 SET DA=+Y
SET DIE=DIC
+6 SET DR="53////1"
+7 DO ^DIE
+8 WRITE !,"Link Manager has been asked to stop"
+9 QUIT
STAT() ;Status of LINK MANAGER--up, down or unable to determine.
+1 NEW %,DA,X,Y
+2 SET DA=1
+3 SET X=$$GET1^DIQ(869.3,DA_",",52)
+4 if X']""
QUIT 0
+5 SET X=$$GET1^DIQ(869.3,DA_",",54)
+6 if X']""
QUIT 0
+7 IF $$HDIFF^XLFDT($HOROLOG,X,2)>500
QUIT 0
+8 QUIT 1
+9 ;
TASKLSUB(X) ;Task LINK SUB-MANAGER.
+1 ;This may be a place to log the time which the LINK SUBMANAGER is tasked.
+2 NEW HLDP,HLDP0,HLDAPP,HLTYPTR,HLBGR,HLENV,HLPARM,HLPARM4,HLQUIT,ZTRTN,ZTDESC,ZTCPU,ZTSAVE
+3 ;ZTSK is not Newed here because it will be needed by SAVTSK.
+4 SET HLDP=X
SET HLDP0=$GET(^HLCS(870,HLDP,0))
SET HLPARM4=$GET(^(400))
+5 ; Q:"N"'[$P(HLPARM4,U,4) ; patch HL*1.6*123: comment out
+6 ;quit if no LLP TYPE
+7 SET HLDAPP=$PIECE(HLDP0,U)
SET HLTYPTR=$PIECE(HLDP0,U,3)
if 'HLTYPTR
QUIT
+8 SET HLBGR=$GET(^HLCS(869.1,HLTYPTR,100))
SET HLENV=$GET(^(200))
+9 IF HLENV'=""
KILL HLQUIT
XECUTE HLENV
if $DATA(HLQUIT)
QUIT
+10 SET ZTRTN="^HLCSLSM"
SET HLBGR=$PIECE(HLBGR," ",2)
+11 SET ZTDESC=HLDAPP_" Low Level Protocol"
SET ZTSAVE("HLDP")=""
SET ZTSAVE("HLBGR")=""
+12 SET ZTIO=""
SET ZTDTH=$HOROLOG
+13 ;get startup node
+14 IF $PIECE(HLPARM4,U,6)
IF $DATA(^%ZIS(14.7,+$PIECE(HLPARM4,U,6),0))
SET ZTCPU=$PIECE(^(0),U)
+15 DO ^%ZTLOAD
+16 ;HL*1.6*123
DO MON^HLCSTCP("Tasked")
+17 QUIT
+18 ;
TASKLM ;Task Link Manager
+1 ;Declare variables
+2 NEW ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSK,TMP
+3 SET ZTIO=""
+4 SET ZTDTH=$HOROLOG
+5 ;Task Link Manager
+6 SET ZTRTN="EN^HLCSLM"
+7 SET ZTDESC="HL7 Link Manager"
+8 ;Call TaskMan
+9 DO ^%ZTLOAD
+10 IF $GET(ZTSK)
WRITE !,"Link Manager queued as task number ",ZTSK
+11 IF '$TEST
WRITE $CHAR(7),!!,"Unable to start/restart Link Manager"
+12 QUIT
+13 ;
CKLMSTOP() ;Check whether Link Manager should stop
+1 NEW PTRMAIN,NODE5,STOP
+2 SET PTRMAIN=+$ORDER(^HLCS(869.3,0))
+3 LOCK +^HLCS(869.3,PTRMAIN,5):1
+4 IF $TEST
LOCK -^HLCS(869.3,PTRMAIN,5)
+5 SET NODE5=$GET(^HLCS(869.3,PTRMAIN,5))
+6 SET STOP=+$PIECE(NODE5,"^",3)
+7 if STOP
QUIT STOP
+8 SET STOP=$$S^%ZTLOAD
+9 QUIT STOP
+10 ;
SNDALERT ;Send Alert
+1 NEW XQA,XQAMSG,XQAOPT,XQAROU,XQAID,Z
+2 SET Z=$PIECE($$PARAM^HLCS2,U,8)
if Z=""
QUIT
+3 SET XQA("G."_Z)=""
SET XQAMSG="HL7 Logical Link "_$PIECE(^HLCS(870,HLDP,0),U)_" shutdown due to TaskMan unable to process task request"
+4 DO SETUP^XQALERT
+5 QUIT