Need inbound filename using pre-proc

Clovertech Forums Read Only Archives Cloverleaf Cloverleaf Need inbound filename using pre-proc

  • Creator
    Topic
  • #52480
    Johnny Anderson
    Participant

      CL 5.5, Sun/Solaris 10, HL7 v2.3.1

      Problem with a pre-proc in an xlate for an inbound VXQ.

      Attachments:

       1. error msg on log: can’t read $mh: no such variable.

       2. tcl code in the pre-proc.

       3. the tcl code I copied from forum dated Jun 10, 2009, “FTP Question”.

      I’ve searched the forum and seen several examples but can’t get any to work.  I would like the pathname also.

      Would “thread configuration tps inbound data” be a better location for the proc?

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

          Johnny,

          If ytou want to get to the message’s metadata inside an Xlate you need to use the xpm functions (xpmmetaget).

          Also your proc needs to be an xltp type proc.

          The proc you began with was not designed to be run inside an Xlate so you will need to adapt.

          email: jim.kosloskey@jim-kosloskey.com 30+ years Cloverleaf, 60 years IT – old fart.

        • #74383
          Johnny Anderson
          Participant

            I’ve changed to xpmmetaget and changed proc to xltp type.

            The test fails, see attachments.  I copied the tcl code from a forum topic named:

            “How to Generate a Message control ID, Aug 04, 2010 2:12pm, (last reply)” and modified for filename.  

            I’ve searched the forum, CL manuals, and tcl help on the Internet and can’t find any examples of this method of finding the inbound filename.

            Thanks for any help you can give.

          • #74384
            Charlie Bursell
            Participant

              Assuming the input was fileset/local

              set klst [xpmmetaget $xlateID DRIVERCTL]

              # Always set a default

              set filepath “”; keylget klst FILENAME filepath

              filepath will contain full path.  If you just want file name:

              set filename [file tail $filepath]

            • #74385
              Johnny Anderson
              Participant

                The thread protocol is “file”, not “fileset-local”.  I made the changes anyway and ran a test.  Pathname and filename are blank.  

                I found this in User Guide 1:

                Note:Fileset-FTP and Fileset Local populate DRIVERCTL metadata with the

                Inbound filename as a keyed list entry {FILENAME xxx}.  

                I can’t change the thread protocol so I can’t get the filename by this method.  Is there another way?

              • #74386
                Charlie Bursell
                Participant

                  IMO, thee is never a legit reason to use File protocol for an IB thread,  Since you have to provide the file and restart the thread each time to read it you should already know the file name.

                  The File protocol is mostly provided for testing and not so much for production.  You would be much better off using Filset/Local

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