web stats
Help replacing a test name - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 02-16-2016, 02:02 PM
ferdinand ferdinand is offline
OBX.1 Kenobi
 
Join Date: Sep 2014
Posts: 34
ferdinand is on a distinguished road
Default Help replacing a test name

Hello, I have to change the name of a OBR.
When I receive "cbase(b)", I have to change it to "ABE".

I have made an approach, but doesn't work



for each (seg in msg.children()) {
var i=0;
if (seg.name().toString() == "OBX") {
if ( msg['OBX'][i]['OBX.3']['OBX.3.2'].toString().equals('cBase(B)'))
{

tmp['OBX'][i]['OBX.3']['OBX.3.2']='ABE';
logger.info("entro en comparacion");
logger.info(msg['OBX']['OBX.3']['OBX.3.2'].toString());
}



}
}

Any help would be apreciated, thanks.
Reply With Quote
  #2  
Old 02-16-2016, 05:57 PM
rigved rigved is offline
OBX.1 Kenobi
 
Join Date: Jun 2014
Posts: 31
rigved is on a distinguished road
Default

I see you are doing tmp['OBX'][i]['OBX.3']['OBX.3.2']='ABE';

Should that be msg['OBX'][i]['OBX.3']['OBX.3.2']='ABE'; instead?
Reply With Quote
  #3  
Old 02-16-2016, 10:34 PM
ferdinand ferdinand is offline
OBX.1 Kenobi
 
Join Date: Sep 2014
Posts: 34
ferdinand is on a distinguished road
Default

Quote:
Originally Posted by rigved View Post
I see you are doing tmp['OBX'][i]['OBX.3']['OBX.3.2']='ABE';

Should that be msg['OBX'][i]['OBX.3']['OBX.3.2']='ABE'; instead?

What I want to change is the output, btw, it doesn't work on that way (i tried)
Reply With Quote
  #4  
Old 02-17-2016, 03:30 AM
mcalKno mcalKno is offline
 
Join Date: Apr 2015
Location: Pennsylvania
Posts: 247
mcalKno is on a distinguished road
Default

PHP Code:
for each(obx in msg.OBX)
{
    if(
obx['OBX.3']['OBX.3.2'].toString() == 'cBase(B)')
    {
        
obx['OBX.3']['OBX.3.2'] = 'ABE';   
        
logger.info("entro en comparacion");
        
logger.info(obx['OBX.3']['OBX.3.2'].toString());
    }

Reply With Quote
  #5  
Old 02-17-2016, 05:21 AM
ferdinand ferdinand is offline
OBX.1 Kenobi
 
Join Date: Sep 2014
Posts: 34
ferdinand is on a distinguished road
Default

thanks!!!!!
Reply With Quote
Reply

Tags
obr, replace

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:18 AM.


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