camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "christian ohr (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-5304) Unable to turn-off \n to \r conversion in HL7Converter
Date Fri, 31 Aug 2012 20:54:07 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-5304?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13446359#comment-13446359
] 

christian ohr commented on CAMEL-5304:
--------------------------------------

Strictly speaking, it's the MLLP codec that has the option to disable \r to \n conversion.
The Data Format uses the Type Converter under the hood. As the type converter right now is
not configurable, I see four options (ordered by my personal preference):

* remove \n to \r conversion entirely and set the default to false in the codec. The HL7 standard
strictly defines \r as segment delimiter (maybe the guy who decided on this was a Mac user
;-), and the conversion is usually only desired when you read a message from file. -> Changes
the default behavior and need proper documentation. If you still want this conversion, you
can do it in an extra string transformation _before_ parsing.
* make HL7Converter configurable so that at least the Data Format can choose whether to convert
or not
* tweak the conversion a bit so that \n is only replaced by \r if three uppercase letters
(the name of the next segment) follow right away, so that this \n is probably intended to
be the end of a segment. Smells like a hack.
* leave everything as it is


                
> Unable to turn-off \n to \r conversion in HL7Converter
> ------------------------------------------------------
>
>                 Key: CAMEL-5304
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5304
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-hl7
>    Affects Versions: 2.9.2
>            Reporter: Arjen Duursma
>            Priority: Minor
>         Attachments: CamelTest.zip
>
>
> The HL7MLLPCodes allows a setting (convertLFtoCR) to enable of disable the conversion
of \n characters to \r.  The type converter from String to Messages has that same conversion
hardcoded without an option to turn it off.  This means I cannot process messages which contain
embeded \n characters in a ED (encapsulated data) section.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Mime
View raw message