Issue Sending HL7 Message from Mirth to VistA.

576 views
Skip to first unread message

Jason

unread,
Oct 15, 2012, 4:16:22 PM10/15/12
to hard...@googlegroups.com
Hello,

I am trying to set up Mirth to send an ADT^A04 message to VistA. We are using the one directly from VA (not openVistA or worldVistA). I found a guide from https://medsphere.org/docs/DOC-1764 and another guide from jhthurber and followed the set up instructions for listeners, application parameters, event driver / subs etc. Now I am at a point that I can send a HL7 message from Mirth to VistA's listening port. Mirth shows that the message has been sent but I couldn't find the message in VistA through inquiring file entries to HL7 message file 772 / 773. d ^XTER also didn't find any error. So I am not sure where to go next... Any comment will be greatly appreciated.

Here is my listener:

hl7tcp
service hl7tcp
 {
disable = no
        port = 9240
        socket_type = stream
        protocol = tcp
        user = ehruser
        server = /home/ehruser/VistA/common/bin/hl7tcp.sh 
        type = UNLISTED
        wait = no
groups = yes
  }

hl7tcp.sh
#!/bin/bash
#HL7 Listener
source /etc/profile.d/gtmprofile.sh
date >> /home/ehruser/VistA/logs/hl7tcp.log
$gtm_dist/mumps -run GTMLNX^HLCSGTM 2>>/home/ehruser/VistA/logs/hl7tcp.log

[ehruser@s3-VistA-Dev r]$ netstat -al | grep 9240
tcp        0      0 *:9240                      *:*                         LISTEN 

However, when I tried telnet it, the connection was established and then restored:
[ehruser@s3-VistA-Dev r]$ telnet localhost 9240
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
Connection closed by foreign host.

I am not sure if this telnet behavior points to an issue or not (and how to fix it).

I tried to modify GTMLNX^HLCSGTM and add a simple debug global there:
GTMLNX ; From Linux xinetd script
 ;Get port from ZSHOW "D"
 s ^JSTEST(1)=$h_"TEST"
 S U="^",$ZT="",$ET="D ^%ZTER HALT" ;Setup the error trap
 ; GTM specific code
 S IO=$P X "U IO:(nowrap:nodelimiter:IOERROR=""TRAP"")" ;Setup device
 S @("$ZINTERRUPT=""I $$JOBEXAM^ZU($ZPOSITION)""")
 K ^TMP($J) ZSHOW "D":^TMP($J)
 F %=1:1 Q:'$D(^TMP($J,"D",%))  S X=^(%) Q:X["LOCAL"
 S IO("IP")=$P($P(X,"REMOTE=",2),"@"),IO("PORT")=+$P($P(X,"LOCAL=",2),"@",2)
 S %=$P($ZTRNLNM("SSH_CLIENT")," ") S:%="" %=$ZTRNLNM("REMOTEHOST")
 S HLDP=$$IEN(IO("PORT"))
 ;
 D LISTEN^HLCSTCP
 Q

Then I sent a few messages from Mirth to VistA. However, JSTEST is never set.
UTF8>zwr ^JSTEST  
%GTM-E-GVUNDEF, Global variable undefined: ^JSTEST

The other thing I noticed that is in /home/ehruser/VistA/logs/hl7tcp.log there are some errors like:
Mon Oct 15 16:12:15 EDT 2012
%GTM-E-NONUTF8LOCALE, Locale has character encoding (ISO-8859-1) which is not compatible with UTF-8 character set
I am not sure if this points to an issue or not (and how to fix it).

Again I am at lost and don't know where to go next. Any comments will be greatly appreciated.

thanks!

Jason

Thurber, Joe

unread,
Oct 15, 2012, 4:25:54 PM10/15/12
to hard...@googlegroups.com

One thing you might do is watch the link in HL7 Main Menu/Systems Link Monitor to see if you are actually receiving in VistA and that you are properly acknowledging that received message…

 





Email correspondence to and from this address is subject to the North Carolina Public Records Law and may be disclosed to third parties by an authorized State official. Unauthorized disclosure of juvenile, health, legally privileged, or otherwise confidential information, including confidential information relating to an ongoing State procurement effort, is prohibited by law. If you have received this e-mail in error, please notify the sender immediately and delete all records of this e-mail.

