Announcement

Collapse
No announcement yet.

Adding an OBX record to a message

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Adding an OBX record to a message

    Hi:

    I'm completely new to Mirth and need some help getting off the ground.

    I have incoming messages that I need to grab the value from 3.1 of any OBX recording containing 'TX' in 2.1 and append an OBX record to the message with 'URL' in 2.1 and that 'grabbed' 3.1 value in the 5.1

    Any help would be greatly appreciated

    Thanks,

    Scott

  • #2
    This will handle it for multiple instances.

    Code:
    for(var i=0;i<msg.OBX.length();i++){
    	if(msg['OBX'][i]['OBX.2']['OBX.2.1'] == 'TX'){
    		var newOBX = <OBX/>;
    		newOBX['OBX.1']['OBX.1.1'] = msg.OBX.length()+1;
    		newOBX['OBX.2']['OBX.2.1'] = 'URL';
    		newOBX['OBX.5']['OBX.5.1'] = msg['OBX'][i]['OBX.3']['OBX.3.1'].toString();
    		msg.appendChild(newOBX);
    	}
    }

    Comment


    • #3
      Thanks so much! That did the trick!

      Comment

      Working...
      X