Jim Vilbrandt

Forum Replies Created

Viewing 15 replies – 1 through 15 (of 22 total)
  • Author
    Replies
  • in reply to: BASIC CLEANUP TASKS #121779
    Jim Vilbrandt
    Participant

      Hi Omar,

      I also wanted to setup Windows Tasks to perform daily tasks in Cloverleaf. After exetensive searching, I found the section “crontab in Windows” in the Infor Cloverleaf Integartion Services User Guide.

      It appears that you can only run BAT files (PS1 files did not work for me).

      The Windows Task Action is Start Program PowerShell with the Arguments “-Command Start-Process -Verb RunAs <path_to_your_batch.bat>

      Here is how a batch file for exporting the Site Documentation would look:

      @echo off
      call setroot
      call hcisitedoc -s site1
      call hcisitedoc -s site2

      I hope that helps!

      Best Regards from Germany, Jim Vilbrandt

      in reply to: Document Conversions #121769
      Jim Vilbrandt
      Participant

        Hi Jason,

        We utilize a third party product installed on a windows server that monitors a folder or folders for documents. These are then converted to the desired format and written to a secondary folder. The secondary folder is monitored by Cloverleaf.

        In our case, the originating system writes an HL7 message to the secondary folder and the original document to the primary folder with the same file name. Cloverleaf has a IB-parse TPS that only processes documents when both files are present in the secondary folder.

        There are several products that can be used for the document conversion, but most of the software that you can download for free are too limited.

        Best Regards, Jim

        in reply to: Error replaying JSON message Cloverleaf 22 #121754
        Jim Vilbrandt
        Participant

          I have this issue with 22 as well. Set the encoding to “bypass” and you can then resend the message. Not sure why.

          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.
                                Viewing 15 replies – 1 through 15 (of 22 total)