Error sending pix message to openhie

Hi all,

I am using http://hl7api.sourceforge.net/hapi-hl7overhttp/doc_hapi.html this example to send hl7 message over http. My aim is to send a PIX message to an OpenHIE end point. The message is being send to the below host:

Host: iol.sandbox.ohie.org
Port: 5001
Basic auth details:
username: admin
password: admin
HTTP method: POST
HTTP Path: /ws/rest/v1/patients/

However at below line,
IReceivable receivable = client.sendAndReceiveMessage(sendable);

I am facing an exception, NonHL7ResponseException,
ca.uhn.hl7v2.hoh.api.NonHl7ResponseException: Invalid Content-Type: text/plain
at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:233)
at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541)
at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal(AbstractRawClient.java:159)
at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive(AbstractRawClient.java:279)
at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive(HohRawClientSimple.java:55)
at ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage(AbstractClient.java:161)

Could someone suggest what could be going wrong?

Thanks & Regards
Sara

Hi Sara,

To me it seems that the response being received is not of a format that HAPI expects. I’m not sure if they are following some sort of standard for sending HL7 message over HTTP. For the OpenHIE project (as it currently stands) just a simple HTTP post with a HL7 message in XML is expected.

You could look into how HAPI is sending these messages and what it expects back, and we could take a look at that and advise further.

Cheers,

Ryan

···

On Mon, Jul 28, 2014 at 7:06 PM, Sara Fatima sara.mirza14@gmail.com wrote:

Hi all,

I am using http://hl7api.sourceforge.net/hapi-hl7overhttp/doc_hapi.html this example to send hl7 message over http. My aim is to send a PIX message to an OpenHIE end point. The message is being send to the below host:

Host: iol.sandbox.ohie.org
Port: 5001
Basic auth details:
username: admin
password: admin
HTTP method: POST
HTTP Path: /ws/rest/v1/patients/

However at below line,
IReceivable receivable = client.sendAndReceiveMessage(sendable);

I am facing an exception, NonHL7ResponseException,
ca.uhn.hl7v2.hoh.api.NonHl7ResponseException: Invalid Content-Type: text/plain
at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.doReadContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:233)
at ca.uhn.hl7v2.hoh.encoder.AbstractHl7OverHttpDecoder.readHeadersAndContentsFromInputStreamAndDecode(AbstractHl7OverHttpDecoder.java:541)
at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.doSendAndReceiveInternal(AbstractRawClient.java:159)
at ca.uhn.hl7v2.hoh.raw.client.AbstractRawClient.sendAndReceive(AbstractRawClient.java:279)
at ca.uhn.hl7v2.hoh.raw.client.HohRawClientSimple.sendAndReceive(HohRawClientSimple.java:55)
at ca.uhn.hl7v2.hoh.hapi.client.AbstractClient.sendAndReceiveMessage(AbstractClient.java:161)

Could someone suggest what could be going wrong?

Thanks & Regards

Sara

You received this message because you are subscribed to the Google Groups “OpenHIE Architecture” group.

To unsubscribe from this group and stop receiving emails from it, send an email to ohie-architecture+unsubscribe@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.


Ryan Crichton

Lead Developer, Jembi Health Systems | SOUTH AFRICA

Mobile: +27845829934 | Skype: ryan.graham.crichton
E-mail: ryan@jembi.org