Split an ORM into multiple ORM

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Split an ORM into multiple ORM

  • Creator
    Topic
  • #52172
    Robert Hamden
    Participant

      Cloverleaf 5.5MB, I am attempting to split an ORM so each resulting message is a single ORC OBR message. I tried via the GUI using continue and suppress with no luck a I tired with:

      If I echo $Outmsg I see the message split as it should be, but I get the following message in the process log.

      No destination list on message

      What am I missing, if it is not obvious I am very new at this…

      See XLATE below

    Viewing 7 reply threads
    • Author
      Replies
      • #73293
        Rob Abbott
        Keymaster

          Instead of ‘msgcreate $msg’, use

          Code:

          set newMh [msgcopy $mh]
          msgset $newMh $msg

          This will preserve the metadata from the inbound message – part of which contains a destination list if the message has already been routed.

          I don’t recommend re-using the mh variable, your code can get confusing.  Create a new variable if you’re creating new messages.

          Rob Abbott
          Cloverleaf Emeritus

        • #73294
          Robert Hamden
          Participant

            I replced the lines now I get the following as the output :

            [0:TEST] ‘splitHL7_DH ‘ returned bogus strMsgId ‘message0’

          • #73295
            Rob Abbott
            Keymaster

              Note what I said about re-using the ‘mh’ variable.  Since you are now using a new variable, you’ll need to change references to ‘mh’ in your code after each msgcopy.

              e.g. change “lappend displist “CONTINUE $mh”” to “lappend displist “CONTINUE $newMh””

              Rob Abbott
              Cloverleaf Emeritus

            • #73296
              Robert Hamden
              Participant

                I tried that

                set newMh [msgcopy $mh]

                msgset $newMh $msg

              • #73297
                Robert Hamden
                Participant

                  I got it to work, limited testing has been done.

                  The TCL must go in the outbound thread

                  Thanks to the originator of the script and many thanks to Russ for his guidance.

                  See XLATE below

                • #73298
                  Jim Kosloskey
                  Participant

                    Robert,

                    Just so you know – most likley that could be done with an Xlate as well.

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

                  • #73299
                    Robert Hamden
                    Participant

                      I was able to make this happen in the GUI see the attached file.

                    • #73300
                      Jim Kosloskey
                      Participant

                        Robert,

                        Very good.

                        I prefer to use CONTINUE rather than SEND.

                        The difference is CONTINUE moves the message to the next step immediately following the Xlate whereas SEND moves the mesages directly to the outbound thread.

                        Normally no difference in effect – until – one decides to add a post Xlate but pre Outbound Tcl proc or something and then with SEND that added facility won’t be executed. That makes for some interesting head scratching.

                        I suspect that the ability to stack Xlates (Cloverleaf 5.8 and beyond) might be affected by the decision to use SEND vs CONTINUE although I don’t have any confirmation of that.

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

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