[med-svn] [Git][med-team/gnumed-client][upstream] New upstream version 1.8.25+dfsg
Marc Angermann (@marc_a)
gitlab at salsa.debian.org
Mon Sep 7 20:22:07 BST 2026
Marc Angermann pushed to branch upstream at Debian Med / gnumed-client
Commits:
2ddbf905 by Marc Angermann at 2026-09-07T21:14:27+02:00
New upstream version 1.8.25+dfsg
- - - - -
4 changed files:
- client/CHANGELOG
- client/business/gmDocuments.py
- client/doc/schema/gnumed-entire_schema.html
- client/gnumed.py
Changes:
=====================================
client/CHANGELOG
=====================================
@@ -6,6 +6,10 @@
# rel-1-8-maint
------------------------------------------------
+ 1.8.25
+
+IMPROVED: speed of document/part access [thanks Marc]
+
1.8.24
FIX: more robust UI update when quickly scrolling document tree
@@ -2302,6 +2306,10 @@ FIX: missing cast to ::text in dem.date_trunc_utc() calls
# gnumed_v22
------------------------------------------------
+ 22.35
+
+IMPROVED: speed of i18n._() [thanks Marc]
+
22.34
FIX: bootstrapping: chicken-egg-problem with gm-dbo vs groups creation
=====================================
client/business/gmDocuments.py
=====================================
@@ -168,20 +168,20 @@ class cDocumentFolder:
def get_unsigned_documents(self):
args = {'pat': self.pk_patient}
cmd = _SQL_get_document_fields % """
- pk_doc IN (
+ pk_doc = ANY(ARRAY(
SELECT DISTINCT ON (b_vo.pk_doc) b_vo.pk_doc
FROM blobs.v_obj4doc_no_data b_vo
WHERE
pk_patient = %(pat)s
AND
reviewed IS FALSE
- )
+ ))
ORDER BY clin_when DESC"""
rows, idx = gmPG2.run_ro_queries(queries = [{'cmd': cmd, 'args': args}], get_col_idx = True)
return [ cDocument(row = {'pk_field': 'pk_doc', 'idx': idx, 'data': r}) for r in rows ]
#--------------------------------------------------------
- def get_documents(self, doc_type=None, pk_episodes=None, encounter=None, order_by=None, exclude_unsigned=False, pk_types=None):
+ def get_documents(self, doc_type:int|str=None, pk_episodes:list[int]=None, encounter:int=None, order_by:str=None, exclude_unsigned:bool=False, pk_types:list[int]=None):
"""Return list of documents."""
args = {
@@ -190,34 +190,28 @@ class cDocumentFolder:
'enc': encounter
}
where_parts = ['pk_patient = %(pat)s']
-
if doc_type is not None:
try:
int(doc_type)
where_parts.append('pk_type = %(type)s')
except (TypeError, ValueError):
where_parts.append('pk_type = (SELECT pk FROM blobs.doc_type WHERE name = %(type)s)')
-
if pk_types is not None:
where_parts.append('pk_type IN %(pk_types)s')
args['pk_types'] = tuple(pk_types)
-
if (pk_episodes is not None) and (len(pk_episodes) > 0):
where_parts.append('pk_episode IN %(epis)s')
args['epis'] = tuple(pk_episodes)
-
if encounter is not None:
where_parts.append('pk_encounter = %(enc)s')
-
if exclude_unsigned:
- where_parts.append('pk_doc IN (SELECT b_vo.pk_doc FROM blobs.v_obj4doc_no_data b_vo WHERE b_vo.pk_patient = %(pat)s AND b_vo.reviewed IS TRUE)')
-
+ where_parts.append(
+ 'pk_doc = ANY(ARRAY(SELECT b_vo.pk_doc FROM blobs.v_obj4doc_no_data b_vo WHERE b_vo.pk_patient = %(pat)s AND b_vo.reviewed IS TRUE))'
+ )
if order_by is None:
order_by = 'ORDER BY clin_when'
-
cmd = "%s\n%s" % (_SQL_get_document_fields % ' AND '.join(where_parts), order_by)
rows, idx = gmPG2.run_ro_queries(queries = [{'cmd': cmd, 'args': args}], get_col_idx = True)
-
return [ cDocument(row = {'pk_field': 'pk_doc', 'idx': idx, 'data': r}) for r in rows ]
documents = property(get_documents, lambda x:x)
@@ -254,7 +248,15 @@ _SQL_get_document_part_fields = "select * from blobs.v_obj4doc_no_data where %s"
class cDocumentPart(gmBusinessDBObject.cBusinessDBObject):
"""Represents one part of a medical document."""
- _cmd_fetch_payload = _SQL_get_document_part_fields % "pk_obj = %s"
+ # NOTE: filtering blobs.v_obj4doc_no_data by pk_obj alone defeats predicate
+ # pushdown through the underlying blobs.v_doc_med view (its LEFT JOINs keep
+ # the planner from reaching blobs.doc_med via an index scan), forcing a full
+ # hash join over every document/encounter/episode in the database on every
+ # single document-part load. Rewriting as a single-parameter row comparison
+ # against a subquery on blobs.doc_obj lets the planner hoist it into an
+ # InitPlan and use index scans throughout (measured: ~5.9s -> ~2.5ms on a
+ # database with ~110k documents). See performance report for details.
+ _cmd_fetch_payload = _SQL_get_document_part_fields % '(pk_doc, pk_obj) = (select fk_doc, pk from blobs.doc_obj where pk = %s)'
_cmds_store_payload = [
"""UPDATE blobs.doc_obj SET
seq_idx = %(seq_idx)s,
=====================================
client/doc/schema/gnumed-entire_schema.html
=====================================
@@ -112,7 +112,7 @@
<body>
<!-- Primary Index -->
-<p><br><br>Dumped on 2026-04-16</p>
+<p><br><br>Dumped on 2026-09-06</p>
<h1><a name="index">Index of database - gnumed_v22</a></h1>
<ul>
@@ -130735,36 +130735,20 @@ WHERE (NOT
<a href="gnumed-entire_schema.html#i18n.schema">i18n</a>.<a name="i18n.function.-text-text">_(text, text)</a>
</h2>
<h3>Returns: text</h3>
-<h3>Language: PLPGSQL</h3>
-<p>will return either the translation into <lang>::text
- (2nd argument) for the current user or the input,
- created in public schema for easy access,
- will fallback to "xx" if xx_XX does not exist</p>
+<h3>Language: SQL</h3>
+<p>Returns either the translation of 1st argument into language
+in 2nd argument, or the input if no translation is found.
+.
+Falls back to "xx" if language "xx_XX at YY" does not translate.
+</p>
<pre>
-DECLARE
- _orig alias for $1;
- _lang alias for $2;
- trans_str text;
-BEGIN
- select into trans_str trans from i18n.translations where lang = _lang and orig = _orig;
- if not found then
- -- reduce xx_XX at YY to xx
- select into trans_str trans from i18n.translations where lang = regexp_replace(_lang, '_.*$', '') and orig = _orig;
- if not found then
- return _orig;
- end if;
--- if not found then
--- -- check "generic" dummy translation used to work around accentuation problems
--- select into trans_str trans from i18n.translations where lang = 'generic' and orig = _orig;
---
--- if not found then
--- return _orig;
--- end if;
--- end if;
- end if;
- return trans_str;
-END;
-</pre>
+SELECT COALESCE (
+ (SELECT trans FROM i18n.translations WHERE lang = $2 AND orig = $1),
+ -- reduce xx_XX at YY to xx
+ (SELECT trans FROM i18n.translations WHERE lang = regexp_replace($2, '_.*$', '') AND orig = $1),
+ -- return untranslated string
+ $1
+)</pre>
<hr>
<h2>Function:
=====================================
client/gnumed.py
=====================================
@@ -97,7 +97,7 @@ against. Please run GNUmed as a non-root user.
sys.exit(1)
#----------------------------------------------------------
-current_client_version = '1.8.24'
+current_client_version = '1.8.25'
current_client_branch = '1.8'
_log = None
View it on GitLab: https://salsa.debian.org/med-team/gnumed-client/-/commit/2ddbf90596b786acb3ac53202846093e7bf9f554
--
View it on GitLab: https://salsa.debian.org/med-team/gnumed-client/-/commit/2ddbf90596b786acb3ac53202846093e7bf9f554
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://alioth-lists.debian.net/pipermail/debian-med-commit/attachments/20260907/fe5ea971/attachment-0001.htm>
More information about the debian-med-commit
mailing list