web stats
How to remove extra LF at the end of response message ? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-09-2018, 01:04 PM
lionelroux lionelroux is offline
OBX.2 Kenobi
 
Join Date: Apr 2013
Posts: 82
lionelroux is on a distinguished road
Default How to remove extra LF at the end of response message ?

Hi all,

I have a HL7 channel with a "custom" ACK processed in the response section of my destination.

All "Convert line breaks" option are checked and the "segment delimiter" is set to "\r".

Sadly, my response message has an extra LF (\n) at the end of the message which prevent it being correctly integrated in my target application.
I guess it is added automatically.


Is it possible to remove the extra LF added in the response message ?


Thanks
Lionel
Reply With Quote
  #2  
Old 02-09-2018, 02:48 PM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 280
AlexNeiva is on a distinguished road
Default

You can use replace(/\n/,'') maybe.
Or do a split(/\n/)[0], I don't know... just need to do some tests.
Give it a try.

Last edited by AlexNeiva; 02-09-2018 at 02:49 PM. Reason: error
Reply With Quote
  #3  
Old 02-13-2018, 06:10 AM
lionelroux lionelroux is offline
OBX.2 Kenobi
 
Join Date: Apr 2013
Posts: 82
lionelroux is on a distinguished road
Default

Hello,

I already tried this at first, but it seems the serializer add an additional LF at the end of the message.

Maybe in the postprocessor, but I don't know how to do that.

Thanks
Reply With Quote
  #4  
Old 02-13-2018, 07:17 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 280
AlexNeiva is on a distinguished road
Default

Hello

Can you please post the HL7 message so I can give a try.
Reply With Quote
  #5  
Old 02-19-2018, 05:44 AM
lionelroux lionelroux is offline
OBX.2 Kenobi
 
Join Date: Apr 2013
Posts: 82
lionelroux is on a distinguished road
Default

Hello,

MSH|^~\&|1.2.250.1.341.7.200.13|XXXX|HM|HM|2018021 5100808||ACK^A31^ACK|25895171|P|2.5|||||FRA|8859/1
MSA|AA|25895171|EAI Response : Msg OK|||


I don't understand why a LF is added at the end of the message whereas I checked the replace "Convert lines break".

Maybe the serializer add it. Don't know.


Thx
Reply With Quote
  #6  
Old 02-19-2018, 07:01 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 280
AlexNeiva is on a distinguished road
Default

So, on your Destination Response, you create the HL7 ACK, to send back to another endpoint correct?
And when you do that it adds a new extra line, like this:

Code:
MSH|^~\&|1.2.250.1.341.7.200.13|XXXX|HM|HM|20180215100808||ACK^A31^ACK|25895171|P|2.5|||||FRA|8859/1
MSA|AA|25895171|EAI Response : Msg OK||| (\n)
(NEW LINE)
Reply With Quote
  #7  
Old 02-19-2018, 03:18 PM
lionelroux lionelroux is offline
OBX.2 Kenobi
 
Join Date: Apr 2013
Posts: 82
lionelroux is on a distinguished road
Default

exact.
Reply With Quote
  #8  
Old 02-20-2018, 07:55 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,126
narupley is on a distinguished road
Default

Can you post your channel?
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
ack, hl7

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 02:43 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2020, vBulletin Solutions, Inc.
Mirth Corporation