Jason

unread,
Oct 15, 2012, 4:34:58 PM10/15/12
to hard...@googlegroups.com
Thanks - I looked at that but couldn't find the messages.
                   SYSTEM LINK MONITOR for SOFTWARE SERVICE (T System)
                MESSAGES  MESSAGES   MESSAGES  MESSAGES  DEVICE  
     NODE       RECEIVED  PROCESSED  TO SEND   SENT      TYPE     STATE   

    MIRTH R     165       165        165       165        MS     0 server  
 Incoming filers running => 1            TaskMan running 
     Outgoing filers running => 1            Link Manager running
                                             Monitor OVERDUE

MIRTH R is the Logical Link Node that I used:
                         HL7 LOGICAL LINK
--------------------------------------------------------------------------------
                NODE: MIRTH R                        DESCRIPTION:
         INSTITUTION:
      MAILMAN DOMAIN:
           AUTOSTART: Enabled 
          QUEUE SIZE: 10    
            LLP TYPE: TCP                           
          DNS DOMAIN:
                                                                         
                          HL7 LOGICAL LINK
--------------------------------------------------------------------------------
  ┌──────────────────────TCP LOWER LEVEL PARAMETERS─────────────────────────┐
  │                      MIRTH R                                            │
  │                                                                         │
  │  TCP/IP SERVICE TYPE: MULTI LISTENER                                    │
  │       TCP/IP ADDRESS:                                                   │
  │          TCP/IP PORT: 9240                                              │
  │          TCP/IP PORT (OPTIMIZED):                                       │
  │                                                                         │
  │   ACK TIMEOUT:                       RE-TRANSMISION ATTEMPTS: 5         │
  │  READ TIMEOUT:                     EXCEED RE-TRANSMIT ACTION:           │
  │    BLOCK SIZE:                                      SAY HELO:           │
  │                                      TCP/IP OPENFAIL TIMEOUT:           │
  │STARTUP NODE:                                      PERSISTENT: YES       │
  │   RETENTION:                            UNI-DIRECTIONAL WAIT:   


However, those "165" messages were somehow previously received this spring. I can't find my messages.

The other thing that I am confused is that we have HL7 Main Menu and also HLO Main Menu. Which one should be used?

thanks,

Jason
Message has been deleted

David Whitten

unread,
Oct 15, 2012, 5:00:51 PM10/15/12
to hard...@googlegroups.com
It is very unlikely that you want to use the HLO menu, and rather likely you want to use the HL7 one.

One thing you might do is watch the link in HL7 Main Menu/Systems Link Monitor to see if you are actually receiving in VistA and that you are properly acknowledging that received message…

--

Jason

unread,
Oct 15, 2012, 11:31:18 PM10/15/12
to hard...@googlegroups.com
Thanks.

One thing I don't quite understand - do I need to do any additional set up for the incoming message to reach this logical link(MIRTH R) that I built? I am not even sure if this link is running properly or not.

And as I mentioned above, I tried to set a debug global at GTMLNX^HLCSGTM but that never get assigned any value. So it appears that there might be something else that's not working?

The telnet got connected and then automatically closed - I suspect something wrong there but not sure what.


Jason

Jason

unread,
Oct 15, 2012, 11:44:25 PM10/15/12
to hard...@googlegroups.com
Looking at the shell script further:

hl7tcp.sh
#!/bin/bash
#HL7 Listener
source /etc/profile.d/gtmprofile.sh
date >> /home/ehruser/VistA/logs/hl7tcp.log
$gtm_dist/mumps -run GTMLNX^HLCSGTM 2>>/home/ehruser/VistA/logs/hl7tcp.log

when I tried telnet localhost 9240 I can see that the date was written to the log file: "Mon Oct 15 23:32:53 EDT 2012", which means the line "date >> /home/ehruser/VistA/logs/hl7tcp.log" gets executed. However, the following line "$gtm_dist/mumps -run GTMLNX^HLCSGTM 2>>/home/ehruser/VistA/logs/hl7tcp.log" seems not being executed (I set a debug global 's ^JSTEST(1)=$h_"TEST" at the beginning and after telnet the port I don't see this global get assigned any value by checking 'zwr ^JSTEST'). This sounds strange. And there's no error in the log...

