Announcement

Collapse

Mirth Connect 3.12.0 Released!

Mirth Connect 3.12.0 is now available as an appliance update and on our GitHub page. This release includes database performance improvements, improves visual HL7 representation, message pruning, keystore handling, PDF generation, community contributions, and fixes several security vulnerabilities. This release also contains many improvements to commercial extensions. See the release notes for the list of fixes and updates.

Download | See What's New | Upgrade Guide | Release Notes

For discussion on this release, see this thread.
See more
See less

Trying to read values from a database

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

  • Trying to read values from a database

    Hi,

    I'm trying to read values from a table which I'd like to map in a HL7 message.

    I keep getting the following error:
    *********************************
    CONNECTOR: Destination 1
    SCRIPT SOURCE:
    LINE NUMBER: 4
    DETAILS: ReferenceError: "patient_id" is not defined.
    at com.webreach.mirth.server.mule.transformers.JavaSc riptTransformer.evaluateScript(JavaScriptTransform er.java:397)
    ... 32 more

    *************************************

    patient_id is a row from my table, that I'm trying to read.

    In my transformer, I've got 1 step:

    Step 0: New Step: Message Builder
    Message Segment: tmp['PID']['PID.2']['PID.2.1']
    Mapping: msg['patient_id']


    Anyone who's got an idea? I can't seem to figure it out...

    Regards,
    Frederik.

  • #2
    Re:Trying to read values from a database

    Hmmm,

    I'm going mad. I've removed every reference to patient_id in the channel (in the query, transformer etc) and keep getting that error...

    Regards,
    F.

    Comment


    • #3
      Re:Trying to read values from a database

      It's because the 'patient_id' element does not exist in the transformed XML. It depends on how you poll data from your database, but generally the variable 'patient_id', if it's the name of the column, should be available to use under the "Reference" tab. if you drag and drop, it'll look something like $('patient_id').
      Chris Ro
      Sr. Software Engineer | Mirth Corporation

      Comment


      • #4
        Re:Trying to read values from a database

        To see what's happening, please post the XML yo can see under the "raw data" XML you can see in the errored message.

        Comment

        Working...
        X