-1

I have to send HL7 message to web service. I am adding CHAR(13) (carriage return or \r) as segment terminator in stored procedure and calling a web service to send the HL7 message. When the service receives the message they are saying I am adding extra CHAR(10) (line feed or \n ) in my segment terminators. I have looked into my values and just before sending it only has \r as segment terminators. How to make sure that the service also receives it as only \r without extra \n. I have looked around but haven't found any solution so far.

  • Can you elaborate a litle bit more, what kind of web service, did you check the received message too, who is they (saying)? – sqlab Oct 09 '14 at 06:23
  • I would definitely check to see if they can receive MLLP instead. This would make sure that any message terminations are resolved. http://www.hl7standards.com/blog/2007/05/02/hl7-mlp-minimum-layer-protocol-defined/ – SQLSavant Oct 22 '14 at 03:37
  • It may not be an individual segment but something your programming language or framework is adding at the end of the message after your last segment? – SixOThree Oct 24 '14 at 19:08

2 Answers2

1

Have you looked at the message in Fiddler or TCP Spy depending on how you are sending your message? It will at least prove if you are providing anything other than the /r

user2081514
  • 95
  • 1
  • 7
  • I looked in Fiddler and message was being sent as hex 0D (carriage return) but it is changed to hex 0A (line feed) before it is read by service. In between the layer of service and application, it is stored in cache and when it is read cache changes carriage return to line feed. I am not sure what I should pass so as it doesn't change it. I tried “ " lately in place of CHAR(13) in my SQL stored procedure which returns HL7 message. No success so far. – user4122359 Oct 31 '14 at 16:04
0

I've been caught by messages having multiple ways of breaking the line. \r, \n and also a combo of the 2.

Have you tried redirecting the message to somewhere you can actually read yourself at different stages of the processing? It's getting changed somewhere and reading it out at different stages caught the error for me. Or just a series of the below at different stages.

content = hl7message.read() if "\n" in content: print "ERROR"

Blimey
  • 65
  • 6