Putting a delay/pause on messages

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Putting a delay/pause on messages

  • Creator
    Topic
  • #52513
    Rehman Masood
    Participant

      We are getting charge messages and based on very specific charge messages we need to create an ADT, send it to an ancillary system, wait till it gets filed (it would be safe to just put a 5 minute delay for this) and then release the charge message. Whats the best way to do this?

      So far I have,

      – Identify the charge messages that need to have ADT created and sent. Send these to a different thread

      – From this thread, create and send an ADT message to ancillary system

      – From the same thread, pass the charge message over but put a sleep via TCL code plugged in “TPS inbound data” or another place

      Any thoughts?

    Viewing 7 reply threads
    • Author
      Replies
      • #74514
        Jeff Dinsmore
        Participant

          Just be aware that your sleeping Tcl will block other messages in that thread.

          Jeff Dinsmore
          Chesapeake Regional Healthcare

        • #74515
          Rehman Masood
          Participant

            Thanks Jeff, You are right, but what other alternatives do I have?

          • #74516
            Jim Kosloskey
            Participant

              Rehman,

              How about placing the charge message in a num-file. Then have the num-file picked up via Fileset/Local that scans the directory every x minutes?

              No sleep involved. By the way the sleep will sleep the entire process not just the one thread so if you decide to go that way put the sleeping thread in its own process.

              email: jim.kosloskey@jim-kosloskey.com 29+ years Cloverleaf, 59 years IT - old fart.

            • #74517
              Rehman Masood
              Participant

                Thanks Jim, I was waiting for you to chime in. Ok, I will read up about num-file (don’t know much about it, but I will be learning it here in the next day or two). Thanks for the pointer friend.

              • #74518
                David Harrison
                Participant

                  Another way would be to write the ADT message to a Sqlite database with a datetime stamp and a flag to set once it has been processed. Another thread could select the messages in the database every x seconds, check the datetime stamp for the correct time lapse, flag them as processed and send the messages out.

                  I use this method for handling locked messages for inbound PAS updates.

                • #74519
                  Kevin Scantlan
                  Participant

                    We do what Jim suggested.  Every night, our registration system (GE/IDX) run jobs that send out a batch of ADT messages.   We don’t want to flood downstream systems, so we throw each message into it’s own file, the pick them up, 1 per second and also give them a low priority.  This way regular ADT’s going to ER system don’t get “stuck in traffic”.

                  • #74520
                    Russ Ross
                    Participant

                      Here is an old post I did to help show you a tangible expample of using the numfile protocol that used to be in older versions of cloverleaf but now requires a custom tps proc to accomplish.

                      <a href="https://usspvlclovertch2.infor.com/viewtopic.php?t=1663&highlight=numfile&#8221; class=”bbcode_url”>https://usspvlclovertch2.infor.com/viewtopic.php?t=1663&highlight=numfile

                      Russ Ross
                      RussRoss318@gmail.com

                    • #74521
                      Rehman Masood
                      Participant

                        Thanks Guys. So looking at the example Russ pointed out, there needs to be a TCL Proc that sets the driverctl metadata to a new filename, and that is where each message will be stored? I create a 2nd thread with a fileset-local that monitors the folder where these files are created and when the files have aged a certain period of time, I pick them and send them through. Did I get it right this time?

                    Viewing 7 reply threads
                    • The forum ‘Cloverleaf’ is closed to new topics and replies.