XOBUM1 ;; ld,mjk/alb - Foundations Manager ; 07/27/2002 13:00
;;1.6;Foundations;;May 08, 2009;Build 15
;Per VHA directive 2004-038, this routine should not be modified.
;
START(XOBPORT) ;-- Entry point to start a single VistALink Listener
;
; This procedure will start the VistALink Listener on a specific port. The port number is optional
; and will be validated if passed to this procedure. If the port is not passed, the user will be
; prompted for a port number.
;
; Input:
; XOBPORT - Port number for the Listener (optional)
;
; Output:
; None
;
NEW XOBTASK,Y,XOBOK
;
;-- Reset I/O variables
SET U="^" DO HOME^%ZIS
;
DO
. ;
. ;-- Check operating system
. IF '$$CHKOS() SET XOBOK=0 QUIT
. ;
. ;-- Validate/prompt for port
. IF '$$VALID($GET(XOBPORT)) SET XOBPORT=$$GETPORT("start")
. IF 'XOBPORT SET XOBOK=0 QUIT
. ;
. ;-- Wait msg to user
. DO WAIT^DICD WRITE !
. ;
. ;-- Check if Listener is running on port
. IF '$$LOCK^XOBVTCP(XOBPORT) DO QUIT
. . DO EN^DDIOL("VistALink Listener on port "_XOBPORT_" appears to be running already.")
. . SET XOBOK=0
. ;
. ;-- Lock was successful; unlock and queue the listener to startup
. DO UNLOCK^XOBVTCP(XOBPORT)
. DO UPDATE^XOBVTCP(XOBPORT,1)
. SET XOBOK=$$START^XOBVTCP(XOBPORT)
. IF 'XOBOK DO
. . DO UPDATE^XOBVTCP(XOBPORT,5)
. . DO EN^DDIOL("Unable to start VistALink Listener on port "_XOBPORT_".")
;
QUIT XOBOK
;
;
CHKOS() ;-- Check operating system
;
; This function will determine which operating system is being used.
;
; Input:
; None
;
; Output:
; Function value - returns 1 on success, 0 on failure
;
NEW OPERSYS,RESULT
;
SET RESULT=0
;
;-- Get operating system
SET OPERSYS=$$GETOS^XOBVTCP()
;
DO
. IF OPERSYS="OpenM-NT" DO QUIT
.. DO EN^DDIOL("Starting VistALink Listener...")
.. SET RESULT=1
. ;
. IF OPERSYS["DSM" DO EN^DDIOL("Use the TCPIP utility in VMS to enable the VistALink Listener.") QUIT
. ;
. ;-- All other operating systems
. DO EN^DDIOL("Starting the VistALink Listener is not yet supported for "_OPERSYS_".") QUIT
. ;
QUIT RESULT
;
;
VALID(XOBPORT) ;-- Validate port
;
; This function will validate a port number passed in.
;
; Input:
; XOBPORT - Port number for the Listener (Optional)
;
; Output:
; Function value - returns 1 if valid, 0 otherwise
;
NEW RESULT
;
SET XOBPORT=+$GET(XOBPORT)
SET RESULT=0
;
;-- Check if port is not defined or invalid
DO ; Drops out of block on failure
. QUIT:XOBPORT=0
. QUIT:(XOBPORT?.AP)
. QUIT:XOBPORT<5000!(XOBPORT>65535)
. SET RESULT=1
QUIT RESULT
;
;
GETPORT(XOBST) ;-- Prompt user for port number
;
; This function will prompt the user for a valid port number.
;
; Input:
; XOBST - start = start Listener
; stop = stop Listener
;
; Output:
; Function value - returns port # or zero
;
NEW DIR,DIRUT,PORT
SET XOBST=$GET(XOBST)
;
SET DIR(0)="NA^5000:65535"
SET DIR("A")="Enter Port: "
SET DIR("B")=8000 ; Default port is 8000
SET DIR("?")="Choose a numeric port to "_XOBST_" the VistALink Listener on in the range of 5000-65535."
DO ^DIR KILL DIR
IF $DATA(DIRUT) DO
. DO EN^DDIOL("Port not specified. VistALink Listener not "_$SELECT(XOBST="start":"started",1:"stopped")_".")
. SET PORT=0
ELSE SET PORT=+$GET(Y)
;
QUIT PORT
;
;
BOX() ; -- start this BOX-VOl default configuration
NEW XOBOX
IF $$CHKOS^XOBUM1() DO
. SET XOBOK=1
. DO WAIT^DICD WRITE !
. DO STARTCFG^XOBVTCP($$GETCFG^XOBVTCP())
ELSE DO
. SET XOBOK=0
QUIT XOBOK
;
;
STOP(LOGDA) ; -- stop a listener
NEW Y,X,LOG0,XOBBOX,XOBPORT,XONCFG,XOBSTAT,XOBOK,XOBCFG
SET XOBOK=0
;
SET LOG0=$GET(^XOB(18.04,LOGDA,0))
SET XOBBOX=$PIECE(LOG0,U)
SET XOBPORT=$PIECE(LOG0,U,2)
SET XOBSTAT=$PIECE(LOG0,U,3)
SET XOBCFG=$PIECE(LOG0,U,6)
;
; -- must be valid entry with a running status
IF XOBPORT,XOBSTAT=2 DO
. DO UPDLOG^XOBVTCP(LOGDA,XOBPORT,3,XOBCFG)
. SET XOBOK=1
ELSE DO
. SET XOBOK=0_U_"Listener is not running!"
;
QUIT XOBOK
;
PARMS() ; -- maintain site parameters
NEW DIC,X,Y,DR,DA,DIE,XOBOK
SET XOBOK=0
;
IF $GET(^XOB(18.01,1,0))["" DO
. SET DA=1,DR="[XOBU SITE PARAMETERS]",DIE="^XOB(18.01," DO ^DIE
. SET XOBOK=1
ELSE DO
. SET XOBOK=0_U_"Error: Site parameter file not initialized."
;
QUIT XOBOK
;
CFG() ; -- listener configuration edit
NEW DIC,X,Y,DR,DA,DIE,XOBDONE,XOBOK
SET XOBOK=0
;
SET XOBDONE=0
;
FOR DO QUIT:XOBDONE
. WRITE !
. SET DIC="^XOB(18.03,",DIC(0)="AEMLQ" DO ^DIC
. IF Y<1 SET XOBDONE=1 QUIT
. SET DA=+Y,DR="[XOBV LISTENER CONFIG EDIT]",DIE="^XOB(18.03," DO ^DIE
SET XOBOK=1
;
QUIT XOBOK
;
CP() ; -- add a connector proxy
NEW XOBOK
SET XOBOK=0
DO CONT^XUSAP
SET XOBOK=1
QUIT XOBOK
;
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HXOBUM1 4926 printed Dec 13, 2024@01:55:03 Page 2
XOBUM1 ;; ld,mjk/alb - Foundations Manager ; 07/27/2002 13:00
+1 ;;1.6;Foundations;;May 08, 2009;Build 15
+2 ;Per VHA directive 2004-038, this routine should not be modified.
+3 ;
START(XOBPORT) ;-- Entry point to start a single VistALink Listener
+1 ;
+2 ; This procedure will start the VistALink Listener on a specific port. The port number is optional
+3 ; and will be validated if passed to this procedure. If the port is not passed, the user will be
+4 ; prompted for a port number.
+5 ;
+6 ; Input:
+7 ; XOBPORT - Port number for the Listener (optional)
+8 ;
+9 ; Output:
+10 ; None
+11 ;
+12 NEW XOBTASK,Y,XOBOK
+13 ;
+14 ;-- Reset I/O variables
+15 SET U="^"
DO HOME^%ZIS
+16 ;
+17 Begin DoDot:1
+18 ;
+19 ;-- Check operating system
+20 IF '$$CHKOS()
SET XOBOK=0
QUIT
+21 ;
+22 ;-- Validate/prompt for port
+23 IF '$$VALID($GET(XOBPORT))
SET XOBPORT=$$GETPORT("start")
+24 IF 'XOBPORT
SET XOBOK=0
QUIT
+25 ;
+26 ;-- Wait msg to user
+27 DO WAIT^DICD
WRITE !
+28 ;
+29 ;-- Check if Listener is running on port
+30 IF '$$LOCK^XOBVTCP(XOBPORT)
Begin DoDot:2
+31 DO EN^DDIOL("VistALink Listener on port "_XOBPORT_" appears to be running already.")
+32 SET XOBOK=0
End DoDot:2
QUIT
+33 ;
+34 ;-- Lock was successful; unlock and queue the listener to startup
+35 DO UNLOCK^XOBVTCP(XOBPORT)
+36 DO UPDATE^XOBVTCP(XOBPORT,1)
+37 SET XOBOK=$$START^XOBVTCP(XOBPORT)
+38 IF 'XOBOK
Begin DoDot:2
+39 DO UPDATE^XOBVTCP(XOBPORT,5)
+40 DO EN^DDIOL("Unable to start VistALink Listener on port "_XOBPORT_".")
End DoDot:2
End DoDot:1
+41 ;
+42 QUIT XOBOK
+43 ;
+44 ;
CHKOS() ;-- Check operating system
+1 ;
+2 ; This function will determine which operating system is being used.
+3 ;
+4 ; Input:
+5 ; None
+6 ;
+7 ; Output:
+8 ; Function value - returns 1 on success, 0 on failure
+9 ;
+10 NEW OPERSYS,RESULT
+11 ;
+12 SET RESULT=0
+13 ;
+14 ;-- Get operating system
+15 SET OPERSYS=$$GETOS^XOBVTCP()
+16 ;
+17 Begin DoDot:1
+18 IF OPERSYS="OpenM-NT"
Begin DoDot:2
+19 DO EN^DDIOL("Starting VistALink Listener...")
+20 SET RESULT=1
End DoDot:2
QUIT
+21 ;
+22 IF OPERSYS["DSM"
DO EN^DDIOL("Use the TCPIP utility in VMS to enable the VistALink Listener.")
QUIT
+23 ;
+24 ;-- All other operating systems
+25 DO EN^DDIOL("Starting the VistALink Listener is not yet supported for "_OPERSYS_".")
QUIT
+26 ;
End DoDot:1
+27 QUIT RESULT
+28 ;
+29 ;
VALID(XOBPORT) ;-- Validate port
+1 ;
+2 ; This function will validate a port number passed in.
+3 ;
+4 ; Input:
+5 ; XOBPORT - Port number for the Listener (Optional)
+6 ;
+7 ; Output:
+8 ; Function value - returns 1 if valid, 0 otherwise
+9 ;
+10 NEW RESULT
+11 ;
+12 SET XOBPORT=+$GET(XOBPORT)
+13 SET RESULT=0
+14 ;
+15 ;-- Check if port is not defined or invalid
+16 ; Drops out of block on failure
Begin DoDot:1
+17 if XOBPORT=0
QUIT
+18 if (XOBPORT?.AP)
QUIT
+19 if XOBPORT<5000!(XOBPORT>65535)
QUIT
+20 SET RESULT=1
End DoDot:1
+21 QUIT RESULT
+22 ;
+23 ;
GETPORT(XOBST) ;-- Prompt user for port number
+1 ;
+2 ; This function will prompt the user for a valid port number.
+3 ;
+4 ; Input:
+5 ; XOBST - start = start Listener
+6 ; stop = stop Listener
+7 ;
+8 ; Output:
+9 ; Function value - returns port # or zero
+10 ;
+11 NEW DIR,DIRUT,PORT
+12 SET XOBST=$GET(XOBST)
+13 ;
+14 SET DIR(0)="NA^5000:65535"
+15 SET DIR("A")="Enter Port: "
+16 ; Default port is 8000
SET DIR("B")=8000
+17 SET DIR("?")="Choose a numeric port to "_XOBST_" the VistALink Listener on in the range of 5000-65535."
+18 DO ^DIR
KILL DIR
+19 IF $DATA(DIRUT)
Begin DoDot:1
+20 DO EN^DDIOL("Port not specified. VistALink Listener not "_$SELECT(XOBST="start":"started",1:"stopped")_".")
+21 SET PORT=0
End DoDot:1
+22 IF '$TEST
SET PORT=+$GET(Y)
+23 ;
+24 QUIT PORT
+25 ;
+26 ;
BOX() ; -- start this BOX-VOl default configuration
+1 NEW XOBOX
+2 IF $$CHKOS^XOBUM1()
Begin DoDot:1
+3 SET XOBOK=1
+4 DO WAIT^DICD
WRITE !
+5 DO STARTCFG^XOBVTCP($$GETCFG^XOBVTCP())
End DoDot:1
+6 IF '$TEST
Begin DoDot:1
+7 SET XOBOK=0
End DoDot:1
+8 QUIT XOBOK
+9 ;
+10 ;
STOP(LOGDA) ; -- stop a listener
+1 NEW Y,X,LOG0,XOBBOX,XOBPORT,XONCFG,XOBSTAT,XOBOK,XOBCFG
+2 SET XOBOK=0
+3 ;
+4 SET LOG0=$GET(^XOB(18.04,LOGDA,0))
+5 SET XOBBOX=$PIECE(LOG0,U)
+6 SET XOBPORT=$PIECE(LOG0,U,2)
+7 SET XOBSTAT=$PIECE(LOG0,U,3)
+8 SET XOBCFG=$PIECE(LOG0,U,6)
+9 ;
+10 ; -- must be valid entry with a running status
+11 IF XOBPORT
IF XOBSTAT=2
Begin DoDot:1
+12 DO UPDLOG^XOBVTCP(LOGDA,XOBPORT,3,XOBCFG)
+13 SET XOBOK=1
End DoDot:1
+14 IF '$TEST
Begin DoDot:1
+15 SET XOBOK=0_U_"Listener is not running!"
End DoDot:1
+16 ;
+17 QUIT XOBOK
+18 ;
PARMS() ; -- maintain site parameters
+1 NEW DIC,X,Y,DR,DA,DIE,XOBOK
+2 SET XOBOK=0
+3 ;
+4 IF $GET(^XOB(18.01,1,0))[""
Begin DoDot:1
+5 SET DA=1
SET DR="[XOBU SITE PARAMETERS]"
SET DIE="^XOB(18.01,"
DO ^DIE
+6 SET XOBOK=1
End DoDot:1
+7 IF '$TEST
Begin DoDot:1
+8 SET XOBOK=0_U_"Error: Site parameter file not initialized."
End DoDot:1
+9 ;
+10 QUIT XOBOK
+11 ;
CFG() ; -- listener configuration edit
+1 NEW DIC,X,Y,DR,DA,DIE,XOBDONE,XOBOK
+2 SET XOBOK=0
+3 ;
+4 SET XOBDONE=0
+5 ;
+6 FOR
Begin DoDot:1
+7 WRITE !
+8 SET DIC="^XOB(18.03,"
SET DIC(0)="AEMLQ"
DO ^DIC
+9 IF Y<1
SET XOBDONE=1
QUIT
+10 SET DA=+Y
SET DR="[XOBV LISTENER CONFIG EDIT]"
SET DIE="^XOB(18.03,"
DO ^DIE
End DoDot:1
if XOBDONE
QUIT
+11 SET XOBOK=1
+12 ;
+13 QUIT XOBOK
+14 ;
CP() ; -- add a connector proxy
+1 NEW XOBOK
+2 SET XOBOK=0
+3 DO CONT^XUSAP
+4 SET XOBOK=1
+5 QUIT XOBOK
+6 ;