Skip to content
Commits on Source (4)
gnumed-server (22.2-1) unstable; urgency=medium
* New upstream version
-- Andreas Tille <tille@debian.org> Mon, 28 May 2018 21:24:34 +0200
gnumed-server (22.1-1) unstable; urgency=medium
* New upstream version
......
This diff is collapsed.
......@@ -57,6 +57,7 @@ $upgrade plausibility checks$
script base directory = ../sql/v21-v22/python/
data import scripts = $data import scripts$
v22-2-fixup-form-templates.py
$data import scripts$
#----------------------------------
......
"""Automatic GNUmed audit trail generation.
This module creates SQL DDL commands for the audit
trail triggers and functions to be created in the schema "audit".
Theory of operation:
Any table that needs to be audited (all modifications
logged) must be recorded in the table "audit.audited_tables".
This script creates the triggers, functions and tables
neccessary to establish the audit trail. Some or all
audit trail tables may have been created previously but
need not contain all columns of the audited table. Do not
put any constraints on the audit trail tables except for
"not null" on those columns that cannot be null in the
audited table.
"""
#==================================================================
__author__ = "Horst Herb, Karsten.Hilbert@gmx.net"
__license__ = "GPL v2 or later" # (details at http://www.gnu.org)
import sys, os.path, string, logging, io
from Gnumed.pycommon import gmPG2
_log = logging.getLogger('gm.bootstrapper')
LOG_TABLE_PREFIX = u'log_' # the audit trail tables start with this prefix
AUDIT_TRAIL_PARENT_TABLE = u'audit_trail' # and inherit from this table
AUDIT_FIELDS_TABLE = u'audit_fields' # audited tables inherit these fields
AUDIT_SCHEMA = u'audit' # audit stuff lives in this schema
#==================================================================
# SQL statements for auditing setup script
#------------------------------------------------------------------
# audit triggers are named "zt_*_*" to make
# reasonably sure they are executed last
# insert
SQL_TEMPLATE_INSERT = u"""DROP FUNCTION IF EXISTS audit.ft_ins_%(src_tbl)s() cascade;
CREATE FUNCTION audit.ft_ins_%(src_tbl)s()
RETURNS trigger
LANGUAGE 'plpgsql'
SECURITY DEFINER
AS '
DECLARE
_is_allowed_inserter boolean;
BEGIN
-- is the session user allowed to insert data ?
SELECT gm.account_is_dbowner_or_staff(SESSION_USER) INTO STRICT _is_allowed_inserter;
IF _is_allowed_inserter IS FALSE THEN
RAISE EXCEPTION
''INSERT: gm.account_is_dbowner_or_staff(NAME): <%%> is neither database owner, nor <postgres>, nor on staff'', SESSION_USER
USING ERRCODE = ''integrity_constraint_violation''
;
return NEW;
END IF;
NEW.row_version := 0;
NEW.modified_when := CURRENT_TIMESTAMP;
NEW.modified_by := SESSION_USER;
return NEW;
END;';
CREATE TRIGGER zt_ins_%(src_tbl)s
BEFORE INSERT ON %(src_schema)s.%(src_tbl)s
FOR EACH ROW EXECUTE PROCEDURE audit.ft_ins_%(src_tbl)s();
"""
SQL_TEMPLATE_INSERT_NO_INSERTER_CHECK = u"""DROP FUNCTION IF EXISTS audit.ft_ins_%(src_tbl)s() cascade;
CREATE FUNCTION audit.ft_ins_%(src_tbl)s()
RETURNS trigger
LANGUAGE 'plpgsql'
SECURITY DEFINER
AS '
BEGIN
NEW.row_version := 0;
NEW.modified_when := CURRENT_TIMESTAMP;
NEW.modified_by := SESSION_USER;
return NEW;
END;';
CREATE TRIGGER zt_ins_%(src_tbl)s
BEFORE INSERT ON %(src_schema)s.%(src_tbl)s
FOR EACH ROW EXECUTE PROCEDURE audit.ft_ins_%(src_tbl)s();
"""
# update
SQL_TEMPLATE_UPDATE = u"""DROP FUNCTION IF EXISTS audit.ft_upd_%(src_tbl)s() cascade;
CREATE FUNCTION audit.ft_upd_%(src_tbl)s()
RETURNS trigger
LANGUAGE 'plpgsql'
SECURITY DEFINER
AS '
DECLARE
_is_allowed_updater boolean;
BEGIN
-- is the session user allowed to update data ?
SELECT gm.account_is_dbowner_or_staff(SESSION_USER) INTO STRICT _is_allowed_updater;
IF _is_allowed_updater IS FALSE THEN
RAISE EXCEPTION
''UPDATE: gm.account_is_dbowner_or_staff(NAME): <%%> is neither database owner, nor <postgres>, nor on staff'', SESSION_USER
USING ERRCODE = ''integrity_constraint_violation''
;
return NEW;
END IF;
NEW.row_version := OLD.row_version + 1;
NEW.modified_when := CURRENT_TIMESTAMP;
NEW.modified_by := SESSION_USER;
INSERT INTO audit.%(log_tbl)s (
orig_version, orig_when, orig_by, orig_tableoid, audit_action,
%(cols_clause)s
) VALUES (
OLD.row_version, OLD.modified_when, OLD.modified_by, TG_RELID, TG_OP,
%(vals_clause)s
);
return NEW;
END;';
CREATE TRIGGER zt_upd_%(src_tbl)s
BEFORE UPDATE ON %(src_schema)s.%(src_tbl)s
FOR EACH ROW EXECUTE PROCEDURE audit.ft_upd_%(src_tbl)s();
"""
SQL_TEMPLATE_UPDATE_NO_UPDATER_CHECK = u"""DROP FUNCTION IF EXISTS audit.ft_upd_%(src_tbl)s() cascade;
CREATE FUNCTION audit.ft_upd_%(src_tbl)s()
RETURNS trigger
LANGUAGE 'plpgsql'
SECURITY DEFINER
AS '
BEGIN
NEW.row_version := OLD.row_version + 1;
NEW.modified_when := CURRENT_TIMESTAMP;
NEW.modified_by := SESSION_USER;
INSERT INTO audit.%(log_tbl)s (
orig_version, orig_when, orig_by, orig_tableoid, audit_action,
%(cols_clause)s
) VALUES (
OLD.row_version, OLD.modified_when, OLD.modified_by, TG_RELID, TG_OP,
%(vals_clause)s
);
return NEW;
END;';
CREATE TRIGGER zt_upd_%(src_tbl)s
BEFORE UPDATE ON %(src_schema)s.%(src_tbl)s
FOR EACH ROW EXECUTE PROCEDURE audit.ft_upd_%(src_tbl)s();
"""
# delete
SQL_TEMPLATE_DELETE = u"""DROP FUNCTION IF EXISTS audit.ft_del_%(src_tbl)s() cascade;
CREATE FUNCTION audit.ft_del_%(src_tbl)s()
RETURNS trigger
LANGUAGE 'plpgsql'
SECURITY DEFINER
AS '
DECLARE
_is_allowed_deleter boolean;
BEGIN
-- is the session user allowed to delete data ?
SELECT gm.account_is_dbowner_or_staff(SESSION_USER) INTO STRICT _is_allowed_deleter;
IF _is_allowed_deleter IS FALSE THEN
RAISE EXCEPTION
''DELETE: gm.account_is_dbowner_or_staff(NAME): <%%> is neither database owner, nor <postgres>, nor on staff'', SESSION_USER
USING ERRCODE = ''integrity_constraint_violation''
;
return OLD;
END IF;
INSERT INTO audit.%(log_tbl)s (
orig_version, orig_when, orig_by, orig_tableoid, audit_action,
%(cols_clause)s
) VALUES (
OLD.row_version, OLD.modified_when, OLD.modified_by, TG_RELID, TG_OP,
%(vals_clause)s
);
return OLD;
END;';
CREATE TRIGGER zt_del_%(src_tbl)s
BEFORE DELETE ON %(src_schema)s.%(src_tbl)s
FOR EACH ROW EXECUTE PROCEDURE audit.ft_del_%(src_tbl)s();
"""
SQL_TEMPLATE_DELETE_NO_DELETER_CHECK = u"""DROP FUNCTION IF EXISTS audit.ft_del_%(src_tbl)s() cascade;
CREATE FUNCTION audit.ft_del_%(src_tbl)s()
RETURNS trigger
LANGUAGE 'plpgsql'
SECURITY DEFINER
AS '
BEGIN
INSERT INTO audit.%(log_tbl)s (
orig_version, orig_when, orig_by, orig_tableoid, audit_action,
%(cols_clause)s
) VALUES (
OLD.row_version, OLD.modified_when, OLD.modified_by, TG_RELID, TG_OP,
%(vals_clause)s
);
return OLD;
END;';
CREATE TRIGGER zt_del_%(src_tbl)s
BEFORE DELETE ON %(src_schema)s.%(src_tbl)s
FOR EACH ROW EXECUTE PROCEDURE audit.ft_del_%(src_tbl)s();
"""
# we cannot do this because NOT VALID only applies to the time when
# we add the constraint, the FK would still be enforced during later
# INSERTs/UPDATEs
#SQL_TEMPLATE_FK_MODIFIED_BY = u"""ALTER TABLE %(src_schema)s.%(src_tbl)s
# DROP CONSTRAINT IF EXISTS fk_%(src_schema)s_%(src_tbl)s_fk_modified_by CASCADE;
#
#-- this is set NOT VALID because it only serves to tell pg_dump
#-- to dump dem.staff before other tables such that we do not run
#-- into trouble with checking gm.is_dbowner_or_staff(SESSION_USER)
#ALTER TABLE %(src_schema)s.%(src_tbl)s
# ADD CONSTRAINT fk_%(src_schema)s_%(src_tbl)s_fk_modified_by
# FOREIGN KEY (modified_by)
# REFERENCES dem.staff(db_user)
# ON UPDATE RESTRICT
# ON DELETE RESTRICT
# NOT VALID;"""
#
#SQL_TEMPLATE_DEM_STAFF_FK = u"""
#ALTER TABLE dem.staff
# DROP CONSTRAINT IF EXISTS fk_dem_staff_fk_modified_by CASCADE;
#"""
SQL_TEMPLATE_CREATE_AUDIT_TRAIL_TABLE = u"""
create table %(log_schema)s.%(log_tbl)s (
%(log_cols)s
) inherits (%(log_schema)s.%(log_base_tbl)s);
COMMENT ON COLUMN %(log_schema)s.%(log_tbl)s.orig_version is
'the .row_version in the original row before the audited action took place, should be equal to .row_version';
COMMENT ON COLUMN %(log_schema)s.%(log_tbl)s.orig_when is
'the .modified_when in the original row before the audited action took place, should be equal to .modified_when';
COMMENT ON COLUMN %(log_schema)s.%(log_tbl)s.orig_by is
'the .modified_by in the original row before the audited action took place, should be equal to .modified_by';
COMMENT ON COLUMN %(log_schema)s.%(log_tbl)s.orig_tableoid is
'the TG_RELID when the audit trigger was run';
"""
#grant insert on %s.%s to group "gm-public"
#------------------------------------------------------------------
#------------------------------------------------------------------
def audit_trail_table_ddl(aCursor=None, schema=None, table2audit=None):
audit_trail_table = '%s%s' % (LOG_TABLE_PREFIX, table2audit)
# which columns to potentially audit
cols2potentially_audit = gmPG2.get_col_defs(link_obj = aCursor, schema = schema, table = table2audit)
# which to skip
cols2skip = gmPG2.get_col_names(link_obj = aCursor, schema = AUDIT_SCHEMA, table = AUDIT_FIELDS_TABLE)
# which ones to really audit
cols2really_audit = []
for col in cols2potentially_audit[0]:
if col in cols2skip:
continue
cols2really_audit.append("\t%s %s" % (col, cols2potentially_audit[1][col]))
# does the audit trail target table exist ?
exists = gmPG2.table_exists(aCursor, AUDIT_SCHEMA, audit_trail_table)
if exists is None:
_log.error('cannot check existence of table [audit.%s]' % audit_trail_table)
return None
if exists:
_log.info('audit trail table [audit.%s] already exists' % audit_trail_table)
# sanity check table structure
currently_audited_cols = gmPG2.get_col_defs(link_obj = aCursor, schema = AUDIT_SCHEMA, table = audit_trail_table)
currently_audited_cols = [ '\t%s %s' % (c, currently_audited_cols[1][c]) for c in currently_audited_cols[0] ]
for col in cols2really_audit:
try:
currently_audited_cols.index(col)
except ValueError:
_log.error('table structure incompatible: column ".%s" not found in audit table' % col.strip())
_log.error('%s.%s:' % (schema, table2audit))
_log.error('%s' % ','.join(cols2really_audit))
_log.error('%s.%s:' % (AUDIT_SCHEMA, audit_trail_table))
_log.error('%s' % ','.join(currently_audited_cols))
return None
return []
# must create audit trail table
_log.info('no audit trail table found for [%s.%s]' % (schema, table2audit))
_log.info('creating audit trail table [audit.%s]' % audit_trail_table)
args = {
'log_schema': AUDIT_SCHEMA,
'log_base_tbl': AUDIT_TRAIL_PARENT_TABLE,
'log_tbl': audit_trail_table,
'log_cols': u',\n '.join(cols2really_audit)
}
return [SQL_TEMPLATE_CREATE_AUDIT_TRAIL_TABLE % args, '']
#------------------------------------------------------------------
def trigger_ddl(aCursor='default', schema=AUDIT_SCHEMA, audited_table=None):
target_columns = gmPG2.get_col_names(link_obj = aCursor, schema = schema, table = audited_table)
columns2skip = gmPG2.get_col_names(link_obj = aCursor, schema = AUDIT_SCHEMA, table = AUDIT_FIELDS_TABLE)
columns = []
values = []
for column in target_columns:
if column not in columns2skip:
columns.append(column)
values.append(u'OLD.%s' % column)
args = {
'src_tbl': audited_table,
'src_schema': schema,
'log_tbl': u'%s%s' % (LOG_TABLE_PREFIX, audited_table),
'cols_clause': u', '.join(columns),
'vals_clause': u', '.join(values)
}
modified_by_func_exists = gmPG2.function_exists(link_obj = aCursor, schema = u'gm', function = u'account_is_dbowner_or_staff')
ddl = []
if modified_by_func_exists:
ddl.append(SQL_TEMPLATE_INSERT % args)
ddl.append(u'')
ddl.append(SQL_TEMPLATE_UPDATE % args)
ddl.append(u'')
ddl.append(SQL_TEMPLATE_DELETE % args)
#ddl.append(u'')
#ddl.append(SQL_TEMPLATE_FK_MODIFIED_BY % args)
else:
# the *_NO_*_CHECK variants are needed for pre-v21 databases
# where gm.account_is_dbowner_or_staff() doesn't exist yet
ddl.append(SQL_TEMPLATE_INSERT_NO_INSERTER_CHECK % args)
ddl.append(u'')
ddl.append(SQL_TEMPLATE_UPDATE_NO_UPDATER_CHECK % args)
ddl.append(u'')
ddl.append(SQL_TEMPLATE_DELETE_NO_DELETER_CHECK % args)
ddl.append(u'')
return ddl
#------------------------------------------------------------------
def create_audit_ddl(aCursor):
# get list of all marked tables
# we could also get the child tables for audit.audit_fields
# but we would have to potentially parse down several levels
# of interitance (such as with clin.clin_root_item) to find
# the actual leaf table to audit
cmd = u"select schema, table_name from audit.audited_tables"
rows, idx = gmPG2.run_ro_queries(link_obj = aCursor, queries = [{'cmd': cmd}])
if len(rows) == 0:
_log.info('no tables to audit')
return None
_log.debug('the following tables will be audited:')
_log.debug(rows)
ddl = []
ddl.append('\set check_function_bodies 1\n')
ddl.append('set check_function_bodies to on;\n\n')
# for each marked table
for row in rows:
if not gmPG2.table_exists(link_obj = aCursor, schema = row['schema'], table = row['table_name']):
_log.error('table to audit (%s) does not exist', row)
return None
# create log table if necessary
audit_trail_ddl = audit_trail_table_ddl(aCursor = aCursor, schema = row['schema'], table2audit = row['table_name'])
if audit_trail_ddl is None:
_log.error('cannot generate audit trail DDL for audited table [%s]' % row['table_name'])
return None
ddl.extend(audit_trail_ddl)
if len(audit_trail_ddl) != 0:
ddl.append('-- ----------------------------------------------')
# create functions and triggers on log table
ddl.extend(trigger_ddl(aCursor = aCursor, schema = row['schema'], audited_table = row['table_name']))
ddl.append('-- ----------------------------------------------')
#ddl.append(SQL_TEMPLATE_DEM_STAFF_FK)
return ddl
#==================================================================
# main
#------------------------------------------------------------------
if __name__ == "__main__" :
tmp = ''
try:
tmp = raw_input("audit trail parent table [%s]: " % AUDIT_TRAIL_PARENT_TABLE)
except KeyboardError:
pass
if tmp != '':
AUDIT_TRAIL_PARENT_TABLE = tmp
conn = gmPG2.get_connection(readonly=False, pooled=False)
curs = conn.cursor()
schema = create_audit_ddl(curs)
curs.close()
conn.close()
if schema is None:
print "error creating schema"
sys.exit(-1)
f = io.open('audit-trail-schema.sql', mode = 'wb', encoding = 'utf8')
for line in schema:
f.write("%s;\n" % line)
f.close()
......@@ -195,6 +195,7 @@ $superuser schema$
script base directory = ../sql/v21-v22/python/
data import scripts = $data import scripts$
v22-import-form-templates.py
v22-2-fixup-form-templates.py
$data import scripts$
......@@ -212,9 +213,9 @@ v_all_persons::::select count(1) from dem.v_persons
v_active_persons::::select count(1) from dem.v_active_persons
select count(1) from dem.v_active_persons -- new
staff::::select count(1) from dem.staff -- old
select count(1) from dem.v_staff where not person_is_deleted -- new
v_staff::::select count(1) from dem.v_staff
select count(1) from dem.v_staff -- new
v_staff::::select count(1) from dem.v_staff
select count(1) from dem.v_staff
addresses::::select count(1) from dem.address
select count(1) from dem.address -- new
unique URBs with ZIP::::select count(1) from dem.v_uniq_zipped_urbs -- old
......@@ -317,10 +318,12 @@ paperwork templates::::select count(1) from ref.paperwork_templates
select count(1) from ref.paperwork_templates
automatic hints::::select count(1) from ref.auto_hint
select count(1) - 1 from ref.auto_hint
-- do NOT try to check the number of suppressed hints because
-- even though we do know the number of *hints* that will have
-- changed we simply cannot know the number of suppressions that
-- will be lifted by those changes
-- do NOT try to check the number of suppressed hints because even though
--
-- we do know the number of *hints* that will have changed we simply cannot
--
-- know the number of suppressions that will be lifted by those changes
--
--suppressed hints::::select count(1) from clin.suppressed_hint
-- select count(1) from clin.suppressed_hint
raw keyword expansions::::select count(1) from ref.keyword_expansion
......
......@@ -112,7 +112,7 @@
<body>
 
