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

HLCSGTM.m

Go to the documentation of this file.
  1. HLCSGTM ;OIFO-O/RWF - (TCP/IP) GT.M Linux ;08/13/2007
  1. ;;1.6;HEALTH LEVEL SEVEN;**122**;Oct 13, 1995;Build 14
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. ;
  1. ; 1. port number is input from VMS COM file, such as HLSxxxxDSM.COM,
  1. ; HLSxxxxCACHE.COM, or HLSxxxxGTM.COM file, where xxxx is port
  1. ; number.
  1. ; 2. find the ien of #870(logical link file) for the multi-listener
  1. Q
  1. ;
  1. IEN(HLPORT) ;
  1. ; HLIEN870: ien in #870 (logical link file)
  1. ; HLPRTS: port number in entry to be tested
  1. ;
  1. N HLPRTS,HLIEN870
  1. I '$G(HLPORT) D ^%ZTER Q
  1. S HLIEN870=0
  1. F S HLIEN870=$O(^HLCS(870,"E","M",HLIEN870)) Q:'HLIEN870 D Q:(HLPRTS=HLPORT)
  1. . S HLPRTS=$P(^HLCS(870,HLIEN870,400),"^",2)
  1. I 'HLIEN870 D ^%ZTER Q
  1. ;
  1. Q HLIEN870
  1. ;
  1. GTMLNX ; From Linux xinetd script
  1. ;Get port from ZSHOW "D"
  1. S U="^",$ZT="",$ET="D ^%ZTER HALT" ;Setup the error trap
  1. ; GTM specific code
  1. S IO=$P X "U IO:(nowrap:nodelimiter:IOERROR=""TRAP"")" ;Setup device
  1. S @("$ZINTERRUPT=""I $$JOBEXAM^ZU($ZPOSITION)""")
  1. K ^TMP($J) ZSHOW "D":^TMP($J)
  1. F %=1:1 Q:'$D(^TMP($J,"D",%)) S X=^(%) Q:X["LOCAL"
  1. S IO("IP")=$P($P(X,"REMOTE=",2),"@"),IO("PORT")=+$P($P(X,"LOCAL=",2),"@",2)
  1. S %=$P($ZTRNLNM("SSH_CLIENT")," ") S:%="" %=$ZTRNLNM("REMOTEHOST")
  1. S HLDP=$$IEN(IO("PORT"))
  1. ;
  1. D LISTEN^HLCSTCP
  1. Q
  1. ;
  1. ;Sample Linux script
  1. ;#!/bin/bash
  1. ;#HL7 Listener
  1. ;cd /home/vista/dev/
  1. ;. ./gtmprofile
  1. ;#env > hl7log.txt
  1. ;$gtm_dist/mumps -r GTMLNX^HLCSGTM
  1. ;exit 0
  1. ;
  1. ;Sample xinetd config file
  1. ;service hl7tcp
  1. ;{
  1. ; socket_type = stream
  1. ; user = gtmuser
  1. ; wait = no
  1. ; disable = no
  1. ; server = /bin/bash
  1. ; server_args = -l /home/vista/dev/hl7tcp.sh
  1. ; passenv = REMOTE_HOST
  1. ;}