Announcement

Collapse
No announcement yet.

DB Modifications

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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.

  • #2
    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

    Comment


    • #3
      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!

      Comment


      • #4
        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

        Comment

        Working...
        X