web stats
How to exclude one msg type from transformer - Mirth Community

Go Back   Mirth Community > Mirth UK Community > General Discussion

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old 03-29-2017, 05:19 AM
pmcnally pmcnally is offline
Mirth Newb
 
Join Date: Dec 2015
Location: Massachusetts
Posts: 9
pmcnally is on a distinguished road
Unhappy How to exclude one msg type from transformer

Hi all,

We are on Mirth 3.4.0.800. I have a java transformer that adds a ROL segment. On one message type, indicated by both/either MSH.9= A17 OR MSH.8= SWAPADMIN, there are multiple PID, PV1 & PV2 segments so I want to ignore the addition of the ROL on these. I wasn't sure where to add this w/o messing up the existing code.


var rolAlreadyCreated = false;

if(msg.DRG.length() > 0 && rolAlreadyCreated == false)
{
var rol = createSegmentAfter('ROL', msg.DRG);

rol['ROL.3.1'] = 'PP';
rol['ROL.4.1']['4.1.1'] = existingPV1['PV1.51']['PV1.51.1'];
rol['ROL.4.1']['4.1.2'] = existingPV1['PV1.51']['PV1.51.2'];
rol['ROL.4.1']['4.1.3'] = existingPV1['PV1.51']['PV1.51.3'];
rol['ROL.4.1']['4.1.4'] = existingPV1['PV1.51']['PV1.51.4'];

rolAlreadyCreated = true;
}

if(msg.GT1.length() > 0 && rolAlreadyCreated == false)
{
var rol = createSegmentBefore('ROL', msg.GT1);

rol['ROL.3.1'] = 'PP';
rol['ROL.4.1']['4.1.1'] = existingPV1['PV1.51']['PV1.51.1'];
rol['ROL.4.1']['4.1.2'] = existingPV1['PV1.51']['PV1.51.2'];
rol['ROL.4.1']['4.1.3'] = existingPV1['PV1.51']['PV1.51.3'];
rol['ROL.4.1']['4.1.4'] = existingPV1['PV1.51']['PV1.51.4'];

rolAlreadyCreated = true;
}
if(msg.OBX.length() > 0 && rolAlreadyCreated == false)
{
var rol = createSegmentAfter('ROL', msg.OBX);

rol['ROL.3.1'] = 'PP';
rol['ROL.4.1']['4.1.1'] = existingPV1['PV1.51']['PV1.51.1'];
rol['ROL.4.1']['4.1.2'] = existingPV1['PV1.51']['PV1.51.2'];
rol['ROL.4.1']['4.1.3'] = existingPV1['PV1.51']['PV1.51.3'];
rol['ROL.4.1']['4.1.4'] = existingPV1['PV1.51']['PV1.51.4'];

rolAlreadyCreated = true;
}

// only update when consult provider is present,
if (existingPV1['PV1.9'].length() > 0 && existingPV1['PV1.9']['PV1.9.1'].length() > 0) {
var newROL = createSegmentAfter('ROL', msg.ROL);
newROL['ROL.3.1'] = 'CP';
newROL['ROL.4.1']['4.1.1'] = existingPV1['PV1.9']['PV1.9.1'];
newROL['ROL.4.1']['4.1.2'] = existingPV1['PV1.9']['PV1.9.2'];
newROL['ROL.4.1']['4.1.3'] = existingPV1['PV1.9']['PV1.9.3'];
newROL['ROL.4.1']['4.1.4'] = existingPV1['PV1.9']['PV1.9.4'];
}

Basically I am looking for
If MSH.8 is equal to 'SWAPADMIN' skip all the ROL code that follows, else proceed.

Any help would be appreciated.
Thanks,
Patti
Reply With Quote
 

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -8. The time now is 11:14 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2019, vBulletin Solutions, Inc.
Mirth Corporation