Discussion:
[HAPI-devel] how to TCP Client that doesn't send messages
Lucila Armentano
2017-04-20 19:56:39 UTC
Permalink
Hello,
I need to create a TCP Client for connecting to a server that automatically
sends Messages (ORU).
I couldn't do this by using de newClient() method of HapiContext, because
it only receives messages after sending one.

Is it possibly to create a client with a "Receiver" or some object that
stablish a client connection and waits a message from the server?

Thanks a lot


Lucila
Christopher Speck
2017-04-20 20:17:09 UTC
Permalink
What you're describing is a Server not a Client. What you probably want is HL7Service, by using HapiContext.newServer()

For example usage see
http://hl7api.sourceforge.net/xref/ca/uhn/hl7v2/examples/SendAndReceiveAMessage.html

--
Christopher Speck
Post by Lucila Armentano
Hello,
I need to create a TCP Client for connecting to a server that automatically sends Messages (ORU).
I couldn't do this by using de newClient() method of HapiContext, because it only receives messages after sending one.
Is it possibly to create a client with a "Receiver" or some object that stablish a client connection and waits a message from the server?
Thanks a lot
Lucila
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot_______________________________________________
Hl7api-devel mailing list
https://lists.sourceforge.net/lists/listinfo/hl7api-devel
Lucila Armentano
2017-04-20 23:37:04 UTC
Permalink
Thanks but I need to connect to an analyzer that only accepts TCP Client
connections. I tested it with Hercules app, and when I connected Hercules
as a TCP client I started to receive ORU messages.

I was reading the HAPI doc and I believe that I could create a Receiver
over the client connection obtained with ctx.newClient()... , but I'm not
sure if I'm misunderstanding the Receiver class concept.

any suggestion?

Thanks,
--
*Lucila*
Pablo Pazos
2017-04-21 08:57:54 UTC
Permalink
You can create a broker that does what you need. In hl7 who sends is the
client.

On Apr 20, 2017 8:39 PM, "Lucila Armentano" <***@gmail.com>
wrote:

Thanks but I need to connect to an analyzer that only accepts TCP Client
connections. I tested it with Hercules app, and when I connected Hercules
as a TCP client I started to receive ORU messages.

I was reading the HAPI doc and I believe that I could create a Receiver
over the client connection obtained with ctx.newClient()... , but I'm not
sure if I'm misunderstanding the Receiver class concept.

any suggestion?

Thanks,
--
*Lucila*

------------------------------------------------------------
------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
Loading...