Hi Christian,

Thank you. Now I have omitted the Application, and I have set the host and
port as per the PAMSimulator specifications. Now I am working with the
below code snippet to send the message. However I am
getting UndeclaredThrowableException.

 int port = 10010; // The port to listen on
>         LowerLayerProtocol llp = LowerLayerProtocol.makeLLP();
>         PipeParser parser = new PipeParser(); // The message parser
>         SimpleServer server = new SimpleServer(port, llp, parser);
>                 server.start();
>         // Create a message to send
>         Parser p = new GenericParser();
>         Message adt = p.parse(hl7Message);
>         // The connection hub connects to listening servers
>         ConnectionHub connectionHub = ConnectionHub.getInstance();
>         // A connection object represents a socket attached to an HL7
> server
>         Connection connection = connectionHub
>                 .attach("131.254.209.20", port, new PipeParser(),
> MinLowerLayerProtocol.class);
>         // The initiator is used to transmit unsolicited messages
>         Initiator initiator = connection.getInitiator();
>         Message response = initiator.sendAndReceive(adt);
>         String responseString = parser.encode(response);
>         // Close the connection and server
>         connection.close();
>         server.stop();
> return responseString;


This is the HL7 message which I am passing,

>  MSH|^~\&|TestSendingSystem||||||^A05^ADT A05|6/24/14 10:39 AM||2.5.1|123
> PID||71|||Barber^Steve|||||^ABVGJ|&13 Park
> Street^^Ina^ANB^7899^INHJ|||||^MARRIED|||||||Hyd|||^Indian

This is the error which I am facing.

> SEVERE: Servlet.service() for servlet [openmrs] in context with path
> [/openmrs] threw exception [Request processing failed; nested exception is
> java.lang.reflect.UndeclaredThrowableException] with root cause
> ca.uhn.hl7v2.model.DataTypeException: Failed validation rule for value
> "MSH": Matches the regular expression (\+|\-)?\d*\.?\d*: Segment: ERR Field
> #2
> at ca.uhn.hl7v2.model.AbstractPrimitive.setValue(AbstractPrimitive.java:89)
> at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:408)
> at ca.uhn.hl7v2.parser.PipeParser.parse(PipeParser.java:351)



Thanks & Regards
Sara Fatima



On Tue, Jun 24, 2014 at 12:35 AM, Christian Ohr <christian....@gmail.com>
wrote:

> The PAMSimulator at gazelle.ihe.net is your server and will receive your
> requests. You simply don't need an Application, because this is part of the
> server-side API of HAPI. You only need the client (i.e. ConnectionHub
> etc.).  Or am I misunderstanding you?
>
> Christian
>
>
> 2014-06-23 17:52 GMT+02:00 Sara Fatima <sara.mirz...@gmail.com>:
>
> Hi Christian
>>
>> Thank you. I understand that I need to change the host and port as per
>> the PAMSimulator specification. However in the below lines of code,
>>
>> SimpleServer server = new SimpleServer(port, llp, parser);
>>> Application handler = new ExampleReceiverApplication();
>>> server.registerApplication("ADT", "A01", handler);
>>
>>
>> it is creating an ExampleReceiverApplication, but I need to set the
>> receiving application as PAMSimulator. How can I do this?
>>
>> Regards
>> Sara Fatima
>>
>>
>>
>> On Mon, Jun 23, 2014 at 8:24 PM, Christian Ohr <christian....@gmail.com>
>> wrote:
>>
>>>         // A connection object represents a socket attached to an HL7 server
>>>         Connection connection = connectionHub
>>>                 .attach("localhost", port, new PipeParser(), 
>>> MinLowerLayerProtocol.class);
>>>
>>> Just attach the connection to the Gazelle host and port instead of 
>>> localhost.
>>>
>>> Christian
>>>
>>>
>>>
>>>
>>> 2014-06-23 11:30 GMT+02:00 Sara Fatima <sara.mirz...@gmail.com>:
>>>
>>>> Hi all,
>>>>
>>>> I am trying to send HL7 message to PAMSimulator
>>>> <http://gazelle.ihe.net/PatientManager/pdc/PDC.seam?cid=4835#>. I need
>>>> to do this over MLLP. I was trying this
>>>> <https://svn.code.sf.net/p/hl7api/code/branches/RELEASE_1_0/hapi-mvn/hapi-examples/src/main/java/ca/uhn/hl7v2/examples/SendAndReceiveAMessage.java>
>>>>  example,
>>>> but here the example is creating an example server to send the message. I
>>>> do not intent to do this, as I am sending to the PAMSimulator server. I am
>>>> looking to provide the port and the host of the server and send the
>>>> message. How can I do this? Is there any sample code for this type?
>>>>
>>>> Thanks & Regards
>>>> Sara Fatima
>>>>
>>>>
>>>>
>>>> ------------------------------------------------------------------------------
>>>> HPCC Systems Open Source Big Data Platform from LexisNexis Risk
>>>> Solutions
>>>> Find What Matters Most in Your Big Data with HPCC Systems
>>>> Open Source. Fast. Scalable. Simple. Ideal for Dirty Data.
>>>> Leverages Graph Analysis for Fast Processing & Easy Data Exploration
>>>> http://p.sf.net/sfu/hpccsystems
>>>> _______________________________________________
>>>> Hl7api-devel mailing list
>>>> Hl7api-devel@lists.sourceforge.net
>>>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>>>
>>>>
>>>
>>
>
------------------------------------------------------------------------------
Open source business process management suite built on Java and Eclipse
Turn processes into business applications with Bonita BPM Community Edition
Quickly connect people, data, and systems into organized workflows
Winner of BOSSIE, CODIE, OW2 and Gartner awards
http://p.sf.net/sfu/Bonitasoft
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel

Reply via email to