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

msg received but not showing on the dashboard?

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

  • msg received but not showing on the dashboard?

    Hi,

    I'm using the code below to successfully get the msg in the log, but somehow the dashboard always shows received 0. Do I need to do anything else to make Mirth receive the msg stored in globalMap?

    Code:
    var dbConn = DatabaseConnectionFactory.createDatabaseConnection('net.sourceforge.jtds.jdbc.Driver','jdbc:jtds:«»sqlserver://localhost:«»port/database','username','password');
    var result = dbConn.executeCachedQuery('SELECT MessageID, MessageType, MessageSent, MessageContent FROM table WHERE MessageType=0 and MessageSent=0');
    
    //MessageContent is TEXT
    result.next(); 
    var cl = result.getClob(4);
    var strOut = new java.lang.StringBuffer();
    var aux = new java.lang.String();
    
    var br = new java.io.BufferedReader(cl.getCharacterStream());
    
    while ((aux = br.readLine())!= null)
    strOut.append(aux);
    
    globalMap.put('MessageContent', strOut);
    logger.info('Log: ' + globalMap.get('MessageContent'));
    
    dbConn.close();
    return result;
    In the log file, I can see the correct msg:
    INFO 2008-03-20 14:02:33,250 [b2c4dafd-29af-4b3c-878e-582b0cef6244_source_connector._jdbcEndpoint#955770 310.receiver.1] jdbc-receiver: Log: <result><Patient PatientID="4" Title="Mr" Given="Joe" Initial="" Surname="Blow" GenderENUM="1" ContactID="7" Deleted="0" ContactTypeENUM="1" Name="Mr Joe Blow" CDeleted="0"/></result>

    The dashboard should receive and send this msg by writing to a local file. But it doesn't. Any idea what's missing, please?

    Thanks,
    Steph

    Post edited by: stephies4s, at: 03/19/2008 22:21

  • #2
    Re:msg received but not showing on the dashboard?

    Anyone knows what's going on here?

    Comment


    • #3
      Re:msg received but not showing on the dashboard?

      Hi Steph,

      Which version of Mirth, and connector are you using?
      Gerald Bortis | Chief Information Officer | Mirth Corporation

      Comment


      • #4
        Re:msg received but not showing on the dashboard?

        Hi Gerald,

        I'm using Mirth 1.7 with SQL Server 2005.
        The msgs were picked up by Morth and displayed in th log, but no new file is created in my local folder, and the dashboard also shows 0 0 0.

        Thanks,
        Steph

        Comment


        • #5
          Re:msg received but not showing on the dashboard?

          ...

          Comment


          • #6
            Re:msg received but not showing on the dashboard?

            I'm pretty sure this isn't a bug but a setting issue. Everything worked fine when I used SQL script to access the database. It stopped working when I translate the script into Javascript as I need getClob() to read a msg type in the database.

            Comment


            • #7
              Re:msg received but not showing on the dashboard?

              I think that you are not using the correct Map (globalMap) to store the message.

              Have you tried to store the message in the channel map, and store it with the name of "msg" or so [like the rest of readers do, I guess].

              Another test is: instead of returning the "result" variable, try returning the strOut variable ....

              It's only an idea to continue trying to get it working.

              C U

              Comment


              • #8
                Re:msg received but not showing on the dashboard?

                Thannks quimicefa,

                When I tried to use channelMap, I got the following error:
                ERROR 2008-04-17 16:48:52,906 [b2c4dafd-29af-4b3c-878e-582b0cef6244_source_connector._jdbcEndpoint#724947 402.receiver.1] com.webreach.mirth.connectors.jdbc.JdbcMessageRece iver: org.mozilla.javascript.EcmaError: ReferenceError: "channelMap" is not defined. (ad49351f-2adb-47b2-8f66-b7564cf46aba#16)

                And I also tried returning strOut. Didn't make any difference.

                Can I ask you something? Did you configure anything in the "Edit Chaneel -> Scripts tab"? The default is just

                Code:
                // This script executes once when the mule engine is started
                // You only have access to the globalMap here to persist data
                return;
                Post edited by: stephies4s, at: 04/16/2008 23:58

                Comment


                • #9


                  Post edited by: stephies4s, at: 04/17/2008 00:01

                  Comment


                  • #10
                    Re:msg received but not showing on the dashboard?

                    I think that you shouldn't configure the post/pre scripts in that tab, because seems unrelated to your problem. As far as I know, these scripts are called when mule engine is started or stopped (just before a deploy channel operation, which implies a restart of mule with the new configuration) or after/before a message arrives to channel.

                    But in your problem, it seems that the new message doesn't raise a "message received" event ...

                    Comment


                    • #11
                      Re:msg received but not showing on the dashboard?

                      Well, it does raise "message received" event if I don't use JavaScript (i.e. on the source tab, choose "no" for "Use JavaScript", and type in SQL script in the source).

                      The problem only happens when I translated the scipt into JavaScript, since I wanted to use TEXT data type in SQL (which requires getClob() in JavaScript, as others in this forum suggested).

                      Comment


                      • #12
                        Re:msg received but not showing on the dashboard?

                        I started from reading this post:
                        http://www.mirthproject.org/index.ph...d=5471&catid=3

                        Post edited by: stephies4s, at: 04/17/2008 22:37

                        Comment


                        • #13
                          Good Morning,

                          The messages I send via the attached channel are properly tallied in the 'Dashboard' view, but inaccessible via the 'Channel Messages' view.

                          (I'm sending them from the dashboard, rather than using the file reader.)

                          (The purpose of the channel is to filter messages on providers. The action is as follows: reads provider numbers from a column in a postgres db, puts those values into an array, and filters messages if none of the providers in the PV1 segment match an element of the array.)

                          UPDATE:
                          I had inadvertently unchecked 'Store message data' on the Summary tab. Excuse me, there is no error.
                          Attached Files
                          Last edited by jacob41; 08-21-2013, 05:13 AM.

                          Comment

                          Working...
                          X