web stats
obx[i] not adding subcomponents - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 05-11-2016, 02:28 AM
ferdinand ferdinand is offline
OBX.1 Kenobi
 
Join Date: Sep 2014
Posts: 34
ferdinand is on a distinguished road
Default obx[i] not adding subcomponents

hi
I'm using MC 3.3.1.7856.

I have to add a text in obx.18 like that 'analizador'

var len=msg['OBX'].length();
for(i=0;i<len;i++)
{
tmp['OBX'][i]['OBX']['OBX.18']['OBX.18.1']='analizador'



}

but what I finally get in the output is that:

OBX|1|ST|^FIO2^I||21.0|%|||||F|||20160511111551|OB X||||||||||||||||||analizador

Can you please help?
Reply With Quote
  #2  
Old 05-11-2016, 03:05 AM
siddharth siddharth is offline
Mirth Guru
 
Join Date: Feb 2013
Posts: 832
siddharth is on a distinguished road
Default

You want to insert analizador in OBX.18 of all OBXes?
Reply With Quote
  #3  
Old 05-11-2016, 03:10 AM
ferdinand ferdinand is offline
OBX.1 Kenobi
 
Join Date: Sep 2014
Posts: 34
ferdinand is on a distinguished road
Default

Quote:
Originally Posted by siddharth View Post
You want to insert analizador in OBX.18 of all OBXes?


Yes, thats what I want to do, basically
Reply With Quote
  #4  
Old 05-11-2016, 04:20 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 556
kirbykn2 is on a distinguished road
Default

tmp['OBX'][i]['OBX']['OBX.18']['OBX.18.1']='analizador'

Should be
tmp['OBX'][i]['OBX.18']['OBX.18.1']='analizador';
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
  #5  
Old 05-11-2016, 05:14 AM
AlexNeiva AlexNeiva is offline
Mirth Guru
 
Join Date: Oct 2013
Location: Portugal
Posts: 275
AlexNeiva is on a distinguished road
Default

Exactly like kibykn2 said:

Quote:
Originally Posted by kirbykn2 View Post
tmp['OBX'][i]['OBX']['OBX.18']['OBX.18.1']='analizador'

Should be
tmp['OBX'][i]['OBX.18']['OBX.18.1']='analizador';
Reply With Quote
  #6  
Old 05-11-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 guys,
I feel a little stupid, too many hours in front of the computer...
Reply With Quote
  #7  
Old 05-11-2016, 05:57 AM
kirbykn2's Avatar
kirbykn2 kirbykn2 is offline
Mirth Guru
 
Join Date: Sep 2014
Location: Michigan
Posts: 556
kirbykn2 is on a distinguished road
Default

We've all been there.



I spend way to much time fixing my own mistakes(job security I guess)
__________________
Kirby

Mirth Certified|Epic Bridges Certified|Cloverleaf Level 2 Certified

Appliance Version 3.11.2
Mirth Connect Version 3.6.1
Java Version 1.6.0_45-b06
Java (64 bit) Version 1.6.0_45-b06
Java 7 (64 bit) Version 1.7.0_151-b15
Java 8 (64 bit) Version 1.8.0_121-b13
PostgreSQL Version 9.6.3
Reply With Quote
Reply

Tags
iteration, obx, 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 01:58 PM.


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