Hi Gabriel,
I see what you mean. HAPI does not by default do that kind of translation,
since it would be impossible to get it right across all platforms and all
of the escape sequences that HL7 supports.
The new version of HAPI (almost released) does include a method which
converts text datatypes to their equivalent HTML codes, which might be of
some help:
http://grepcode.com/file/repo1.maven.org/maven2/ca.uhn.hapi/hapi-osgi-base/2.0-beta1/ca/uhn/hl7v2/model/primitive/AbstractTextPrimitive.java#AbstractTextPrimitive.getValueAsHtml%28%29
Cheers,
James
On Wed, Jul 11, 2012 at 6:00 AM, Gabriel Euzet <geu...@sqli.com> wrote:
> Hi James,
>
> In fact, I parse messages that can contain "/.br/" and I 'd like to get
> "\n" instead of the escape sequence.
> But ! Always this "but" ... The "/.br/" can be everywhere (not everywhere
> but it's not easy to list all places ... every text field). Also I need to
> tell the parser 'hey ! replace all "/.br/" you encounter by "\n".'
>
> Regards,
> Gabe
>
>
>
> 2012/7/9 James Agnew <ja...@jamesagnew.ca>
>
>> Hi Gabriel,
>>
>> Do you mean that you have a string which contains a specical character,
>> and you want getValue() to return it as the corresponding escape sequence
>> (like it would appear in an actual message)?
>>
>> If so, encode() would be the method to call. If you have (for example) an
>> ST that contains the string "A~B", then:
>>
>> st.getValue() returns "A~B"
>> st.encode() returns "A\R\B"
>>
>> Cheers,
>> James
>>
>> On Mon, Jul 9, 2012 at 9:25 AM, Gabriel Euzet <geu...@sqli.com> wrote:
>>
>>> Hi !
>>>
>>> When I receive an HL7 document, how can I replace the escaping sequences
>>> by the "normal" characters (HL7 norm, chapter 2.7) ?
>>> Should I override the getValue() ? How ?
>>> Have I to use something like "String.replace()" everywhere I call
>>> getValue() ?
>>>
>>> Regards,
>>> Gabe
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> Live Security Virtual Conference
>>> Exclusive live event will cover all the ways today's security and
>>> threat landscape has changed and how IT managers can respond. Discussions
>>> will include endpoint security, mobile security and the latest in malware
>>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>>> _______________________________________________
>>> Hl7api-devel mailing list
>>> Hl7api-devel@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/hl7api-devel
>>>
>>>
>>
>
------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and
threat landscape has changed and how IT managers can respond. Discussions
will include endpoint security, mobile security and the latest in malware
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Hl7api-devel mailing list
Hl7api-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/hl7api-devel