[med-svn] [gnumed-client] 01/05: Imported Upstream version 1.5.10+dfsg

Andreas Tille tille at debian.org
Sun Jan 31 08:18:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

tille pushed a commit to branch master
in repository gnumed-client.

commit 0ed370fe45e49abd7ce0ce1c267ad1b098736678
Author: Andreas Tille <tille at debian.org>
Date:   Sun Jan 31 09:06:28 2016 +0100

    Imported Upstream version 1.5.10+dfsg
---
 client/CHANGELOG                            | 13 +++++++++++
 client/business/gmPerson.py                 | 36 +++++++++++++++++++++++------
 client/doc/schema/gnumed-entire_schema.html |  2 +-
 client/gnumed.py                            |  2 +-
 client/pycommon/gmNull.py                   |  4 ++--
 5 files changed, 46 insertions(+), 11 deletions(-)

diff --git a/client/CHANGELOG b/client/CHANGELOG
index bc690e4..42fe778 100644
--- a/client/CHANGELOG
+++ b/client/CHANGELOG
@@ -6,6 +6,10 @@
 # rel-1-5-patches
 ------------------------------------------------
 
+	1.5.10
+
+FIX: patient merging, again [thanks Marc]
+
 	1.5.9
 
 FIX: patient merging [thanks Marc]
@@ -1614,6 +1618,11 @@ FIX: missing cast to ::text in dem.date_trunc_utc() calls
 # gnumed_v20
 ------------------------------------------------
 
+	20.10
+
+FIX: pg_trgm placement and use
+FIX: clin.substance_intake.fk_episode SET NOT NULL
+
 	20.3
 
 FIX: setting FK to clin.test_org on dangling test types, really, this time
@@ -1643,6 +1652,10 @@ NEW: bootstrapper now REINDEXes after upgrade
 # gnumed_v19
 ------------------------------------------------
 
+	19.16
+
+FIX: pg_trgm placement and use
+
 	19.11
 
 IMPROVED: sorting of bill item PKs in bills view [thanks Marc]
diff --git a/client/business/gmPerson.py b/client/business/gmPerson.py
index 072954e..9fb701d 100644
--- a/client/business/gmPerson.py
+++ b/client/business/gmPerson.py
@@ -608,6 +608,7 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 			'first': self._payload[self._idx['firstnames']],
 			'nick': gmTools.coalesce(self._payload[self._idx['preferred']], u'', u" '%s'")
 		}
+
 	#--------------------------------------------------------
 	def add_name(self, firstnames, lastnames, active=True):
 		"""Add a name.
@@ -621,6 +622,7 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 		if active:
 			self.refetch_payload()
 		return name
+
 	#--------------------------------------------------------
 	def delete_name(self, name=None):
 		cmd = u"delete from dem.names where id = %(name)s and id_identity = %(pat)s"
@@ -629,6 +631,7 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 		# can't have been the active name as that would raise an
 		# exception (since no active name would be left) so no
 		# data refetch needed
+
 	#--------------------------------------------------------
 	def set_nickname(self, nickname=None):
 		"""
@@ -646,6 +649,7 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 		self._payload[self._idx['preferred']] = nickname
 		#self.refetch_payload()
 		return True
+
 	#--------------------------------------------------------
 	def get_tags(self, order_by=None):
 		if order_by is None:
@@ -659,6 +663,7 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 		return [ gmDemographicRecord.cIdentityTag(row = {'data': r, 'idx': idx, 'pk_field': 'pk_identity_tag'}) for r in rows ]
 
 	tags = property(get_tags, lambda x:x)
