[med-svn] [gnumed-server] 01/09: Imported Upstream version 21.5
Andreas Tille
tille at debian.org
Fri May 27 13:05:58 UTC 2016
This is an automated email from the git hooks/post-receive script.
tille pushed a commit to branch master
in repository gnumed-server.
commit 554adeb6dbe34f3fe7d24c5cfb7b6c4599858e89
Author: Andreas Tille <tille at debian.org>
Date: Tue Apr 26 00:16:27 2016 +0200
Imported Upstream version 21.5
---
server/bootstrap/fixup_db-v21.conf | 1 +
server/bootstrap/update_db-v20_v21.conf | 3 +-
server/bootstrap/update_db-v21_v22.conf | 3 ++
server/doc/schema/gnumed-entire_schema.html | 2 +-
server/pycommon/gmPG2.py | 13 +++++-
server/pycommon/gmTools.py | 11 +++--
.../v20-v21/dynamic/v21-release_notes-dynamic.sql | 29 ++++++-------
.../fixups/v21-ref-auto_hint-tetanus_STIKO.sql | 48 ++++++++++++++++++++++
8 files changed, 88 insertions(+), 22 deletions(-)
diff --git a/server/bootstrap/fixup_db-v21.conf b/server/bootstrap/fixup_db-v21.conf
index d140a39..2522fa3 100644
--- a/server/bootstrap/fixup_db-v21.conf
+++ b/server/bootstrap/fixup_db-v21.conf
@@ -29,6 +29,7 @@ schema base directory = ../sql/v20-v21/fixups/
schema = $schema$
v21-dem-view_grants-fixup.sql
../dynamic/v21-release_notes-dynamic.sql
+v21-ref-auto_hint-tetanus_STIKO.sql
$schema$
#----------------------------------
diff --git a/server/bootstrap/update_db-v20_v21.conf b/server/bootstrap/update_db-v20_v21.conf
index 072e6c3..d72086e 100644
--- a/server/bootstrap/update_db-v20_v21.conf
+++ b/server/bootstrap/update_db-v20_v21.conf
@@ -120,6 +120,7 @@ minimum postgresql version = 9.2
schema base directory = ../sql/v20-v21/fixups/
schema = $schema$
v21-dem-view_grants-fixup.sql
+v21-ref-auto_hint-tetanus_STIKO.sql
$schema$
#----------------------------------
@@ -244,7 +245,7 @@ clinical code links (total) - internal consistency::::select True
select ((select count(1) from clin.lnk_code2item_root) = (select ((select count(1) from clin.lnk_code2procedure) + (select count(1) from clin.lnk_code2rfe) + (select count(1) from clin.lnk_code2aoe) + (select count(1) from clin.lnk_code2episode) + (select count(1) from clin.lnk_code2h_issue) + (select count(1) from clin.lnk_code2narrative))))
paperwork templates::::select count(1) from ref.paperwork_templates
select count(1) - 3 from ref.paperwork_templates
-automatic hints::::select count(1) + 4 from ref.auto_hint
+automatic hints::::select count(1) + 5 from ref.auto_hint
select count(1) from ref.auto_hint
suppressed hints::::select count(1) from clin.suppressed_hint
select count(1) from clin.suppressed_hint
diff --git a/server/bootstrap/update_db-v21_v22.conf b/server/bootstrap/update_db-v21_v22.conf
index 53f6b84..ba1460c 100644
--- a/server/bootstrap/update_db-v21_v22.conf
+++ b/server/bootstrap/update_db-v21_v22.conf
@@ -37,6 +37,9 @@ database alias = gnumed_v22
minimum postgresql version = 9.2
schema base directory = ../sql/v20-v21/fixups/
schema = $schema$
+v21-dem-view_grants-fixup.sql
+../dynamic/v21-release_notes-dynamic.sql
+v21-ref-auto_hint-tetanus_STIKO.sql
$schema$
#----------------------------------
diff --git a/server/doc/schema/gnumed-entire_schema.html b/server/doc/schema/gnumed-entire_schema.html
index 95b0a78..c421c7c 100644
--- a/server/doc/schema/gnumed-entire_schema.html
+++ b/server/doc/schema/gnumed-entire_schema.html
@@ -112,7 +112,7 @@
<body>
<!-- Primary Index -->
- <p><br><br>Dumped on 2016-04-06</p>
+ <p><br><br>Dumped on 2016-04-25</p>
<h1><a name="index">Index of database - gnumed_v21</a></h1>
<ul>
diff --git a/server/pycommon/gmPG2.py b/server/pycommon/gmPG2.py
index d3f837d..acc0d09 100644
--- a/server/pycommon/gmPG2.py
+++ b/server/pycommon/gmPG2.py
@@ -88,6 +88,8 @@ FixedOffsetTimezone = dbapi.tz.FixedOffsetTimezone
_default_dsn = None
_default_login = None
+default_database = 'gnumed_v21'
+
postgresql_version_string = None
postgresql_version = None # accuracy: major.minor
@@ -289,6 +291,7 @@ def set_default_client_encoding(encoding = None):
_log.info('setting default client encoding from [%s] to [%s]' % (_default_client_encoding, str(encoding)))
_default_client_encoding = encoding
return True
+
#---------------------------------------------------
def set_default_client_timezone(timezone = None):
@@ -301,6 +304,7 @@ def set_default_client_timezone(timezone = None):
_sql_set_timezone = u'set timezone to %s'
return True
+
#---------------------------------------------------
def __validate_timezone(conn=None, timezone=None):
@@ -334,6 +338,7 @@ def __validate_timezone(conn=None, timezone=None):
conn.rollback()
return is_valid
+
#---------------------------------------------------
def __expand_timezone(conn=None, timezone=None):
"""some timezone defs are abbreviations so try to expand
@@ -366,6 +371,7 @@ where
conn.rollback()
return result
+
#---------------------------------------------------
def __detect_client_timezone(conn=None):
"""This is run on the very first connection."""
@@ -412,6 +418,7 @@ def __detect_client_timezone(conn=None):
_sql_set_timezone = u"set time zone interval %s hour to minute"
_log.info('client system time zone detected as equivalent to [%s]', _default_client_timezone)
+
# =======================================================================
# login API
# =======================================================================
@@ -423,7 +430,7 @@ def __request_login_params_tui():
print "\nPlease enter the required login parameters:"
try:
login.host = prompted_input(prompt = "host ('' = non-TCP/IP)", default = '')
- login.database = prompted_input(prompt = "database", default = 'gnumed_v21')
+ login.database = prompted_input(prompt = "database", default = default_database)
login.user = prompted_input(prompt = "user name", default = '')
tmp = 'password for "%s" (not shown): ' % login.user
login.password = getpass.getpass(tmp)
@@ -502,11 +509,13 @@ def make_psycopg2_dsn(database=None, host=None, port=5432, user=None, password=N
dsn_parts.append('sslmode=prefer')
return ' '.join(dsn_parts)
+
# ------------------------------------------------------
def get_default_login():
# make sure we do have a login
get_default_dsn()
return _default_login
+
# ------------------------------------------------------
def get_default_dsn():
global _default_dsn
@@ -517,6 +526,7 @@ def get_default_dsn():
set_default_login(login=login)
return _default_dsn
+
# ------------------------------------------------------
def set_default_login(login=None):
if login is None:
@@ -563,6 +573,7 @@ def log_auth_environment():
_log.debug('$PGPASSFILE=%s not found')
except Exception:
_log.exception('cannot detect .pgpass and or $PGPASSFILE')
+
# =======================================================================
# netadata API
# =======================================================================
diff --git a/server/pycommon/gmTools.py b/server/pycommon/gmTools.py
index d1c20dc..9e5fb8b 100644
--- a/server/pycommon/gmTools.py
+++ b/server/pycommon/gmTools.py
@@ -630,7 +630,7 @@ def fname_from_path(filename):
return os.path.split(filename)[1]
#---------------------------------------------------------------------------
-def get_unique_filename(prefix=None, suffix=None, tmp_dir=None):
+def get_unique_filename(prefix=None, suffix=None, tmp_dir=None, include_timestamp=False):
"""This introduces a race condition between the file.close() and
actually using the filename.
@@ -645,6 +645,11 @@ def get_unique_filename(prefix=None, suffix=None, tmp_dir=None):
_log.warning('cannot find temporary dir [%s], using system default', tmp_dir)
tmp_dir = None
+ if include_timestamp:
+ ts = pydt.datetime.now().strftime('%m%d-%H%M%S-')
+ else:
+ ts = u''
+
kwargs = {
'dir': tmp_dir,
# make sure file gets deleted as soon as
@@ -653,9 +658,9 @@ def get_unique_filename(prefix=None, suffix=None, tmp_dir=None):
}
if prefix is None:
- kwargs['prefix'] = 'gmd-'
+ kwargs['prefix'] = 'gmd-%s' % ts
else:
- kwargs['prefix'] = prefix
+ kwargs['prefix'] = prefix + ts
if suffix in [None, u'']:
kwargs['suffix'] = '.tmp'
diff --git a/server/sql/v20-v21/dynamic/v21-release_notes-dynamic.sql b/server/sql/v20-v21/dynamic/v21-release_notes-dynamic.sql
index 63f4933..820e480 100644
--- a/server/sql/v20-v21/dynamic/v21-release_notes-dynamic.sql
+++ b/server/sql/v20-v21/dynamic/v21-release_notes-dynamic.sql
@@ -17,27 +17,24 @@ INSERT INTO dem.message_inbox (
) VALUES (
(select pk from dem.staff where db_user = 'any-doc'),
(select pk_type from dem.v_inbox_item_type where type = 'memo' and category = 'administrative'),
- 'Release Notes for GNUmed 1.6.3 (database v21.3)',
- 'GNUmed 1.6.3 Release Notes:
+ 'Release Notes for GNUmed 1.6.5 (database v21.5)',
+ 'GNUmed 1.6.5 Release Notes:
- 1.6.3
+ 1.6.5
-FIX: exception on creating invoice from bill [thanks Marc]
-FIX: faulty assumption on what %()s keys must exist in translations
-FIX: exception in expando SOAP editor when lines need wrapping [thanks Marc]
-FIX: exception on saving progress note under new episode [thanks Marc]
-FIX: exception on deleting list items [thanks Marc]
-FIX: exception on building list context menu [thanks Marc]
-FIX: exception in measurements widget on client idling w/o patient [thanks Marc]
+IMPROVED: list context menu: operate on _selected_ rows
-IMPROVED: add httplib2 to check-prerequisites.py [thanks Marc]
-IMPROVED: single-line formatting of addresses
-IMPROVED: enhance list context menu to selected rows
+ 1.6.4
- 21.3
+FIX: EMR journal exporter on Windows [thanks Marc]
-FIX: GRANTs on demographics views [thanks Marc]
+IMPROVED: by-org sort mode in document tree
+IMPROVED: file describer script
+IMPROVED: STIKO tetanus auto hint
+IMPROVED: ES translation [thanks Uwe]
+
+NEW: gm-import_incoming script for external use
');
-- --------------------------------------------------------------
-select gm.log_script_insertion('v21-release_notes-dynamic.sql', '21.3');
+select gm.log_script_insertion('v21-release_notes-dynamic.sql', '21.5');
diff --git a/server/sql/v20-v21/fixups/v21-ref-auto_hint-tetanus_STIKO.sql b/server/sql/v20-v21/fixups/v21-ref-auto_hint-tetanus_STIKO.sql
new file mode 100644
index 0000000..50fd538
--- /dev/null
+++ b/server/sql/v20-v21/fixups/v21-ref-auto_hint-tetanus_STIKO.sql
@@ -0,0 +1,48 @@
+-- ==============================================================
+-- GNUmed database schema change script
+--
+-- License: GPL v2 or later
+-- Author: karsten.hilbert at gmx.net
+--
+-- ==============================================================
+\set ON_ERROR_STOP 1
+--set default_transaction_read_only to off;
+
+-- --------------------------------------------------------------
+DELETE FROM ref.auto_hint WHERE title = 'Tetanus-Impfg > 10 Jahre (STIKO)';
+
+insert into ref.auto_hint(title, hint, source, lang, query, recommendation_query) values (
+ 'Tetanus-Impfg > 10 Jahre (STIKO)',
+ 'Letzte Tetanusimpfung vor mehr als 10 Jahren dokumentiert.',
+ 'STIKO 2016',
+ 'de',
+ 'SELECT NOT EXISTS (
+ SELECT pk_vaccination
+ FROM clin.v_pat_vaccs4indication
+ WHERE
+ pk_patient = ID_ACTIVE_PATIENT
+ AND
+ indication = ''tetanus''
+ AND
+ date_given > now() - ''10 years''::interval
+ ORDER BY
+ date_given DESC
+ LIMIT 1
+);',
+ 'SELECT coalesce (
+ (SELECT
+ ''Letzte Tetanusimpfung: '' || to_char(date_given, ''YYYY Mon DD'')
+ FROM clin.v_pat_vaccs4indication
+ WHERE
+ pk_patient = ID_ACTIVE_PATIENT
+ AND
+ indication = ''tetanus''
+ ORDER BY
+ date_given DESC
+ LIMIT 1),
+ ''keine Tetanusimpfung dokumentiert''
+) as recommendation;'
+);
+
+-- --------------------------------------------------------------
+SELECT gm.log_script_insertion('v21-ref-auto_hint-tetanus_STIKO.sql', '21.4');
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-med/gnumed-server.git
More information about the debian-med-commit
mailing list