OBX 5 length limitation

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf OBX 5 length limitation

  • Creator
    Topic
  • #52106
    Doug Lundin
    Participant

      We have a sending system that has an embedded rtf document in OBX.5.  A new receiving system has a limitation of 254 characters in OBX.5.  Is there a way to loop through OBX.5 and pull out 254 characters at a time and create multiple OBX segments on the output.

    Viewing 4 reply threads
    • Author
      Replies
      • #73089
        Jim Kosloskey
        Participant

          Doug,

          Yes this can be done in an Xlate.

          You will need some Tcl to do the count of the number of characters in the inbound OBX-5 and one to get the piece of the inbound OBX-5 you want.

          Other than that the rest can be done with normal Xlate Actions.

          Be sure to make sure the receiving system does not ccare if the OBX-5 chunk you give them ends mid word or mid phrase. If that is an issue, more Tcl code will probably be warranted.

          I have 2 procs that give you the character length of a field and another that pluckes a portion of a field. These are the 2 Tcl procs of which I spoke. If you want them just email me and I will send them on.

          If you are not using an Xlate then you will need to do it all in Tcl.

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

        • #73090
          Doug Lundin
          Participant

            Within OBX.5 in the rtf document are braces and back slashes. Will your routine(s) handle this?  If so that would be great.

            Thanks,

            Doug

          • #73091
            Jim Kosloskey
            Participant

              Doug,

              If the OBX-5 is RTF, is the Data Type (OBX-2) ED?

              Also is the RTF component (assuming ED Data Type here) encoded (most of the time that would be Base-64)?

              If not then you quite likely will have issues inside the Xlate as the potential is there for the RTF un-encoded to contain characters from the MSH-1 or MSH-2 fields which is a n-no (the reason the ED Data Type standard exists).

              As for my Tcl procs, they have not been used with encoded data (let’s say base-64) but testing should be easy enough.

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

            • #73092
              Jonathan Christian
              Participant

                Hey Jim –

                I hate resurrecting old threads like this, but I’m having a similar challenge, and can’t find anything in the forums as a direct solution.

                My particular case stems from a need to break up an OBX-5.5 into additional OBX segments if the character length in OBX-5.5 is greater than 200 characters in length. Each accompanying OBX segment would have a 200 character limit on its OBX-5.5 as well. For example, I’d need to break up the following segment:

                OBX|11|ED|PDF^PDF||^AP^^Base64^JVBERi0xLjMKJeLjz9MNCjEgMCBvYmoKPDwKL0NyZWF0aW9uRGF0ZSAoRDoyMDE1MDcyODA5MDYwNSkKL0NyZWF0b3IgKEFjdHVhdGUpCi9Qcm9kdWNlciAoQWN0dWF0ZSBYTUwgdG8gUERGIENvbnZlcnRlciAxLjApCj4+CmVuZG9iagoyIDAgb2JqCjw8Ci9UeXBlIC9QYWdlCi9NZWRpYUJveCBbIDAgMCA2MTIgNzkyIF0KL0NvbnRlbnRzIDMgMCBSCi9SZXNvdXJjZXMgNCAwIFIKL1BhcmVudCA1IDAgUgo+PgplbmRvYmoKMyAwIG9iago8PAovRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDYgMCBSCi9MZW5ndGgxIDE3Mjk2IAo+PgpzdHJlYW0KeJztXOtv2zgS/+6/gsABhwRoZJF6F4sD2jx6WSSpm2T3sNjsB8VmbN3q4ZXk5LJ//c2Q1NNyJDvZbFq0RRs/yHnxN8PhaBhKfhxRosPfA/zheIxMo9EfI/zEpkzTdYofip8pH/2HxPDlx2vxva6ZnqsbHknno/EJJS65vquIWYalwVzH0myTX

                Into:

                OBX|11|ED|PDF^PDF||^AP^^Base64^JVBERi0xLjMKJeLjz9MNCjEgMCBvYmoKPDwKL0NyZWF0aW9uRGF0ZSAoRDoyMDE1MDcyODA5MDYwNSkKL0NyZWF0b3IgKEFjdHVhdGUpCi9Qcm9kdWNlciAoQWN0dWF0ZSBYTUwgdG8gUERGIENvbnZlcnRlciAxLjApCj4+CmVuZG9iagoyIDAgb2JqCjw8Ci9UeXB

                OBX|12|ED|PDF^PDF||^AP^^Base64^1IC9QYWdlCi9NZWRpYUJveCBbIDAgMCA2MTIgNzkyIF0KL0NvbnRlbnRzIDMgMCBSCi9SZXNvdXJjZXMgNCAwIFIKL1BhcmVudCA1IDAgUgo+PgplbmRvYmoKMyAwIG9iago8PAovRmlsdGVyIC9GbGF0ZURlY29kZQovTGVuZ3RoIDYgMCBSCi9MZW5ndGgxIDE3Mj

                OBX|13|ED|PDF^PDF||^AP^^Base64^k2IAo+PgpzdHJlYW0KeJztXOtv2zgS/+6/gsABhwRoZJF6F4sD2jx6WSSpm2T3sNjsB8VmbN3q4ZXk5LJ//c2Q1NNyJDvZbFq0RRs/yHnxN8PhaBhKfhxRosPfA/zheIxMo9EfI/zEpkzTdYofip8pH/2HxPDlx2vxva6ZnqsbHknno/EJJS65vquIWYalwVzH0myTX

                Would you mind elaborating on how you’d accomplish this in an XLATE?

                Thanks, as always, for all of your help!

              • #73093
                Keith McLeod
                Participant

                  Jon

                  Sent an email with some more detail.  I have attached an xlate that may prove to be useful for this purpose.

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