Announcement

Collapse
No announcement yet.

How to remove extra LF at the end of response message ?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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

  • #2
    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, 01:49 PM. Reason: error
    Best Regards,
    Alex Neiva

    Comment


    • #3
      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

      Comment


      • #4
        Hello

        Can you please post the HL7 message so I can give a try.
        Best Regards,
        Alex Neiva

        Comment


        • #5
          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

          Comment


          • #6
            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)
            Best Regards,
            Alex Neiva

            Comment


            • #7
              exact.

              Comment


              • #8
                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.

                Comment

                Working...
                X