Jim Vilbrandt

Forum Replies Created

Viewing 15 replies – 1 through 15 (of 19 total)
  • Author
    Replies
  • in reply to: Help with writing UPOC using TCL #121621
    Jim Vilbrandt
    Participant

      Hi Rin,

      I would suggest using a directory parse TPS for this purpose. The “message” you receive in this script type is a list of files in the configured directory.

      Below you will find some pseudo code for this purpose.

      Best Regards, Jim
      <pre>
      # Get Input Path from NetConfig
      set conndata [netconfig get connection data $HciConnName]
      set ibdir [keylget conndata PROTOCOL.IBDIR]

      # List of files found
      set listing [msgget $mh]
      set newlist “”

      foreach entry $listing {
      # Check contents of each file
      set fileName [cconcat $ibdir “/” $entry]
      set fh [open $fileName]
      fconfigure $fh -translation binary
      set msg {}; set msg [read $fh]
      close $fh
      <add your logic here to determine which files should be processed>
      if {<keep>} {
      lappend newlist $entry
      } else {
      file delete [cconcat $ibdir “/” $entry]
      }
      }
      # Pass new list to engine
      msgset $mh $newlist
      lappend dispList “CONTINUE $mh”</pre>
       

      in reply to: dblookup join #121570
      Jim Vilbrandt
      Participant

        Hi Rick,

        Here is a simple join for a MSSQL Database:

        select d.name_doc, lower(d.feld9) as file_ext, m.name as medium from object65 d, medien m where d.feld32 = <docid> and d.flags in (1,2,16) and m.id = d.medium_doc

        The SQL will differ depending on what database you are trying to access (ie: Oracle, MSSQL, SQLite, PostgreSQL, etc.). I always develop the query in the native Database browser first. If it works there, then in should work from Cloverleaf.

        Best Regards, Jim

        Jim Vilbrandt
        Participant

          We have a system that exports personnel events to a CSV file. This file is then processed through a Windows Task and PowerShell. Each the personnel data in CSV is then augmented with information from Active Directory before it is written to a second CSV. This second CSV is then sent to various systems by Cloverleaf in the format they are expecting. This would be an easy work-around if you can’t get the TCL/AD connection to work.

          Jim Vilbrandt
          Participant

            Hi Jim,

            I am running inbound stored procedures with both Oracle and MSSQL. The process is very different for both. I am not passing parameters to the called procedure, so I am curious if someone has accomplished this.

            Oracle:
            CREATE OR REPLACE PROCEDURE cp_clv_test(out_var out sys_refcursor)
            IS
            BEGIN
            open out_var for select <values> from <tablename> where <qualification>;
            END;

            Read Action: {call cp_clv_test(rowset OUT CURSOR)}

            MSSQL:

            CREATE PROCEDURE cp_clv_test
            AS
            BEGIN
            SET NOCOUNT ON;
            select <values> from <tablename> where <qualification>;
            RETURN;
            END;

            Read Action: {call cp_clv_test()}

            You can update the row sent in this way:

            Read Success Action: UPDATE <tablename> SET <fieldname>=<value> WHERE <fieldname>=<<passedvalue>>

            Note: passedvalue must be a field returned by the stored procedure and must be enclosed in <>.

            I hope that helps!

            Are you aware that CentOS reached “end of life” on 30.06.2024???

            Best Regards from Germany, Jim Vilbrandt

            Jim Vilbrandt
            Participant

              Here’s one more:
              <pre>set inStr [lindex $xlateInVals 0]
              if [clength $inStr] {
              set obStr [fmtclock [clock scan $inStr -format %Y%m%d%H%M%S] “%m/%d/%Y %H:%M:%S”]
              xpmstore $xlateId [lindex $xlateOutList 0] c $obStr
              }</pre>

              in reply to: Xlate: Issue getting hex 0d in field using COPY Action #121265
              Jim Vilbrandt
              Participant

                Hi Jim,

                In HRL definitions, you need to use ‘\xd’. You might try that.

                Regards, Jim

                in reply to: Log into the xlates #121186
                Jim Vilbrandt
                Participant

                  Hello,

                  not sure if I understand your question, but you can always add the following line to a Pre or Post Proc of most actions (Copy, Concat, Table, Call):

                  echo [lindex $xlateInVals 0]

                  = or =

                  echo “Value: [lindex $xlateInVals 0]”

                  You will see the results in “Browse/Watch Output” for the process where the sending process/route is located. Or in the output window when debuging an XLate.

                  When this is in the Pre Proc, this is the value of the first argument passed into the action. In the Post Proc, it is the first value returned by the action (ie: the value returned from the table action).

                  Some actions do not have pre/post procs, but you can always add a dummy copy before or after to evaluate variables/fields.

                  Best Regards, Jim

                  in reply to: NetConfig extract “DEST” and “TRXID” #121121
                  Jim Vilbrandt
                  Participant

                    Hello Joe,

                    DATAXLATE is a single list with a list of 0-n routes and the routes contain lists of 0-n route details.

                    Get the list of routes:

                    set rteLst [lindex $dataxlate]

                    Then loop through the list looking for the fields you want:

                    foreach rte $rteLst {
                      keylget rte TRXID trxid
                      echo $trxid
                    }

                    Regards, Jim

                    in reply to: Thread IP and ports #121046
                    Jim Vilbrandt
                    Participant

                      Hi John,

                      I wrote these two Scripts that are included as Inbound Data TPS on two timer threads that run once a night. They create CSV files once a day that contain details for all threads defined in the SITES argument. One is for Protocol details, the second for Route details.

                      Here is how the TPS Args are configured:

                      {SITES {site1 site2 site3}}
                      {DEBUG 0}

                      The threads are configured as fileset-local that function both as an inbound (the file from the previous run is the “trigger”) and an outbound. Warning! – the thread will “consume” all files in the target directory, so you will need a dedicated directory for each thread. I use a filename filter “Directory Parse” TPS, so both files can co-exist in one directory.

                      The scripts are running on both Unix and Windows platforms.

                      Regards from Germany, Jim Vilbrandt

                      Attachments:
                      You must be logged in to view attached files.
                      in reply to: Clover call Store procedure issue #120999
                      Jim Vilbrandt
                      Participant

                        As long as your calling a stored procedure, why not create the complete HL7 message there and return it as a string? I have a couple database query interfaces (without a called procedure) that return each HL7 segment as a field. I then replace commas and quotes in an inbound data TPS. As you are dealing with a variable number of segments, it would be better to deliver the HL7 as a single string.

                        in reply to: Iterate from 2 #120924
                        Jim Vilbrandt
                        Participant

                          Hi Doug,

                          what about reading all OBX segments into a TCL list in an inbound data TPS, then sorting that list before sending to the XLate?

                          I would create a list with two fields, the first is your sort criteria and the second is the raw OBX string.

                          keylget args MSGID mh

                          # Get HL7 Message
                          set msg [msgget $mh]
                          set segs [split $msg “\x0d”]
                          set fdlm [cindex $segs 4] ;# HL7 Field Delimiter
                          set cdlm [cindex $segs 5] ;# HL7 Component Delimiter
                          set rdlm [cindex $segs 6] ;# HL7 Repeat Delimiter
                          set sdlm [cindex $segs 8] ;# HL7 Sub-Component Delimiter
                          set mshID {}

                          foreach seg $segs {
                          set fields [split $seg $fdlm]
                          set segname [lindex $fields 0]
                          switch -regexp — $segname {
                          OBX {…

                          Regards, Jim

                          in reply to: Thread Build Check using netcfg tcl commands #120913
                          Jim Vilbrandt
                          Participant

                            Hi Joe,

                            This is not exactly what you asked for but should be a good start. As Cloverleaf version compare does not allow you to compare the current (unsaved) version, I created the attached script to show the differences between the current netconfig and the previously versioned netconfig. I wrote it and use it in an Unix environment, so I don’t know how it will work under Windows.

                            Best regards from Germany, Jim Vilbrandt

                            Attachments:
                            You must be logged in to view attached files.
                            in reply to: Generate xlt using javascript #120882
                            Jim Vilbrandt
                            Participant

                              Hi Doug,

                              XLate scripts are not TCL. But you can include TCL scripts and snippets in an XLate. Either within a Call or Pre/Post Proc steps. XLates do not support a CASE/SWITCH statement, but TCL does have a SWITCH. When I need a SWITCH, I often put this logic in Call.

                              I have not implemented Java Script yet, as we need to upgrade our Cloverleaf machine first. Rob Abbot presented last week in Fulda, Germany that the latest version of Cloverleaf also supports Python.

                              Best Regards from Berlin, Jim

                              in reply to: Arranging field address order in Field Routing #120830
                              Jim Vilbrandt
                              Participant

                                Hi Jim,

                                I wrote the attached Inbound Data TPS just for this purpose.

                                Regards, Jim

                                Attachments:
                                You must be logged in to view attached files.
                                in reply to: Pull oauth2 token from ib_reply #120700
                                Jim Vilbrandt
                                Participant

                                  Hi Bill,

                                  Have you gotten any further with your OAUTH2 development? I need to implement an outbound REST interface with JSON Web Tokens and don’t want to reinvent the wheel.

                                  It would be great if someone could upload the configuration details (Box?) containing both a receiving (Server) and sending (Client) threads for testing purposes.

                                  Best regards from Germany! Jim Vilbrandt

                                Viewing 15 replies – 1 through 15 (of 19 total)