Mirth Connect - Grab HL7V2 Segment via Attachment Handler

53 Views Asked by At

I am trying to write a JavaScript attachment handler that takes in an HL7V2 message and only returns specifically the MSH segment. It is my understanding that you need to serialize the message first in the attachment handle which I think I am doing correctly below, but after that my return is saying "undefined". Does anyone know what I am missing?

var dataType = 'HL7V2';
var serializationProperties = SerializerFactory.getDefaultSerializationProperties(dataType);
var deserializationProperties = SerializerFactory.getDefaultDeserializationProperties(dataType);
var serializer = SerializerFactory.getSerializer(dataType, serializationProperties, deserializationProperties);

return message['MSH'];
0

There are 0 best solutions below