web stats
DB Modifications - Mirth Community

Go Back   Mirth Community > Mirth Connect > Support

Reply
 
Thread Tools Display Modes
  #1  
Old 09-20-2006, 11:52 PM
pitchfork pitchfork is offline
Mirth Newb
 
Join Date: Sep 2006
Posts: 19
pitchfork
Default DB Modifications

Hi,

Can Mirth detect if there have been any update or insert in a field of the database that is connected to, and if so do any action? How? (I guess in an outbound channel?).

Thanks in advance.
Reply With Quote
  #2  
Old 09-21-2006, 12:39 AM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: DB Modifications

Yes, Mirth will poll a database for changes.

If you are looking to pull the data out and write to a file or to another database (without creating HL7) then you want an inbound channel with a DB Reader source endpoint.

If you want to create HL7 messages from the data, you should use an outbound channel.

Essentially, you specify the SQL select statement to run that checks for certain conditions (SELECT id FROM db_name WHERE updated = TRUE);

Then in the UPDATE you would put something like:
(UPDATE db_name SET updated = FALSE WHERE id = ${id})

This checks for all fields in the db at a polling interval and finds all rows where updated = true. It pulls down the data (each row will be a seperate message in Mirth) and then runs the update (so that the subsequent polls do not pull in the already processed data).

-Chris
__________________
Chris Lang
Reply With Quote
  #3  
Old 09-21-2006, 12:58 AM
pitchfork pitchfork is offline
Mirth Newb
 
Join Date: Sep 2006
Posts: 19
pitchfork
Default Re: DB Modifications

Hi, and thank you for the previous answeres.

What if I cannot modify the database in order to add the field 'updated'? I mean. Is able Mirth to 'listen' the database and act if it detectsa new record inserted?.

Other question, in an outbound channel, how does mirth create the HL7 message? As a destination I have a file in certain folder. It creates the file but with nothing inside.

Can you help me with these questions, please?

Thanks!
Reply With Quote
  #4  
Old 09-21-2006, 11:24 PM
chrisl chrisl is offline
Mirth Employee
 
Join Date: Aug 2006
Posts: 967
chrisl is an unknown quantity at this point
Default Re: DB Modifications

Mirth is only able to poll the database. If there is no way to indicate that a record has been processed by Mirth on the db, then you will end up pulling down ALL records, ALL the time. You of course could filter this, but it is not an ideal architecture.

Is there a time-stamp on the database? You might be able to have Mirth poll at a large interval and only pull data that has been added or updated based on the timestamp.

For the outbound channel you define an HL7 sample message as the template. In the transformer you drag segments from the message into a HL7 Message Builder then define what you want updated. For example if you're reading from a database, you would drag the segment from the sample hl7 message tree to the "Segment" field and then drag your database variable from the variable list to the mapping.

We are working on documentation and tutorials to assist in this process and are aiming to have them ready for the 1.2 release (approx 3 weeks).

Thanks,
-Chris
__________________
Chris Lang
Reply With Quote
Reply

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:17 PM.


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