HLOT ;IRMFO-ALB/CJM - Services provided by the transport layer;03/24/2004 14:43 ;02/18/2011
;;1.6;HEALTH LEVEL SEVEN;**126,131,139,146,155**;Oct 13, 1995;Build 4
;Per VHA Directive 2004-038, this routine should not be modified.
;
;**NOTE: tags of the format ZB* are used by the client-trace debugging tool and should not be removed
;
READHDR(HLCSTATE,HDR) ;
ZB10 N SUCCESS,SEG
N MCODE
S HLCSTATE("MESSAGE ENDED")=0
;**START P139 CJM
S HLCSTATE("MESSAGE STARTED")=0
;**END P139
S MCODE="S SUCCESS=$$"_HLCSTATE("READ HEADER")_"(.HLCSTATE,.HDR)"
X MCODE
;**START P139 CJM
I SUCCESS S HLCSTATE("MESSAGE STARTED")=1
;**END P139
ZB11 Q SUCCESS
;
READSEG(HLCSTATE,SEG) ;
ZB12 N RETURN
N MCODE
S MCODE="S RETURN=$$"_HLCSTATE("READ SEGMENT")_"(.HLCSTATE,.SEG)"
X MCODE
ZB13 Q RETURN
;
OPEN(HLCSTATE) ;
N MCODE
S HLCSTATE("CONNECTED")=0
Q:'$L(HLCSTATE("OPEN"))
I $G(HLCSTATE("LINK","SINGLE THREADED")) D Q:HLCSTATE("LOCK FAILED")
.S HLCSTATE("LOCK FAILED")=0
.L +^HLO("OPEN LINK",HLCSTATE("LINK","NAME")_":"_HLCSTATE("LINK","PORT")):5
.I '$T S HLCSTATE("LOCK FAILED")=1 D
..Q:'HLCSTATE("LOCK FAILED")
ZB27 ..;
..;
;
S MCODE="D "_HLCSTATE("OPEN")_"(.HLCSTATE)"
X MCODE
I $G(HLCSTATE("LINK","SINGLE THREADED")),'HLCSTATE("CONNECTED") L -^HLO("OPEN LINK",HLCSTATE("LINK","NAME")_":"_HLCSTATE("LINK","PORT"))
Q
;
CLOSE(HLCSTATE) ;
N MCODE
S MCODE="D "_HLCSTATE("CLOSE")_"(.HLCSTATE)"
X MCODE
I $G(HLCSTATE("LINK","SINGLE THREADED")) L -^HLO("OPEN LINK",HLCSTATE("LINK","NAME")_":"_HLCSTATE("LINK","PORT"))
;
S HLCSTATE("CONNECTED")=0
Q
;
WRITESEG(HLCSTATE,SEG) ;
ZB14 N RETURN
N MCODE
S MCODE="S RETURN=$$"_HLCSTATE("WRITE SEGMENT")_"(.HLCSTATE,.SEG)"
X MCODE
ZB15 Q RETURN
;
WRITEHDR(HLCSTATE,HDR) ;
ZB16 N SUCCESS
N MCODE
S MCODE="S SUCCESS=$$"_HLCSTATE("WRITE HEADER")_"(.HLCSTATE,.HDR)"
X MCODE
ZB17 Q SUCCESS
;
ENDMSG(HLCSTATE) ;
ZB18 N RETURN
N MCODE
S MCODE="S RETURN=$$"_HLCSTATE("END MESSAGE")_"(.HLCSTATE)"
X MCODE
ZB19 Q RETURN
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHLOT 2055 printed Oct 16, 2024@18:00:01 Page 2
HLOT ;IRMFO-ALB/CJM - Services provided by the transport layer;03/24/2004 14:43 ;02/18/2011
+1 ;;1.6;HEALTH LEVEL SEVEN;**126,131,139,146,155**;Oct 13, 1995;Build 4
+2 ;Per VHA Directive 2004-038, this routine should not be modified.
+3 ;
+4 ;**NOTE: tags of the format ZB* are used by the client-trace debugging tool and should not be removed
+5 ;
READHDR(HLCSTATE,HDR) ;
ZB10 NEW SUCCESS,SEG
+1 NEW MCODE
+2 SET HLCSTATE("MESSAGE ENDED")=0
+3 ;**START P139 CJM
+4 SET HLCSTATE("MESSAGE STARTED")=0
+5 ;**END P139
+6 SET MCODE="S SUCCESS=$$"_HLCSTATE("READ HEADER")_"(.HLCSTATE,.HDR)"
+7 XECUTE MCODE
+8 ;**START P139 CJM
+9 IF SUCCESS
SET HLCSTATE("MESSAGE STARTED")=1
+10 ;**END P139
ZB11 QUIT SUCCESS
+1 ;
READSEG(HLCSTATE,SEG) ;
ZB12 NEW RETURN
+1 NEW MCODE
+2 SET MCODE="S RETURN=$$"_HLCSTATE("READ SEGMENT")_"(.HLCSTATE,.SEG)"
+3 XECUTE MCODE
ZB13 QUIT RETURN
+1 ;
OPEN(HLCSTATE) ;
+1 NEW MCODE
+2 SET HLCSTATE("CONNECTED")=0
+3 if '$LENGTH(HLCSTATE("OPEN"))
QUIT
+4 IF $GET(HLCSTATE("LINK","SINGLE THREADED"))
Begin DoDot:1
+5 SET HLCSTATE("LOCK FAILED")=0
+6 LOCK +^HLO("OPEN LINK",HLCSTATE("LINK","NAME")_":"_HLCSTATE("LINK","PORT")):5
+7 IF '$TEST
SET HLCSTATE("LOCK FAILED")=1
Begin DoDot:2
+8 if 'HLCSTATE("LOCK FAILED")
QUIT
ZB27 ;
+1 ;
End DoDot:2
End DoDot:1
if HLCSTATE("LOCK FAILED")
QUIT
+2 ;
+3 SET MCODE="D "_HLCSTATE("OPEN")_"(.HLCSTATE)"
+4 XECUTE MCODE
+5 IF $GET(HLCSTATE("LINK","SINGLE THREADED"))
IF 'HLCSTATE("CONNECTED")
LOCK -^HLO("OPEN LINK",HLCSTATE("LINK","NAME")_":"_HLCSTATE("LINK","PORT"))
+6 QUIT
+7 ;
CLOSE(HLCSTATE) ;
+1 NEW MCODE
+2 SET MCODE="D "_HLCSTATE("CLOSE")_"(.HLCSTATE)"
+3 XECUTE MCODE
+4 IF $GET(HLCSTATE("LINK","SINGLE THREADED"))
LOCK -^HLO("OPEN LINK",HLCSTATE("LINK","NAME")_":"_HLCSTATE("LINK","PORT"))
+5 ;
+6 SET HLCSTATE("CONNECTED")=0
+7 QUIT
+8 ;
WRITESEG(HLCSTATE,SEG) ;
ZB14 NEW RETURN
+1 NEW MCODE
+2 SET MCODE="S RETURN=$$"_HLCSTATE("WRITE SEGMENT")_"(.HLCSTATE,.SEG)"
+3 XECUTE MCODE
ZB15 QUIT RETURN
+1 ;
WRITEHDR(HLCSTATE,HDR) ;
ZB16 NEW SUCCESS
+1 NEW MCODE
+2 SET MCODE="S SUCCESS=$$"_HLCSTATE("WRITE HEADER")_"(.HLCSTATE,.HDR)"
+3 XECUTE MCODE
ZB17 QUIT SUCCESS
+1 ;
ENDMSG(HLCSTATE) ;
ZB18 NEW RETURN
+1 NEW MCODE
+2 SET MCODE="S RETURN=$$"_HLCSTATE("END MESSAGE")_"(.HLCSTATE)"
+3 XECUTE MCODE
ZB19 QUIT RETURN