Been trying to figure this out with no luck so far...
A reference lab which will go unnamed has started sending ORU^R01 messages that are occasionally missing the [OBX.3][CE.2] test name. One of the applications that receives these messages requires a non-null value for the test name. Figured I'd fix it with Mirth..
I created a transformer rule that identifies the missing fields, inserts "N/A" in the right place, and logs the repaired OBX segment, but I can't figure out how to actually get it put back into message.transformedData.
var testname;
for each (obx in msg..OBX) {
testname = obx['OBX.3']['CE.2'];
if (testname.length() == 0) {
logger.info("fix 3");
obx['OBX.3']['CE.2'] = "n/a";
logger.info(obx.toString());
}
}
(Yea, that code does nothing to the message itself - just illustrates what I'm trying to fix.)
Any suggestions?
Thanks - mike
A reference lab which will go unnamed has started sending ORU^R01 messages that are occasionally missing the [OBX.3][CE.2] test name. One of the applications that receives these messages requires a non-null value for the test name. Figured I'd fix it with Mirth..

I created a transformer rule that identifies the missing fields, inserts "N/A" in the right place, and logs the repaired OBX segment, but I can't figure out how to actually get it put back into message.transformedData.
var testname;
for each (obx in msg..OBX) {
testname = obx['OBX.3']['CE.2'];
if (testname.length() == 0) {
logger.info("fix 3");
obx['OBX.3']['CE.2'] = "n/a";
logger.info(obx.toString());
}
}
(Yea, that code does nothing to the message itself - just illustrates what I'm trying to fix.)
Any suggestions?
Thanks - mike
Comment