web stats
Time-stamp as a persistent variable - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 03-15-2013, 06:26 AM
jgross jgross is offline
What's HL7?
 
Join Date: Aug 2011
Location: Charlestown, MA USA
Posts: 4
jgross is on a distinguished road
Send a message via Skype™ to jgross
Default Time-stamp as a persistent variable

We have a Mirth Channel that takes data from an Oracle Server, creates an HL7 message (A04s and A08s), and then sends it to an LLP.

We want to run the query to only consider data younger than the last time we ran the query. How do we get Mirth Connect to save the old time stamp so that it can be used as part of the next query? We cannot modify the database we are pulling the data from (otherwise we would just update the status table).

Do you have any suggestions for how, within Mirth Connect, we can save the timestamp of a given query to use in the next query?
Reply With Quote
  #2  
Old 03-15-2013, 09:07 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,247
cory_cole is on a distinguished road
Default

updateDate = Date(); //current datetime
globalMap.put('lastUpdate', updateDate);

var lastUpdate = globalMap.get('lastUpdate');
Reply With Quote
  #3  
Old 03-15-2013, 09:40 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

Quote:
Originally Posted by jgross View Post
We have a Mirth Channel that takes data from an Oracle Server, creates an HL7 message (A04s and A08s), and then sends it to an LLP.

We want to run the query to only consider data younger than the last time we ran the query. How do we get Mirth Connect to save the old time stamp so that it can be used as part of the next query? We cannot modify the database we are pulling the data from (otherwise we would just update the status table).

Do you have any suggestions for how, within Mirth Connect, we can save the timestamp of a given query to use in the next query?
Yes, the global channel map is there for just such a use-case.
__________________
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
  #4  
Old 03-18-2013, 07:23 AM
jgross jgross is offline
What's HL7?
 
Join Date: Aug 2011
Location: Charlestown, MA USA
Posts: 4
jgross is on a distinguished road
Send a message via Skype™ to jgross
Default

Quote:
Originally Posted by cory_cole View Post
updateDate = Date(); //current datetime
globalMap.put('lastUpdate', updateDate);

var lastUpdate = globalMap.get('lastUpdate');
Cory-Cole: will this variable persist between different sessions?

We are using version 2.2.1.5861 of Mirth Connect.
Reply With Quote
  #5  
Old 03-18-2013, 10:41 AM
cory_cole cory_cole is offline
Mirth Guru
 
Join Date: Mar 2012
Posts: 1,247
cory_cole is on a distinguished road
Default

Depends. If you have 'Clear global channel map on deploy', no it will not.
Reply With Quote
  #6  
Old 03-13-2015, 04:01 PM
ppcorp ppcorp is offline
What's HL7?
 
Join Date: Mar 2015
Posts: 2
ppcorp is on a distinguished road
Default

Quote:
Originally Posted by jgross View Post
Cory-Cole: will this variable persist between different sessions?

We are using version 2.2.1.5861 of Mirth Connect.
Is there a way to persist the map between reboots?
Reply With Quote
  #7  
Old 03-13-2015, 04:28 PM
narupley's Avatar
narupley narupley is online now
Mirth Employee
 
Join Date: Oct 2010
Posts: 7,119
narupley is on a distinguished road
Default

Quote:
Originally Posted by ppcorp View Post
Is there a way to persist the map between reboots?
If you use the configuration map, then yes that is persisted between reboots. However that is meant for static values that don't change from message to message. If you want to persist something more dynamic, you can write it to a file or database.
__________________
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
database, sql, timestamp

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 08:59 PM.


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