web stats
Referring to segment value without array syntax? - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 04-21-2016, 02:01 AM
tparvi tparvi is offline
What's HL7?
 
Join Date: Mar 2016
Posts: 5
tparvi is on a distinguished road
Default Referring to segment value without array syntax?

Is there a way to set a segment value without using multiple array syntax like this:

Code:
tmp['PID']['PID.4']['PID.4.1'] = "value";
The reason I'm asking is because I want to use external json file to configure where certain values are written. The json file could have something like this (I made up the syntax):

Code:
lastName : "PID.PID.4.PID.4.1"
This means lastName should be written into that segment and then in code I could just write:

Code:
tmp[settings.lastName] = value;
Is there simple way to achieve this?
Reply With Quote
  #2  
Old 04-21-2016, 06:23 AM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Not all in one bracket like you indicated, but you could just write a function to do that.
__________________
Step 1: JAVA CACHE...DID YOU CLEAR ...wait, ding dong the witch is dead?

Nicholas Rupley
Work: 949-237-6069
Always include what Mirth Connect version you're working with. Also include (if applicable) the code you're using and full stacktraces for errors (use CODE tags). Posting your entire channel is helpful as well; make sure to scrub any PHI/passwords first.


- How do I foo?
- You just bar.
Reply With Quote
Reply

Tags
javascript, segment

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 12:48 AM.


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