miércoles, 1 de junio de 2011

Transformaciones en campos HL7 de más de 32KB

Una cuestión importante sobre mensajería HL7 codificada en ER7 en Ensemble.

Si tienes mensajes con campos de más de 32 Kb (por ejemplo un mensaje con un OBX de radiología que tenga un texto de más de 32 KB) y realizas una manipulación directa de ese campo desde un DTL (una manipulación puede ser una copia directa cuando transformas de XML a ER7). Entonces EL VALOR SE TRUNCA A 32 KB.

Para hacerlo correctamente hay que hacerlo de una manera especial:

For DTL's that provide transformation on segments with fields > 32k, there are some different things that need to be done. For the purpose of my explanation, lets assume my OBX:5 field is > 32K.

Basically, if you have a DTL that makes no changes to any part of the OBX segment, and are using a copy, there is nothing different you need to do. If you are adjusting a field (the most likely case) we will need to use some stream manipulation.

What happens is that Ensemble stores segment data in 32k chunks internally. While providing the string value, it returns only the contents of the first chunk. This will also occur even if the long strings are enabled.

To get around this, you need to use the ReadRawDataStream and StoreRawDataStream of the EnsLib.HL7.Segment class.

The behavior of ReadRawDataStream is

0) If you do not specify a property path the whole of the segment is returned

1) If the field you want is < 32K, you just get that field

2) If the field you want is >32K, you get from that field to the end of the segment.

3) If the field you want is after the 32K field you get nothing returned. ReadRawDataStream was intended for use when the final field of the segment was greater than 32k.

I've included a sample below. In this case, I want to manipulate a field prior

to 5 (the > than 32)










If you want to manipulate 5 or a field after it, you would have to use standard stream manipulation.

The test transformation is studio does also have a 32K limit, but that is not related to what is actually happening when the message passes through.

Saludos

No hay comentarios: