Announcement

Collapse
No announcement yet.

Total Record Count And Others

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

  • Total Record Count And Others

    Once a channel runs, I want to call a shared channel channel (via a 2nd Destination) and pass variables to it so that the channel can write the values to a table.

    Does anyone know if these variables are available?

    Total Record Count (messages received)
    Total Record Count (messages sent)
    Response (e.g. file transferred, success/failure of transfer)

    Thanks,

    Kirby

  • #2
    Bueller?

    Comment


    • #3
      Just for reference, these are variables that I am able to pass from one channel to the other:

      message.channelId
      message.channelName
      message.messageId
      message.rawData
      message.encodedData

      Comment


      • #4
        No replies other than mine???
        Attached Files

        Comment


        • #5
          you can get statistics from /channels/statuses with Client Api.

          Comment


          • #6
            Do you have any links to documentation and/or examples of how to use the Client API to pull statistics/statuses from channels and write them to a custom table in Oracle? Thanks!

            Comment


            • #7
              If you are using a mirth channel on the same instance to collect the stats, it's probably even easier to use ChannelUtil from the User API. You can get self-hosted documentation for both the User API (Java) and the Client API (REST) by clicking the links on the left menu bar of the mirth administrator.

              All of the User API classes are already imported in the javascript environment, so you can just call like the following:
              Code:
              var count = ChannelUtil.getReceivedCount(channelIdOrName);

              Comment


              • #8
                What I have is a channel called Channel Monitor (attached) that will be called by every other individual channel (via a Destination) once it runs.

                This is the SQL from the Channel Monitor channel:

                INSERT IGNORE INTO MIRTH_PROD_USER.CHANNEL_MONITOR
                (CHANNEL_ID, CHANNEL_NAME, MESSAGE_ID, RAW_DATA, TRANSFORMED_DATA, ENCODED_DATA, MIRTH_SOURCE, MIRTH_TYPE, MIRTH_VERSION, UUID, ORIGINAL_FILE_NAME, RECORD_COUNT, D1, INSERT_DTM)
                VALUES
                (${channelId}, ${channelName}, ${messageId}, ${rawData}, ${transformedData}, ${encodedData}, ${mirth_source}, ${mirth_type}, ${mirth_version}, ${UUID}, ${originalFilename}, ${COUNT}, ${d1}, SYSDATE)

                In place of ${COUNT}, can I simply reference a variable that is already available to me by virtue of being passed by the channel that called the Channel Monitor channel (by having this code in the Template section):

                ${message.channelId}|&|${message.channelName}|&|${ message.messageId}|&|${message.rawData}|&|${messag e.transformedData}|&|${message.encodedData}|&|${mi rth_source}|&|${mirth_type}|&|${mirth_version}|&|$ {UUID}|&|${originalFilename}|&|${COUNT}|&|${Respon se.d1}
                Attached Files

                Comment


                • #9
                  Here is a screen shot of a channel calling the Channel Monitor channel. Instead of sending ${COUNT} in the Template section, should I send something else? Some variation of ChannelUtil.getReceivedCount(channelIdOrName)?
                  Attached Files

                  Comment

                  Working...
                  X