Published on InterSystems Developer Community (https://community.intersystems.com)

Home > How to truncate hl7 fields according to schema

Question
Elisha Gould · May 26, 2020

How to truncate hl7 fields according to schema

Hi,

We are using IRIS, and have some systems that we send data to that cannot accept messages with certain fields larger than a particular size.

Is there any way to utilize the schema to truncate any fields that are larger than the entered data?

I've tried just setting the max lengths and doing the transform, but it puts in the entire string, and can't find a topic for it.

There are a large number of fields that need to be truncated, so it would be ideal to get it to respect the hl7 schema maximum lengths.

 

ie for the XPN name fields, each name may not be larger than 20 characters.  

so the name:

12345678901234567890123^PERSON^^MR

would become

12345678901234567890^PERSON^^MR
 

#HL7 #Interoperability #InterSystems IRIS #InterSystems IRIS for Health

Source URL:https://community.intersystems.com/post/how-truncate-hl7-fields-according-schema