HLOUSRA ;ALB/CJM -ListManager Screen for viewing downed links;12 JUN 1997 10:00 am ;07/23/2008
;;1.6;HEALTH LEVEL SEVEN;**130,138**;Oct 13, 1995;Build 34
;
S VALMSG="Down Client Links"
S VALMDDF("COL 2")="COL 2^20^20^Pending Messages^H"
S VALMDDF("COL 3")="COL 3^47^20^Date/Time Down^H"
K VALMDDF("COL 4"),VALMDDF("COL 5")
D CHGCAP^VALM("COL 1","Client Link")
Q
;
HELP ;Help code
S X="?" D DISP^XQORM1 W !!
Q
;
EXIT ;Exit code
D CLEAN^VALM10
D CLEAR^VALM1
S VALMBCK="R"
;
Q
;
DOWNLINK ;
D EN^VALM("HLO DOWN LINKS")
D:$L($G(HLRFRSH)) @HLRFRSH
Q
;
RESTART ;
;Allows the user to select a link and restarts HLO messages flowing to that domain.
N LINKARY
S VALMBCK="R"
;
S LINK=$$ASKLINK
Q:LINK=""
I $$GETLINK^HLOTLNK(LINK,.LINKARY) D
.I $$SETOPEN^HLOTLNK(LINKARY("IEN")) K ^HLTMP("FAILING LINKS",LINK_":"_LINKARY("PORT")) S VALMSG="HLO messages across "_LINKARY("NAME")_" have been started..."
.D LISTDOWN
Q
;
LISTDOWN ;
N LINK
D CLEAN^VALM10
S VALMCNT=0
S LINK=""
F S LINK=$O(^HLTMP("FAILING LINKS",LINK)) Q:LINK="" D
.N TIME,COUNT,QUE,LINKARY
.I $$GETLINK^HLOTLNK($P(LINK,":"),.LINKARY)
.S TIME=$G(^HLTMP("FAILING LINKS",LINK))
.I '$G(LINKARY("SHUTDOWN")),TIME="" Q
.I '$G(LINKARY("SHUTDOWN")),($$HDIFF^XLFDT($H,TIME,2)<300) Q
.S TIME=$$HTE^XLFDT(TIME)
.S COUNT=0
.S QUE=""
.F S QUE=$O(^HLC("QUEUECOUNT","OUT",LINK,QUE)) Q:QUE="" S COUNT=COUNT+$G(^HLC("QUEUECOUNT","OUT",LINK,QUE))
.S VALMCNT=VALMCNT+1
.S @VALMAR@(VALMCNT,0)=$$LJ(LINK,15)_$$RJ(COUNT,15)_" "_$$RJ(TIME,30)_" "_$S($G(LINKARY("SHUTDOWN")):"SHUTDOWN",1:"")
Q
;
STOPLINK ;
N LINK,LINKARY
S VALMBCK="R"
;
S LINK=$$ASKLINK
Q:LINK=""
I $$GETLINK^HLOTLNK(LINK,.LINKARY) D
.S LINK=LINK_":"_LINKARY("PORT")
.I $$SETSHUT^HLOTLNK(LINKARY("IEN")) S VALMSG="HLO messages across "_LINKARY("NAME")_" have been stopped..."
.S ^HLTMP("FAILING LINKS",LINK)=$G(^HLTMP("FAILING LINKS",LINK),$H)
.S ^HLB("QUEUE","OUT",LINK)=$H
.D LISTDOWN
Q
;
CJ(STRING,LEN) ;
Q $$CJ^XLFSTR($E(STRING,1,LEN),LEN)
LJ(STRING,LEN) ;
Q $$LJ^XLFSTR($E(STRING,1,LEN),LEN)
RJ(STRING,LEN) ;
Q $$RJ^XLFSTR($E(STRING,1,LEN),LEN)
;
ASKLINK() ;
;returns the name
N DIC,TCP,X,Y,DTOUT,DUOUT
S DIC=870
S DIC(0)="AENQ"
S TCP=$O(^HLCS(869.1,"B","TCP",0))
S DIC("A")="Select a TCP Client Link (Outgoing):"
S DIC("S")="I $P(^(0),U,3)=TCP,$P(^(400),U,3)=""C"""
D FULL^VALM1
D ^DIC
I +Y'=-1,'$D(DTOUT),'$D(DUOUT) Q $P(Y,"^",2)
Q ""
;
ASKPORT(LINKNAME) ;
Q:'$L($G(LINKNAME)) 0
N DIR,X,DTOUT,DUOUT,PORT
S DIR(0)="N^1:65535:0"
S DIR("A")="PORT"
S DIR("B")=$$PORT2^HLOTLNK(LINKNAME)
S DIR("?",1)="Enter to specify a port other than the one that this link is configured"
S DIR("?")="to normally use, otherwise just accept the default port."
D ^DIR
Q:$D(DTOUT)!$D(DUOUT) 0
Q X
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLOUSRA 2893 printed Oct 16, 2024@18:00:12 Page 2
HLOUSRA ;ALB/CJM -ListManager Screen for viewing downed links;12 JUN 1997 10:00 am ;07/23/2008
+1 ;;1.6;HEALTH LEVEL SEVEN;**130,138**;Oct 13, 1995;Build 34
+2 ;
+1 SET VALMSG="Down Client Links"
+2 SET VALMDDF("COL 2")="COL 2^20^20^Pending Messages^H"
+3 SET VALMDDF("COL 3")="COL 3^47^20^Date/Time Down^H"
+4 KILL VALMDDF("COL 4"),VALMDDF("COL 5")
+5 DO CHGCAP^VALM("COL 1","Client Link")
+6 QUIT
+7 ;
HELP ;Help code
+1 SET X="?"
DO DISP^XQORM1
WRITE !!
+2 QUIT
+3 ;
EXIT ;Exit code
+1 DO CLEAN^VALM10
+2 DO CLEAR^VALM1
+3 SET VALMBCK="R"
+4 ;
+5 QUIT
+6 ;
DOWNLINK ;
+1 DO EN^VALM("HLO DOWN LINKS")
+2 if $LENGTH($GET(HLRFRSH))
DO @HLRFRSH
+3 QUIT
+4 ;
RESTART ;
+1 ;Allows the user to select a link and restarts HLO messages flowing to that domain.
+2 NEW LINKARY
+3 SET VALMBCK="R"
+4 ;
+5 SET LINK=$$ASKLINK
+6 if LINK=""
QUIT
+7 IF $$GETLINK^HLOTLNK(LINK,.LINKARY)
Begin DoDot:1
+8 IF $$SETOPEN^HLOTLNK(LINKARY("IEN"))
KILL ^HLTMP("FAILING LINKS",LINK_":"_LINKARY("PORT"))
SET VALMSG="HLO messages across "_LINKARY("NAME")_" have been started..."
+9 DO LISTDOWN
End DoDot:1
+10 QUIT
+11 ;
LISTDOWN ;
+1 NEW LINK
+2 DO CLEAN^VALM10
+3 SET VALMCNT=0
+4 SET LINK=""
+5 FOR
SET LINK=$ORDER(^HLTMP("FAILING LINKS",LINK))
if LINK=""
QUIT
Begin DoDot:1
+6 NEW TIME,COUNT,QUE,LINKARY
+7 IF $$GETLINK^HLOTLNK($PIECE(LINK,":"),.LINKARY)
+8 SET TIME=$GET(^HLTMP("FAILING LINKS",LINK))
+9 IF '$GET(LINKARY("SHUTDOWN"))
IF TIME=""
QUIT
+10 IF '$GET(LINKARY("SHUTDOWN"))
IF ($$HDIFF^XLFDT($HOROLOG,TIME,2)<300)
QUIT
+11 SET TIME=$$HTE^XLFDT(TIME)
+12 SET COUNT=0
+13 SET QUE=""
+14 FOR
SET QUE=$ORDER(^HLC("QUEUECOUNT","OUT",LINK,QUE))
if QUE=""
QUIT
SET COUNT=COUNT+$GET(^HLC("QUEUECOUNT","OUT",LINK,QUE))
+15 SET VALMCNT=VALMCNT+1
+16 SET @VALMAR@(VALMCNT,0)=$$LJ(LINK,15)_$$RJ(COUNT,15)_" "_$$RJ(TIME,30)_" "_$SELECT($GET(LINKARY("SHUTDOWN")):"SHUTDOWN",1:"")
End DoDot:1
+17 QUIT
+18 ;
STOPLINK ;
+1 NEW LINK,LINKARY
+2 SET VALMBCK="R"
+3 ;
+4 SET LINK=$$ASKLINK
+5 if LINK=""
QUIT
+6 IF $$GETLINK^HLOTLNK(LINK,.LINKARY)
Begin DoDot:1
+7 SET LINK=LINK_":"_LINKARY("PORT")
+8 IF $$SETSHUT^HLOTLNK(LINKARY("IEN"))
SET VALMSG="HLO messages across "_LINKARY("NAME")_" have been stopped..."
+9 SET ^HLTMP("FAILING LINKS",LINK)=$GET(^HLTMP("FAILING LINKS",LINK),$HOROLOG)
+10 SET ^HLB("QUEUE","OUT",LINK)=$HOROLOG
+11 DO LISTDOWN
End DoDot:1
+12 QUIT
+13 ;
CJ(STRING,LEN) ;
+1 QUIT $$CJ^XLFSTR($EXTRACT(STRING,1,LEN),LEN)
LJ(STRING,LEN) ;
+1 QUIT $$LJ^XLFSTR($EXTRACT(STRING,1,LEN),LEN)
RJ(STRING,LEN) ;
+1 QUIT $$RJ^XLFSTR($EXTRACT(STRING,1,LEN),LEN)
+2 ;
ASKLINK() ;
+1 ;returns the name
+2 NEW DIC,TCP,X,Y,DTOUT,DUOUT
+3 SET DIC=870
+4 SET DIC(0)="AENQ"
+5 SET TCP=$ORDER(^HLCS(869.1,"B","TCP",0))
+6 SET DIC("A")="Select a TCP Client Link (Outgoing):"
+7 SET DIC("S")="I $P(^(0),U,3)=TCP,$P(^(400),U,3)=""C"""
+8 DO FULL^VALM1
+9 DO ^DIC
+10 IF +Y'=-1
IF '$DATA(DTOUT)
IF '$DATA(DUOUT)
QUIT $PIECE(Y,"^",2)
+11 QUIT ""
+12 ;
ASKPORT(LINKNAME) ;
+1 if '$LENGTH($GET(LINKNAME))
QUIT 0
+2 NEW DIR,X,DTOUT,DUOUT,PORT
+3 SET DIR(0)="N^1:65535:0"
+4 SET DIR("A")="PORT"
+5 SET DIR("B")=$$PORT2^HLOTLNK(LINKNAME)
+6 SET DIR("?",1)="Enter to specify a port other than the one that this link is configured"
+7 SET DIR("?")="to normally use, otherwise just accept the default port."
+8 DO ^DIR
+9 if $DATA(DTOUT)!$DATA(DUOUT)
QUIT 0
+10 QUIT X