<!-- Primary Index -->
<p><br><br>Dumped on 2018-04-05</p>
<p><br><br>Dumped on 2018-05-10</p>
<h1><a name="index">Index of database - gnumed_v22</a></h1>
<ul>
......@@ -73,7 +73,7 @@
$<praxis::%(praxis)s, %(branch)s::120>$\\
$<praxis_address::%(street)s %(number)s (%(subunit)s), %(postcode)s %(urb)s::60>$
}
\setkomavar{fromlogo}{$<data_snippet::praxis-logo//\includegraphics[width=30mm]{%s}//image/png//.png::250>$}%$
\setkomavar{fromlogo}{$<data_snippet::praxis-logo//\includegraphics[width=30mm]{%s}//image/png//.png::250>$}%$ -- this dollarsign unconfuses mcedit syntax coloring
\setkomavar{backaddress}{$<current_provider_firstnames::::1>$.$<current_provider_lastnames::::>$\\$<praxis_address::%(street)s %(number)s\\%(postcode)s %(urb)s::60>$}
......@@ -86,15 +86,15 @@
% Betreff, nämlich Patientendaten
\setkomavar{subject}[]{
$<free_text::Betreff für den Brief::120>$\\
\setkomavar{subject}[]{%
$<<free_text::Betreff für den Brief::120>>$\\
Patient: $<title::::>$ $<firstname::::>$ $<lastname::::>$ (geb $<date_of_birth::%d.%B %Y::>$)\\
Adresse: $<adr_street::home::>$ $<adr_number::home::>$, $<adr_postcode::home::>$ $<adr_location::home::>$
}
% Unterschrift
\setkomavar{signature}{
\setkomavar{signature}{%
\centering
$<data_snippet::autograph-$<<current_provider_lastnames::::>>$_$<<current_provider_firstnames::::>>$//\includegraphics[width=30mm]{%s}\\//image/png//.png::250>$\rule{\widthof{\tiny (Der Unterzeichner haftet nicht für unsignierte Änderungen des Inhalts.)}}{.1pt}\\
$<current_provider_name::%(title)s %(firstnames)s %(lastnames)s::>$\\
......@@ -110,7 +110,7 @@
% Fußzeile 1.Seite
\setkomavar{firstfoot}{%
\rule{\textwidth}{.3pt}
\parbox[t]{\textwidth}{
\parbox[t]{\textwidth}{%
\tiny
\begin{tabular}[t]{ll}%
% \multicolumn{2}{l}{Erreichbarkeit:}\\
......@@ -152,22 +152,29 @@
$<receiver_street::::>$\ $<receiver_number::::>$\ $<receiver_subunit::::>$\\
$<receiver_postcode::::>$\ $<receiver_location::::>$\\
$<receiver_country::::>$
}%
}
% Anrede
\opening{$<free_text::Anrede, z.B. "Sehr geehrte Frau" (wird automatisch ergänzt durch " <Name des Empfängers>,")::140>$ $<receiver_name::::>$,}
\opening{%
$<<free_text::Anrede, z.B. "Sehr geehrte Frau" (wird automatisch ergänzt durch " $<receiver_name::::>$,")::140>>$ $<receiver_name::::>$,
}
% Brieftext
\selectlanguage{ngerman}
$<free_text::Der eigentliche Brieftext (in LaTeX !)::>$
$<<free_text::Der eigentliche Brieftext (in LaTeX)::>>$
\closing{%
$<<free_text::Grußformel, z.B. "Mit freundlichen Grüßen" (ohne Komma am Ende)::140>>$,
}
\closing{$<free_text::Grußformel, z.B. "Mit freundlichen Grüßen" (ohne Komma am Ende)::140>$,}
% Anlagen
%\setkomavar*{enclseparator}[Anlage(n)] % Titel für Anlagebereich
\encl{$<free_text::Liste von Anlagen::300>$}
\encl{$<<free_text::Liste von Anlagen::300>>$}
% kein Verteiler
%\cc{}
......
......@@ -17,8 +17,17 @@ 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.7.1 (database v22.1)',
'GNUmed 1.7.1 Release Notes:
'Release Notes for GNUmed 1.7.2 (database v22.2)',
'GNUmed 1.7.2 Release Notes:
1.7.2
FIX: GTK3 related size adjustments for PatientOverview/SimpleSoap plugins
FIX: GTK3 related bitmap adjustments
FIX: [Save] functionality of Export Area
FIX: placeholders $current_provider_[title/firstnames/lastnames]$
FIX: receiver selection address list setup
FIX: exception on creation of duplicate patient [thanks Marc]
1.7.1
......@@ -28,10 +37,15 @@ IMPROVED: make DWV optional
IMPROVED: prerequisites check tool
IMPROVED: update timeline code to 1.17.0 release
22.2
FIX: staff/v_staff plausibility check [thanks Marc]
FIX: LaTeX-Template for Begleitbrief
22.1
IMPROVED: concurrency robustness of backup/restore scripts
');
-- --------------------------------------------------------------
select gm.log_script_insertion('v22-release_notes-fixup.sql', '22.1');
select gm.log_script_insertion('v22-release_notes-fixup.sql', '22.2');
# coding: utf8
#==============================================================
# GNUmed database schema change script
#
# License: GPL v2 or later
# Author: karsten.hilbert@gmx.net
#
#==============================================================
import os
from Gnumed.pycommon import gmPG2
#--------------------------------------------------------------
def run(conn=None):
# Begleitbrief
gmPG2.file2bytea (
query = u"""
UPDATE ref.paperwork_templates SET
data = %(data)s::bytea,
external_version = '22.2'
WHERE
name_long = 'Begleitbrief ohne medizinische Daten [K.Hilbert]'""",
filename = os.path.join('..', 'sql', 'v21-v22', 'data', 'v22-Begleitbrief.tex'),
conn = conn
)
return True
#==============================================================