Does anyone know if there is a way for me to modify this line so if the GTM routine is not executed (or executed but error out half way), I can see what the error is in the log file?

thanks,

Jason

Nancy Anthracite

unread,
Oct 15, 2012, 11:54:30 PM10/15/12
to hard...@googlegroups.com, Jason
Instead of

source /etc/profile.d/gtmprofile.sh

try
. /etc/profile.d/gtmprofile.sh


--
Nancy Anthracite

On Monday, October 15, 2012, Jason wrote:
> Looking at the shell script further:
>
> *hl7tcp.sh*
> >>> ------------------------------**------------------------------**
> >>> --------------------
> >>>
> >>> NODE: MIRTH R DESCRIPTION:
> >>> INSTITUTION:
> >>> MAILMAN DOMAIN:
> >>> AUTOSTART: Enabled
> >>>
> >>> QUEUE SIZE: 10
> >>>
> >>> LLP TYPE: TCP
> >>>
> >>> DNS DOMAIN:
> >>> HL7 LOGICAL LINK
> >>>
> >>> ------------------------------**------------------------------**
> >>> --------------------
> >>>
> >>> ┌──────────────────────TCP LOWER LEVEL
> >>> PARAMETERS────────────────────*
> >>>
> >>> *─────┐
> >>>
> >>> │ MIRTH R
> >>>
> >>> │
> >>>
> >>> │
> >>>
> >>> │
> >>>
> >>> │ TCP/IP SERVICE TYPE: MULTI LISTENER
> >>>
> >>> │
> >>>
> >>> │ TCP/IP ADDRESS:
> >>> │
> >>>
> >>> │ TCP/IP PORT: 9240
> >>>
> >>> │
> >>>
> >>> │ TCP/IP PORT (OPTIMIZED):
> >>> │
> >>>
> >>> │
> >>>
> >>> │
> >>>
> >>> │ ACK TIMEOUT: RE-TRANSMISION ATTEMPTS: 5
> >>>
> >>> │
> >>>
> >>> │ READ TIMEOUT: EXCEED RE-TRANSMIT ACTION:
> >>> │
> >>>
> >>> │ BLOCK SIZE: SAY HELO:
> >>> │
> >>>
> >>> │ TCP/IP OPENFAIL TIMEOUT:
> >>> │
> >>>
> >>> │STARTUP NODE: PERSISTENT: YES
> >>>
> >>> │
> >>>
> >>> │ RETENTION: UNI-DIRECTIONAL WAIT:
> >>> However, those "165" messages were somehow previously received this
> >>> spring. I can't find my messages.
> >>>
> >>> The other thing that I am confused is that we have HL7 Main Menu and
> >>> also HLO Main Menu. Which one should be used?
> >>>
> >>> thanks,
> >>>
> >>> Jason
> >>>
> >>> On Monday, October 15, 2012 4:26:00 PM UTC-4, JHT wrote:
> >>>> One thing you might do is watch the link in HL7 Main Menu/Systems
> >>>>
> >>>> Link Monitor to see if you are actually receiving in VistA and that
> >>>> you are properly acknowledging that received message…
> >>>

Jason

unread,
Oct 16, 2012, 12:44:14 AM10/16/12
to hard...@googlegroups.com, Jason, nanth...@earthlink.net
Thanks Nancy.

I tried that, and I also noticed that the variable USER is not set so I added put the line: 

export USER="ehruser"

before calling mumps -run

Now the telnet issue is fixed. However, I am still not seeing any message when I inquire file entry for file 772 / 773.

I am wondering there might be something wrong with my settings in VistA (protocols / logical links etc)

Does anyone know how VistA links the xinetd TCP listener to the event driver / subscribers? I assume if I go down GTMLNX^HLCSGTM (although there might be many layers of code) I would eventually be able to figure out how these things work?

thanks!

Jason

Jason

unread,
Oct 16, 2012, 1:59:08 PM10/16/12
to hard...@googlegroups.com, Jason, nanth...@earthlink.net
I just found that VA's HL7 developer manual had answers to my questions. It is very helpful for anyone who wants to start creating HL7 interfaces with VistA.

thanks all for the help! 

Jason
Reply all
Reply to author
Forward
0 new messages