Skip to main content

Hi all, 

We are having some issues with carriage returns (CR) on a text that is later sent via HL7 through an integration engine. The issue is that the HL7 understands the CR as something that breaks the segment and then the message fails.

So, we want to get rid of those CRs replacing them with something more appropriate that can be managed by HL7.

The problem we are having is how to identify those CR?

We already have some code that replaces some 'dangerous' characters with other more appropriate ones, for example, (&, ^, \\, |,….) are replaced with (\\T\\, \\S\\, \\E\\, \\F\\,….). For that, we go through the text using the function 'scan' to find the character to replace, but we don't know how finding these CRs.

The application we have is built on Uniface 9.7.05

The field where the CRs are is a Text type field with:

Widget type --> MessageBox,

DataType --> String,

Interface --> C500

Syntax --> MUL

Any ideas will be welcome!

Thanks and regards!



------------------------------
Pedro Morales
Dedalus Spa
Malaga ES
------------------------------

Hi all, 

We are having some issues with carriage returns (CR) on a text that is later sent via HL7 through an integration engine. The issue is that the HL7 understands the CR as something that breaks the segment and then the message fails.

So, we want to get rid of those CRs replacing them with something more appropriate that can be managed by HL7.

The problem we are having is how to identify those CR?

We already have some code that replaces some 'dangerous' characters with other more appropriate ones, for example, (&, ^, \\, |,….) are replaced with (\\T\\, \\S\\, \\E\\, \\F\\,….). For that, we go through the text using the function 'scan' to find the character to replace, but we don't know how finding these CRs.

The application we have is built on Uniface 9.7.05

The field where the CRs are is a Text type field with:

Widget type --> MessageBox,

DataType --> String,

Interface --> C500

Syntax --> MUL

Any ideas will be welcome!

Thanks and regards!



------------------------------
Pedro Morales
Dedalus Spa
Malaga ES
------------------------------

Are you specifically looking for carriage returns or are you looking for the system defined end-of-line character?

  • "%%^" should find the system default for end of lines which could be CRLF, LF or CR depending on the system.
  • If you specifically want CRs then $tometa(13) used to work ($tometa(10) for  LFs). This used to be an undocumented feature and isn't in the current help docs so may no longer work.
  • $string also converts XML elements to text so  you could use that to return a CR with &uNL; (although that end up more like %%^)

Hope one of these works.



------------------------------
Mike Porter
Uniface Community Edition Shared Account
------------------------------

Are you specifically looking for carriage returns or are you looking for the system defined end-of-line character?

  • "%%^" should find the system default for end of lines which could be CRLF, LF or CR depending on the system.
  • If you specifically want CRs then $tometa(13) used to work ($tometa(10) for  LFs). This used to be an undocumented feature and isn't in the current help docs so may no longer work.
  • $string also converts XML elements to text so  you could use that to return a CR with &uNL; (although that end up more like %%^)

Hope one of these works.



------------------------------
Mike Porter
Uniface Community Edition Shared Account
------------------------------

Hey Mike

It worked!

I used the first approach, looking for "%%^" and it was right.

So, many thanks for your help!

Pedro



------------------------------
Pedro Morales
Dedalus Spa
Malaga ES
------------------------------