gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnumed-devel] database problems


From: Ian Haywood
Subject: [Gnumed-devel] database problems
Date: Sat, 24 Sep 2005 18:05:11 +1000
User-agent: Mozilla Thunderbird 1.0.6 (X11/20050912)

I have finally got the database working, I enclose a patch.

The test data still doesn't work from the scripts, but it does manually,
as this is mostly around fk_provider, I'm not going to investigate further,
assuming this will goad Karsten into finishing what he started.

Ian

address@hidden:~/gnumed/gnumed/server$ dpkg -l python
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                      Version                   Description
+++-=========================-=========================-==================================================================
ii  python                    2.4.1-0ubuntu2            An interactive 
high-level object-oriented language (default versio
address@hidden:~/gnumed/gnumed/server$ dpkg -l python2.4-pgsql
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                      Version                   Description
+++-=========================-=========================-==================================================================
ii  python2.4-pgsql           2.4.0-5ubuntu2            A Python DB-API 2.0 
interface to PostgreSQL v7.x
address@hidden:~/gnumed/gnumed/server$ dpkg -l postgresql
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed
|/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad)
||/ Name                      Version                   Description
+++-=========================-=========================-==================================================================
ii  postgresql                7.4.7-2ubuntu2.1          object-relational SQL 
database management system
address@hidden:~/gnumed/gnumed/server$




? diff1
? bootstrap/gmAuditSchemaGenerator.pyc
? bootstrap/gmNotificationSchemaGenerator.pyc
? bootstrap/gmScoringSchemaGenerator.pyc
? bootstrap/redo-public.log
Index: bootstrap/bootstrap_gm_db_system.py
===================================================================
RCS file: 
/cvsroot/gnumed/gnumed/gnumed/server/bootstrap/bootstrap_gm_db_system.py,v
retrieving revision 1.8
diff -c -r1.8 bootstrap_gm_db_system.py
*** bootstrap/bootstrap_gm_db_system.py 13 Sep 2005 11:48:59 -0000      1.8
--- bootstrap/bootstrap_gm_db_system.py 24 Sep 2005 07:50:34 -0000
***************
*** 183,188 ****
--- 184,190 ----
                        host, port = cached_host
                else:
                        host = ''
+                       port = ''
        if passwd == 'blank' or passwd is None or len(passwd) == 0:
                if cached_passwd.has_key (user):
                        passwd = cached_passwd[user]
***************
*** 706,712 ****
                return self.conn and 1
        #--------------------------------------------------------------
        def __db_exists(self):
!               cmd = "SELECT datname FROM pg_database WHERE datname='%s'" % 
self.name
  
                aCursor = self.conn.cursor()
                try:
--- 708,714 ----
                return self.conn and 1
        #--------------------------------------------------------------
        def __db_exists(self):
!               cmd = "BEGIN; SELECT datname FROM pg_database WHERE 
datname='%s'" % self.name
  
                aCursor = self.conn.cursor()
                try:
***************
*** 715,721 ****
                        _log.LogException(">>>[%s]<<< failed." % cmd, 
sys.exc_info(), verbose=1)
                        return None
  
!               res = aCursor.fetchone()
                tmp = aCursor.rowcount
                aCursor.close()
                if tmp == 1:
--- 717,723 ----
                        _log.LogException(">>>[%s]<<< failed." % cmd, 
sys.exc_info(), verbose=1)
                        return None
  
!               res = aCursor.fetchall()
                tmp = aCursor.rowcount
                aCursor.close()
                if tmp == 1:
***************
Index: sql/gmClinicalViews.sql
===================================================================
RCS file: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmClinicalViews.sql,v
retrieving revision 1.153
diff -c -r1.153 gmClinicalViews.sql
*** sql/gmClinicalViews.sql     22 Sep 2005 15:43:48 -0000      1.153
--- sql/gmClinicalViews.sql     24 Sep 2005 07:50:35 -0000
***************
*** 1037,1043 ****
        cle.last_affirmed as last_affirmed,
        cle.fk_location as pk_location,
        cle.fk_type as pk_type,
!       cle.xmin as xmin_clin_encounter
  from
        clin_encounter cle,
        encounter_type et
--- 1037,1044 ----
        cle.last_affirmed as last_affirmed,
        cle.fk_location as pk_location,
        cle.fk_type as pk_type,
!       cle.xmin as xmin_clin_encounter,
!       cle.fk_provider as pk_provider
  from
        clin_encounter cle,
        encounter_type et
***************
*** 1061,1067 ****
        ce1.started as started,
        ce1.last_affirmed as last_affirmed,
        ce1.fk_type as pk_type,
!       ce1.fk_location as pk_location,
  from
        clin_encounter ce1,
        encounter_type et
--- 1062,1068 ----
        ce1.started as started,
        ce1.last_affirmed as last_affirmed,
        ce1.fk_type as pk_type,
!       ce1.fk_location as pk_location
  from
        clin_encounter ce1,
        encounter_type et
Index: sql/gmclinical.sql
===================================================================
RCS file: /cvsroot/gnumed/gnumed/gnumed/server/sql/gmclinical.sql,v
retrieving revision 1.165
diff -c -r1.165 gmclinical.sql
*** sql/gmclinical.sql  22 Sep 2005 15:40:43 -0000      1.165
--- sql/gmclinical.sql  24 Sep 2005 07:50:35 -0000
***************
*** 175,180 ****
--- 175,185 ----
                references xlnk_identity(xfk_identity)
                on update cascade
                on delete restrict,
+       fk_provider integer
+               not null
+               references xlnk_identity (xfk_identity)
+               on update cascade
+               on delete restrict,
        fk_type integer
                not null
                default 1
Index: sql/test-data/test_data-James_Kirk.sql
===================================================================
RCS file: 
/cvsroot/gnumed/gnumed/gnumed/server/sql/test-data/test_data-James_Kirk.sql,v
retrieving revision 1.55
diff -c -r1.55 test_data-James_Kirk.sql
*** sql/test-data/test_data-James_Kirk.sql      19 Sep 2005 16:27:48 -0000      
1.55
--- sql/test-data/test_data-James_Kirk.sql      24 Sep 2005 07:50:36 -0000
***************
*** 123,129 ****
  ) values (
        currval('identity_pk_seq'),
        -1,
!       (select pk_staff from v_staff where firstnames='Leonard Horatio' and 
lastnames='McCoy' and dob='1920-1-20+2:00'),
        (select pk from encounter_type where description='in surgery'),
        '2000-9-17 17:13',
        '2000-9-17 19:33',
--- 123,129 ----
  ) values (
        currval('identity_pk_seq'),
        -1,
!       (select xlnk_identity.pk from v_staff, xlnk_identity  where 
firstnames='Leonard Horatio' and lastnames='McCoy' and dob='1920-1-20+2:00' and 
xlnk_identity.xfk_identity = pk_staff),
        (select pk from encounter_type where description='in surgery'),
        '2000-9-17 17:13',
        '2000-9-17 19:33',

Attachment: signature.asc
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]