Fabio Candelora

Forum Replies Created

Viewing 2 replies – 1 through 2 (of 2 total)
  • Author
    Replies
  • in reply to: thread stops #68157
    Fabio Candelora
    Participant

      No as i wrote before here we use i Series ODBC Access DRiver from IBM.

      in reply to: thread stops #68155
      Fabio Candelora
      Participant

        hi Jim and Ron,

        first of all thx for your support, i’m glad that i am not the only one having this problem.

        here some info:

        i use the “iSeries ODBC Driver” via tcl script

        and below the details about the cloverleaf:


        Current Platform:

           Java version: 1.3.1_09

            Java vendor: Sun Microsystems Inc.

                OS type: Windows 2000

             OS version: 5.0

                OS arch: x86

        Server Build Information:

             Version: 5.3P_REV3

                Date: Mon Feb 14 2005

                Time: 11:50:03

            Platform: Windows_NT

         Java Vendor: Sun Microsystems Inc.

         JDK Version: 1.3

        Swing Version: 1.3

         RMI Version: 1.3


        by polling i mean that i make a select on the DB2 10 rows a time in order to extract the patient_updates.

        extract of tcl code for the process is:


        ######################################################################

        # Name:  poll_patient_table

        # Purpose:  polls the patient db using an ODBC connection to view

        #             CGFORAN0 on AS400

        # UPoC type:  tps

        # Args: tps keyedlist containing the following keys:

        #       MODE    run mode (“start”, “run” or “time”)

        #       MSGID   message handle

        #       ARGS    user-supplied arguments:

        #              

        #

        # Returns: tps disposition list:

        #          

        proc poll_patient_table { args } {

           keylget args MODE mode   ;# Fetch mode

           set dispList {}        ;# Nothing to return

           # Production environment

           set driver “iSeries Access ODBC Driver”

           set connstr “DSN=DOLO_DB2;PWD=*******;UID=********”

         

           switch -exact — $mode {

               start {

                   # Perform special init functions

               # N.B.: there may or may not be a MSGID key in args  

                   package require tclodbc

               }

               run {

               # ‘run’ mode always has a MSGID; fetch and process it

                   keylget args MSGID mh

                   lappend dispList “CONTINUE $mh”

               }

               time {

                   # Timer-based processing

                             

                   # Initialize the number of last record processed

                   set lastProgressNum [get_lastProgressNum]

                   #tps_print_msg “DEBUG” “poll_patient – lastProgressNum = $lastProgressNum”        

               

                 # connection to database

               database dbAna $connstr      

               #tps_print_msg “DEBUG” “poll_patient – connection to database $connstr done”

                   

               set maxCGIDM [dbAna “select MAX(CGIDM) from CGFORAN0”]

                   

               

          #  Patient database (anagrafe) fields read and corresponding list index in output    

                   #                            

                   #  0 RFSRA      TIPO RAPPORTO

                   #  1 RNLIB      ID INTERNO ANAGRAFE SMS     Patient ID

                   #  2 CGCOG      COGNOME                                 Surname

                   #  3 CGNME      NOME                                    Name

                   #  4 RDANS4     DATA DI NASCITA ASSISTITO – ANNO        Patient DOB – Year

                   #  5 RDMNS      DATA DI NASCITA ASSISTITO – MESE        Patient DOB – Month

                   #  6 RDGNS      DATA DI NASCITA ASSISTITO – GIORNO      Patient DOB – Day

                   #  7 RCSES      SESSO ASSISTITO M/F                          

                   #  8 CGGNS      COD.ISTAT COMUNE NASCITA                      

                   #  9 CGIRA      COD.ISTAT COMUNE RESIDENZA                      

                   # 10 RCCDA      CODICE CIRCOSCRIZIONE  

                   # 11 RDIST      CODICE AMBITO                                

                   # 12 RCMED      CODICE MEDICO DI BASE

                   # 13 RCODN      CODICE NAZIONE    

                   # 14 RCFIS      CODICE FISCALE                            

                   # 15 RNTES      NUMERO DI TESSERA SANITARIA

                   # 16 CGIDR      INDIRIZZO RESIDENZA  (VIA ,NR /ESP)

                   # 17 CGLRE      LOCALITA’ RESIDENZA

                   # 18 RCAPRE     CAP RESIDENZA              

                   # 19 CGULM      DATA ULTIMA MODIFICA  AAAAMMGG    

                   # 20 CGIDM      PROGRESSIVO

                   # 21 CGDEL      CANCELLATA S/N            

                   # 22 RNLIBF     ID INTERNO NUOVA PERSONA (PER FUSIONI)

                   # 23 CGTIPOV    I=INSERIMENTO V=VARIAZIONE      

                   # 24 CGIDO      INDIRIZZO DOMICILIO (VIA ,NR /ESP)                    

                   # 25 CGLOC      LOCALITA’ DOMICILIO

                   # 26 RCAPDO     CAP DOMICILIO              

                   # 27 CGIDA      COD.ISTAT COMUNE DOMICILIO  

                           

               

          tps_print_msg “DEBUG” “poll_patient – polling CGFORAN0 for rows where CGIDM > $lastProgressNum”

                   

                   set patients [dbAna “select RFSRA, RNLIB, CGCOG, CGNME, RDANS4, RDMNS, RDGNS, RCSES, CGGNS, CGIRA,

                                      RCCDA, RDIST, RCMED, RCODN, RCFIS, RNTES, CGIDR, CGLRE, RCAPRE, CGULM, CGIDM,

                                      CGDEL, RNLIBF, CGTIPOV, CGIDO, CGLOC, RCAPDO, CGIDA                      

                                      from CGFORAN0

                                      where CGIDM > $lastProgressNum

                                      fetch first 10 rows only”]

                             

                   set nrows [llength $patients]

                   if { $nrows > 0 } {

                       tps_print_msg “DEBUG” “poll_patient – select returned $nrows rows”

                   }

                   

                   

                   foreach patient $patients {

                       set surname [lindex $patient 2]

                       set name [lindex $patient 3]

                       set progr [lindex $patient 20]

                       tps_print_msg “DEBUG” “poll_patient – building msg for patient = $surname $name – CGIDM = $progr”

                       

                       set frlmsg [build_patient_frl $patient]

                       set mh [msgcreate $frlmsg]            

                       lappend dispList “CONTINUE $mh”

                       

                       set lastProgressNum $progr

                   }

                                 

                   dbAna disconnect

                 

                   set_lastProgressNum $lastProgressNum

               }

           # end of switch

           }

           return $dispList

        }

      Viewing 2 replies – 1 through 2 (of 2 total)