+
 	#--------------------------------------------------------
 	def add_tag(self, tag):
 		args = {
@@ -685,10 +690,12 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 		"""
 		rows, idx = gmPG2.run_rw_queries(queries = [{'cmd': cmd, 'args': args}], return_data = True, get_col_idx = False)
 		return gmDemographicRecord.cIdentityTag(aPK_obj = rows[0]['pk'])
+
 	#--------------------------------------------------------
 	def remove_tag(self, tag):
 		cmd = u"DELETE FROM dem.identity_tag WHERE pk = %(pk)s"
 		gmPG2.run_rw_queries(queries = [{'cmd': cmd, 'args': {'pk': tag}}])
+
 	#--------------------------------------------------------
 	# external ID API
 	#
@@ -775,6 +782,7 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 					cmd = u"update dem.lnk_identity2ext_id set comment = %(comment)s where id=%(pk)s"
 					args = {'comment': comment, 'pk': row['pk_id']}
 					rows, idx = gmPG2.run_rw_queries(queries = [{'cmd': cmd, 'args': args}])
+
 	#--------------------------------------------------------
 	def update_external_id(self, pk_id=None, type=None, value=None, issuer=None, comment=None):
 		"""Edits an existing external ID.
@@ -810,6 +818,7 @@ class cIdentity(gmBusinessDBObject.cBusinessDBObject):
 		return rows
 
 	external_ids = property(get_external_ids, lambda x:x)
+
 	#--------------------------------------------------------
 	def delete_external_id(self, pk_ext_id=None):
 		cmd = u"""
@@ -817,6 +826,7 @@ delete from dem.lnk_identity2ext_id
 where id_identity = %(pat)s and id = %(pk)s"""
 		args = {'pat': self.ID, 'pk': pk_ext_id}
 		gmPG2.run_rw_queries(queries = [{'cmd': cmd, 'args': args}])
+
 	#--------------------------------------------------------
 	def assimilate_identity(self, other_identity=None, link_obj=None):
 		"""Merge another identity into this one.
@@ -841,6 +851,11 @@ where id_identity = %(pat)s and id = %(pk)s"""
 					has_allergy = greatest (
 						(SELECT has_allergy FROM clin.v_pat_allergy_state WHERE pk_patient = %(pat2del)s),
 						(SELECT has_allergy FROM clin.v_pat_allergy_state WHERE pk_patient = %(pat2keep)s)
+					),
+					-- perhaps use least() to play it safe and make it appear longer ago than it might have been, actually ?
+					last_confirmed = greatest (
+						(SELECT last_confirmed FROM clin.v_pat_allergy_state WHERE pk_patient = %(pat2del)s),
+						(SELECT last_confirmed FROM clin.v_pat_allergy_state WHERE pk_patient = %(pat2keep)s)
 					)
 				WHERE
 					pk = (SELECT pk_allergy_state FROM clin.v_pat_allergy_state WHERE pk_patient = %(pat2keep)s)
@@ -908,13 +923,6 @@ where id_identity = %(pat)s and id = %(pk)s"""
 			'args': args
 		})
 
-		# find FKs pointing to identity
-		FKs = gmPG2.get_foreign_keys2column (
-			schema = u'dem',
-			table = u'identity',
-			column = u'pk'
-		)
-
 		# disambiguate potential dupes
 		# - same-url comm channels
 		queries.append ({
@@ -966,6 +974,19 @@ where id_identity = %(pat)s and id = %(pk)s"""
 			'args': args
 		})
 
+		# find FKs pointing to dem.identity.pk
+		FKs = gmPG2.get_foreign_keys2column (
+			schema = u'dem',
+			table = u'identity',
+			column = u'pk'
+		)
+		# find FKs pointing to clin.patient.fk_identity
+		FKs.extend (gmPG2.get_foreign_keys2column (
+			schema = u'clin',
+			table = u'patient',
+			column = u'fk_identity'
+		))
+
 		# generate UPDATEs
 		cmd_template = u'UPDATE %s SET %s = %%(pat2keep)s WHERE %s = %%(pat2del)s'
 		for FK in FKs:
@@ -1010,6 +1031,7 @@ where id_identity = %(pat)s and id = %(pk)s"""
 		)
 
 		return True, None
+
 	#--------------------------------------------------------
 	#--------------------------------------------------------
 	def put_on_waiting_list(self, urgency=0, comment=None, zone=None):
diff --git a/client/doc/schema/gnumed-entire_schema.html b/client/doc/schema/gnumed-entire_schema.html
index fd98f2c..713c711 100644
--- a/client/doc/schema/gnumed-entire_schema.html
+++ b/client/doc/schema/gnumed-entire_schema.html
@@ -112,7 +112,7 @@
   <body>
 
     <!-- Primary Index -->
-	<p><br><br>Dumped on 2015-11-21</p>
+	<p><br><br>Dumped on 2016-01-27</p>
 <h1><a name="index">Index of database - gnumed_v20</a></h1>
 <ul>
     
diff --git a/client/gnumed.py b/client/gnumed.py
index cb834a4..5050126 100644
--- a/client/gnumed.py
+++ b/client/gnumed.py
@@ -86,7 +86,7 @@ against. Please run GNUmed as a non-root user.
 	sys.exit(1)
 
 #----------------------------------------------------------
-current_client_version = u'1.5.9'
+current_client_version = u'1.5.10'
 current_client_branch = u'1.5'
 
 _log = None
diff --git a/client/pycommon/gmNull.py b/client/pycommon/gmNull.py
index 2bc48a3..8967d80 100644
--- a/client/pycommon/gmNull.py
+++ b/client/pycommon/gmNull.py
@@ -113,7 +113,7 @@ class cNull(object):
 
 	def __str__(self):
 		"Convert to a string and return it."
-		return 'cNull instance'
+		return '<cNull instance>'
 
 	def __nonzero__(self):
 		_log.debug(u'returns 0')
@@ -162,7 +162,7 @@ def test():
 	# representation and conversion to a string
 	tmp = '<cNull instance @ %s>' % id(n)
 	assert repr(n) == tmp
-	assert str(n) == 'cNull instance'
+	assert str(n) == '<cNull instance>'
 
 	# comparing
 	if n == 1:

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/gnumed-client.git



More information about the debian-med-commit mailing list