Skip to content
Commits on Source (9)
gnumed-server (22.0-1) unstable; urgency=medium
If you are using postgresql-common version < 122 you need to
install the file
/usr/share/doc/gnumed-server/gm-pg_upgradecluster-helper
into the directory
/etc/postgresql-common/pg_upgradecluster.d/
This script modifies the GNUmed databases such that an upgrade
using pg_upgradecluster of earlier versions of postgresql-common
will succeed.
-- Andreas Tille <tille@debian.org> Mon, 26 Mar 2018 14:48:43 +0200
gnumed-server (19.0-1) unstable; urgency=low
Before upgrading your existing GNUmed database v18 to the v19 schema it
......
gnumed-server (22.0-1) UNRELEASED; urgency=medium
* New upstream feature release
* Depends: flock
* Standards-Version: 4.1.3
* debhelper 11
* debian/cron.daily: gm-backup_database is deprecated and replaced by
gm-backup
* debian/NEWS.Debian: Mention need of gm-pg_upgradecluster-helper
-- Andreas Tille <tille@debian.org> Mon, 26 Mar 2018 14:48:43 +0200
gnumed-server (21.15-1) unstable; urgency=medium
* New upstream version
......
......@@ -4,10 +4,10 @@ Uploaders: Andreas Tille <tille@debian.org>,
Sebastian Hilbert <sebastian.hilbert@gmx.net>
Section: misc
Priority: optional
Build-Depends: debhelper (>= 10),
Build-Depends: debhelper (>= 11~),
python
Build-Depends-Indep: po-debconf
Standards-Version: 4.1.1
Standards-Version: 4.1.3
Vcs-Browser: https://anonscm.debian.org/cgit/debian-med/gnumed-server.git
Vcs-Git: https://anonscm.debian.org/debian-med/gnumed-server.git
Homepage: http://www.gnumed.de
......@@ -23,6 +23,7 @@ Depends: ${misc:Depends},
openssl,
bzip2,
cron | anacron,
flock,
sudo,
gnupg | gnupg2,
rsync,
......
......@@ -6,7 +6,7 @@
# DATA=/usr/sbin/gm-backup_data
# Backup of data and table structure
DATABASE=/usr/sbin/gm-backup_database
DATABASE=/usr/sbin/gm-backup
# Compress and sign backup
ZIPSIGN=/usr/sbin/gm-zip+sign_backups
......
Author: Andreas Tille <tille@debian.org>
LastChanged: Fri, 08 Nov 2013 15:25:40 +0100
Description: We want to make really sure that the user has
set organisation + unit in his old database (v18) before we
are upgrading to v19. The patch can be droped again for
later (major) versions.
--- a/server/gm-bootstrap_server
+++ b/server/gm-bootstrap_server
@@ -1,4 +1,28 @@
-#!/bin/sh
+#!/bin/bash
+
+# if any GNUmed database is available ...
+if psql -l | grep -qi gnumed ; then
+ # ... ask user whether he has injected organisation + unit
+ cat <<EOT
+========================================================================
+
+Before upgrading your existing GNUmed database v18 to the v19 schema it
+is very advisable to make sure you have created (by using the 1.3
+client) -- an organization and a unit thereof to serve as your praxis
+and praxis location. During the very first start of the 1.4 client you
+will be asked which organization/unit represents your praxis/location.
+
+Did you have definte organization and unit thereof?
+
+EOT
+ read -e -p "[y / N]: "
+ if test "${REPLY}" = "y" ; then
+ echo "OK. Start upgrading server."
+ else
+ echo "Upgrading aborted by user."
+ exit 1
+ fi
+fi
#==============================================================
# This wrapper is intended to be installed into a systemwide
make_sure_user_has_set_organisation_in_v18.patch
This diff is collapsed.
......@@ -5,9 +5,9 @@ cd /d %~dp0
REM command line options:
REM quiet
SET VER=21
SET PREV_VER=20
SET LASTVERSIONSTODROP=19
SET VER=22
SET PREV_VER=21
SET LASTVERSIONSTODROP=20
SET QUIET=%1
SET PYTHONPATH="%PYTHONPATH%;../../"
......
......@@ -38,6 +38,7 @@ update_db-v17_v18.conf
update_db-v18_v19.conf
update_db-v19_v20.conf
update_db-v20_v21.conf
update_db-v21_v22.conf
$config files$
interactive = no
......@@ -4,9 +4,9 @@
# - command line options:
# - "quiet"
VERSIONS_TO_DROP="2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19"
PREV_VER="20"
VER="21"
VERSIONS_TO_DROP="2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20"
PREV_VER="21"
VER="22"
QUIET="$1"
......
......@@ -652,6 +652,10 @@ class database:
_log.error(u'cannot REINDEX cloned target database')
return False
if not self.revalidate_constraints():
_log.error(u'cannot VALIDATE CONSTRAINTs in cloned target database')
return False
tmp = cfg_get(self.section, 'superuser schema')
if tmp is not None:
if not _import_schema(group=self.section, schema_opt='superuser schema', conn=self.conn):
......@@ -732,12 +736,14 @@ class database:
curs.close()
self.conn.commit()
# we need inheritance or else things will fail miserably
# we need inheritance or else things will fail miserably but:
# default now ON and PG10.0 hardwired to ON
# so remove database specific setting
curs = self.conn.cursor()
try:
curs.execute("alter database %s set sql_inheritance to DEFAULT" % self.name)
except:
_log.exception(u'PG 10 hardwired for sql_inheritance')
_log.exception('PostgreSQL 10 onwards: <sql_inheritance> hardwired')
curs.close()
self.conn.commit()
......@@ -798,6 +804,7 @@ class database:
_log.info(u"Database [%s] does not exist." % self.name)
return None
#--------------------------------------------------------------
def __create_db(self):
......@@ -821,14 +828,11 @@ class database:
print_msg("==> dropping pre-existing target database [%s] ..." % self.name)
_log.info(u'trying to drop target database')
cmd = 'DROP DATABASE "%s"' % self.name
_log.debug(u'committing existing connection before setting autocommit')
# DROP DATABASE must be run outside transactions
self.conn.commit()
_log.debug(u'setting autocommit to TRUE')
self.conn.autocommit = True
self.conn.readonly = False
self.conn.set_session(readonly = False, autocommit = True)
cursor = self.conn.cursor()
try:
cursor.execute(u'SET default_transaction_read_only TO OFF')
_log.debug(u'running SQL: %s', cmd)
cursor.execute(cmd)
except:
......@@ -875,13 +879,11 @@ class database:
# create database by cloning
print_msg("==> cloning [%s] (%s) as target database [%s] ..." % (self.template_db, size, self.name))
# create DB must be run outside transactions
# CREATE DATABASE must be run outside transactions
self.conn.commit()
self.conn.autocommit = True
self.conn.readonly = False
self.conn.set_session(readonly = False, autocommit = True)
cursor = self.conn.cursor()
try:
cursor.execute(u'SET default_transaction_read_only TO OFF')
cursor.execute(create_db_cmd)
except:
_log.exception(u">>>[%s]<<< failed" % create_db_cmd)
......@@ -1155,10 +1157,10 @@ class database:
_log.info(u'this may potentially take "quite a long time" depending on how much data there is in the database')
_log.info(u'you may want to monitor the PostgreSQL log for signs of progress')
# REINDEX must be run outside transactions
self.conn.commit()
self.conn.set_session(readonly = False, autocommit = True)
curs_outer = self.conn.cursor()
curs_outer.execute(u'SET default_transaction_read_only TO OFF')
cmd = 'REINDEX (VERBOSE) DATABASE %s' % self.name
try:
curs_outer.execute(cmd)
......@@ -1182,6 +1184,52 @@ class database:
return True
#--------------------------------------------------------------
def revalidate_constraints(self):
print_msg("==> revalidating constraints in target database (can take a while) ...")
do_revalidate = cfg_get(self.section, 'revalidate')
if do_revalidate is None:
do_revalidate = True # default: do it
else:
do_revalidate = (int(do_revalidate) == 1)
if not do_revalidate:
_log.warning('skipping VALIDATE CONSTRAINT')
print_msg(" ... skipped")
return True
_log.info(u'reVALIDATing CONSTRAINTs in cloned target database so upgrade does not fail due to broken data')
_log.info(u'this may potentially take "quite a long time" depending on how much data there is in the database')
_log.info(u'you may want to monitor the PostgreSQL log for signs of progress')
curs = self.conn.cursor()
cmd = u"""do $$
DECLARE
r record;
BEGIN
FOR r IN (
select con.connamespace, nsp.nspname, con.conname, con.conrelid, rel.relname
from pg_constraint con
join pg_namespace nsp on nsp.oid = con.connamespace
join pg_class rel on rel.oid = con.conrelid
where contype in ('c','f')
) LOOP
RAISE NOTICE 'validating [%] on [%.%]', r.conname, r.nspname, r.relname;
EXECUTE 'UPDATE pg_constraint SET convalidated=false WHERE conname=$1 AND connamespace=$2 AND conrelid=$3' USING r.conname, r.connamespace, r.conrelid;
EXECUTE 'ALTER TABLE ' || r.nspname || '.' || r.relname || ' VALIDATE CONSTRAINT "' || r.conname || '"';
END LOOP;
END
$$;"""
try:
curs.execute(cmd)
except:
_log.exception(u">>>[VALIDATE CONSTRAINT]<<< failed")
return False
finally:
curs.close()
return True
#--------------------------------------------------------------
def transfer_users(self):
print_msg("==> transferring users ...")
......@@ -1806,8 +1854,6 @@ finally:
_log.warning(u'%s', conn)
_log.warning(u'closing connection')
conn.close()
del conn
del conn_ref_count
_log.info(u'after main, before sys.exit(0)')
......
# GNUmed database system bootstrapping config file
#-------------------------------------------------
# license: GPL v2 or later
# author: Karsten Hilbert@gmx.net
#----------------------------------
[installation]
interactive = yes
keep temp files = no
description = $description$
This will update an existing GNUmed database.
It does so by applying all fixup SQL scripts
appropriate to the version of the database.
$description$
bundles = $bundles$
v22-fixups
$bundles$
#----------------------------------
[bundle v22-fixups]
database alias = gnumed_v22
minimum postgresql version = 9.2
schema base directory = ../sql/v21-v22/fixups/
schema = $schema$
../dynamic/v22-release_notes-dynamic.sql
$schema$
#----------------------------------
[database gnumed_v22]
name = gnumed_v22
override name by = GM_CORE_DB
drop target database = 0
use existing target database = 1
target version = v22
transfer users = 0
template database = template1
server alias = local host
audit disable = 1
audit trail parent table = audit.audit_trail
audit trail table prefix = log_
audit fields table = audit.audit_fields
schema base directory = ../sql/v21-v22/
schema = $schema$
$schema$
superuser schema = $superuser schema$
$superuser schema$
upgrade plausibility checks = $upgrade plausibility checks$
$upgrade plausibility checks$
script base directory = ../sql/v21-v22/python/
data import scripts = $data import scripts$
$data import scripts$
#----------------------------------
[server local host]
name =
port = 5432
template database = template1
super user alias = postgres
schema base directory = ../sql/v21-v22/
schema = $schema$
$schema$
#----------------------------------
[user GNUmed owner]
name = gm-dbo
password =
[user postgres]
name = postgres
#password =
#----------------------------------
# these really shouldn't be changed
#----------------------------------
[GnuMed defaults]
database owner alias = GNUmed owner
groups = $groups$
$groups$
#----------------------------------
# GNUmed database system bootstrapping config file
#-------------------------------------------------
# license: GPL v2 or later
# author: Karsten Hilbert@gmx.net
#----------------------------------
[revision control]
file = /home/ncq/Projekte/cvs2git/vcs-mirror/gnumed/gnumed/server/bootstrap/update_db-v21_v22.conf
version = 1.0
#----------------------------------
[installation]
interactive = yes
keep temp files = no
description = $description$
This will update an existing GNUmed version 21
database to the version 22 schema. It does not do
any harm to the data contained within.
The existing database will be cloned first. The copy is
then modified. The original database remains unchanged.
$description$
bundles = $bundles$
v21_fixups-pre_v22
v21-v22-static
v21-v22-dynamic
$bundles$
#----------------------------------
[bundle v21_fixups-pre_v22]
database alias = gnumed_v22
minimum postgresql version = 9.2
schema base directory = ../sql/v20-v21/fixups/
schema = $schema$
v21-db-sql_inheritance-fixup.sql
v21-previously-missing-array_agg-fixup.sql
v21-dem-view_grants-fixup.sql
../dynamic/v21-release_notes-dynamic.sql
v21-ref-auto_hint-tetanus_STIKO.sql
v21-ref-auto_hint-klug_entscheiden_pulmo.sql
v21-ref-auto_hint-klug_entscheiden_endokrino.sql
v21-CD_DVD-sleeve.sql
v21-AMTS_Medikationsplan-fixup.sql
v21-ref-auto_hint-smoking_status-fixup.sql
v21-ref-GKV_CU-fixup.sql
v21-clin-get_hints_for_patient-fixup.sql
v21-notifications-dynamic.sql
v21-clin-uppercase_soap_cat-fixup.sql
v21-dem-identity-fixup.sql
v21-Constans-TVT-OE.sql
$schema$
#----------------------------------
[bundle v21-v22-static]
database alias = gnumed_v22
minimum postgresql version = 9.2
schema base directory = ../sql/v21-v22/static/
schema = $schema$
v22-ref-substance-static.sql
v22-ref-lnk_loinc2substance-static.sql
v22-ref-dose-static.sql
v22-ref-drug_product-static.sql
v22-ref-lnk_dose2drug-static.sql
v22-ref-auto_hint-static.sql
v22-clin-vaccine-static.sql
v22-clin-lnk_loinc2test_panel-static.sql
v22-clin-procedure-static.sql
v22-clin-external_care-static.sql
v22-blobs-doc_med-static.sql
$schema$
#----------------------------------
[bundle v21-v22-dynamic]
database alias = gnumed_v22
minimum postgresql version = 9.2
schema base directory = ../sql/v21-v22/dynamic/
schema = $schema$
v22-i18n-v_missing_translations.sql
v22-notifications-dynamic.sql
v22-blobs-doc_med-dynamic.sql
v22-blobs-v_doc_med.sql
v22-blobs-v_doc_desc.sql
v22-blobs-v_obj4doc_no_data.sql
v22-blobs-v_reviewed_doc_objects.sql
v22-blobs-v_latest_mugshot.sql
v22-ref-auto_hint-dynamic.sql
# conversion of drug products
v22-ref-substance-dynamic.sql
v22-ref-lnk_loinc2substance-dynamic.sql
v22-ref-dose-dynamic.sql
v22-ref-lnk_dose2drug-dynamic.sql
v22-ref-v_drug_products.sql
# convert vaccines
v22-clin-move_vacc_objects_to_ref.sql
v22-ref-remove_unused_vaccines.sql
v22-ref-create_generic_vaccines.sql
v22-ref-convert_vaccines.sql
v22-ref-remove_unused_vaccines.sql
v22-ref-create_generic_vaccines.sql
v22-ref-vacc_indication-drop.sql
v22-ref-v_vaccines.sql
v22-ref-v_indications4vaccine.sql
# done with vaccines, now vaccinations
v22-clin-v_vaccinations.sql
v22-clin-v_pat_vaccs4indication.sql
v22-clin-v_pat_last_vacc4indication.sql
v22-clin-v_vaccinations_journal.sql
# done with vaccinations
# test panel conversion
v22-clin-lnk_loinc2test_panel-dynamic.sql
v22-clin-convert_test_panels.sql
v22-clin-v_test_panels.sql
v22-clin-v_test_types4test_panel.sql
v22-clin-v_test_types.sql
v22-clin-v_test_results.sql
v22-clin-v_test_results_journal.sql
# with test panel conversion
v22-dem-unique_named_identity.sql
v22-dem-v_person_names.sql
v22-dem-v_message_inbox.sql
v22-dem-v_pat_addresses.sql
v22-clin-lowercase_soap_cat.sql
v22-clin-remove_old_empty_encounters.sql
v22-clin-v_hospital_stays.sql
v22-clin-procedure-dynamic.sql
v22-clin-export_item-dynamic.sql
v22-clin-v_export_items.sql
v22-clin-v_external_care.sql
v22-clin-substance_intake-dynamic-run_once.sql
v22-clin-substance_intake-dynamic.sql
v22-clin-substance_intake-insert_triggers.sql
v22-clin-substance_intake-update_triggers.sql
v22-clin-substance_intake-delete_triggers.sql
v22-clin-transfer_all_encounter_data.sql
v22-clin-vaccine_batches-dynamic.sql
v22-clin-v_suppressed_hints.sql
v22-clin-v_suppressed_hints_journal.sql
v22-blobs-v_doc_med_journal.sql
v22-clin-v_procedures_journal.sql
v22-clin-v_substance_intake_journal.sql
v22-clin-v_external_care_journal.sql
v22-clin-v_emr_journal.sql
v22-clin-get_hints_for_patient.sql
v22-clin-v_candidate_diagnoses.sql
v22-ref-auto_hints.sql
v22-i18n-German.sql
v22-kwd-patient_media_export_icon.sql
v22-release_notes-dynamic.sql
$schema$
#----------------------------------
[bundle v22-fixups]
database alias = gnumed_v22
minimum postgresql version = 9.2
schema base directory = ../sql/v21-v22/fixups/
schema = $schema$
$schema$
#----------------------------------
[bundle v22-test_data]
database alias = gnumed_v22
minimum postgresql version = 9.2
schema base directory = ../sql/test-data/
schema = $schema$
$schema$
#----------------------------------
[database gnumed_v22]
name = gnumed_v22
override name by = GM_CORE_DB
drop target database = 1
target version = v22
reindex = 1
revalidate = 1
transfer users = 1
template database = gnumed_v21
template version = v21
server alias = local host
audit disable = 0
audit trail parent table = audit.audit_trail
audit trail table prefix = log_
audit fields table = audit.audit_fields
schema base directory = ../sql/v21-v22/
schema = $schema$
$schema$
superuser schema = $superuser schema$
$superuser schema$
script base directory = ../sql/v21-v22/python/
data import scripts = $data import scripts$
v22-import-form-templates.py
$data import scripts$
# line 1: old database
# line 2: new database
upgrade plausibility checks = $upgrade plausibility checks$
identities::::select count(1) from dem.identity
select count(1) from dem.identity -- new
names::::select count(1) from dem.names
select count(1) from dem.names -- new
v_all_persons::::select count(1) from dem.v_persons
select count(1) from dem.v_all_persons -- new
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
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
select count(1) from dem.v_uniq_zipped_urbs -- new
patient addresses view::::select count(1) from dem.v_pat_addresses -- old
select count(1) from dem.v_pat_addresses -- new
episodes::::select count(1) from clin.episode where not summary ilike '%[substance use]%'
select count(1) from clin.episode where not summary ilike '%[substance use]%'
denormalized episodes::::select count(1) from clin.v_pat_episodes where not summary ilike '%[substance use]%'
select count(1) from clin.v_pat_episodes where not summary ilike '%[substance use]%'
encounters::::select count(1) from clin.encounter
select count(1) from clin.v_pat_encounters
issues::::select count(1) from clin.health_issue
select count(1) from clin.health_issue
issues view::::select count(1) from clin.v_health_issues
select count(1) from clin.v_health_issues
procedures::::select count(1) from clin.procedure
select count(1) from clin.procedure
documents::::select count(1) from blobs.doc_med
select count(1) from blobs.doc_med
document pages::::select count(1) from blobs.doc_obj
select count(1) from blobs.doc_obj
allergies::::select count(1) from clin.allergy
select count(1) from clin.allergy
communication channels::::select count(1) from dem.lnk_identity2comm
select count(1) from dem.lnk_identity2comm
test results::::select count(1) from clin.test_result
select count(1) from clin.test_result
unmatched test results::::select count(1) from clin.incoming_data_unmatched
select count(1) from clin.incoming_data_unmatched
unmatchable test results::::select count(1) from clin.incoming_data_unmatchable
select count(1) from clin.incoming_data_unmatchable
denormalized test results::::select count(1) from clin.v_test_results
select count(1) from clin.v_test_results
allergy states::::select count(1) from clin.allergy_state
select count(1) from clin.allergy_state
waiting list entries::::select count(1) from clin.waiting_list
select count(1) from clin.waiting_list
waiting list view entries::::select count(1) from clin.v_waiting_list
select count(1) from clin.v_waiting_list
waiting list integrity::::select((select count(1) from clin.v_waiting_list) = (select count(1) from clin.waiting_list))
select((select count(1) from clin.v_waiting_list) = (select count(1) from clin.waiting_list))
messages::::select count(1) + 2 from dem.message_inbox
select count(1) from dem.message_inbox
test orgs::::select count(1) from clin.test_org
select count(1) from clin.test_org
--substance transfer - name::::select count(1) from (select distinct on (description) description from ref.consumable_substance WHERE atc_code NOT LIKE 'J07%') as d
-- select count(1) from ref.substance WHERE atc NOT LIKE 'J07%'
--substance transfer - dose::::select count(1) from ref.consumable_substance WHERE atc_code NOT LIKE 'J07%'
-- select count(1) from ref.v_substance_doses where atc_substance NOT LIKE 'J07%'
--dose view consistency::::select count(1) from ref.consumable_substance
-- select count(1) from ref.v_substance_doses
substance view -- correctness::::select True
select (select count(1) from ref.substance) = (select count(1) from ref.v_substances)
dose view -- correctness::::select True
select (select count(1) from ref.dose) = (select count(1) from ref.v_substance_doses)
substance intakes (tables)::::select count(1) from clin.substance_intake
select count(1) from clin.substance_intake
substance intakes (views)::::select count(1) from clin.v_substance_intakes
select count(1) from clin.v_substance_intakes
substance intakes (table vs view)::::select count(1) from clin.substance_intake
select count(1) from clin.v_substance_intakes
--brands consistency::::select (select count(1) from ref.branded_drug) + (select count(1) from (select distinct on (substance, amount, unit) substance from clin.v_nonbrand_intakes) as d)
-- select count(1) from ref.drug_product
--vaccines::::select count(1) from clin.vaccine where pk in (select fk_vaccine from clin.vaccination)
-- select count(1) from ref.vaccine
vaccines view (existence)::::select TRUE from clin.v_vaccines
select TRUE from ref.v_vaccines
--vaccines (indication count)::::select count(1) from clin.v_indications4vaccine where pk_vaccine in (select fk_vaccine from clin.vaccination)
-- select count(1) from ref.v_indications4vaccine
vaccinations (total count)::::select count(1) from clin.vaccination
select count(1) from clin.vaccination
--vaccinations-by-indication (total count)::::select count(1) from clin.v_pat_vaccs4indication
-- select count(1) from clin.v_pat_vaccs4indication
vaccinations-by-indication (patient count)::::select count(1) from (select distinct on (pk_patient) pk_patient from clin.v_pat_vaccs4indication) as distinct_pats
select count(1) from (select distinct on (pk_patient) pk_patient from clin.v_pat_vaccs4indication) as distinct_pats
vaccinations-by-indication (shots count)::::select count(1) from (select distinct on (pk_vaccination) pk_vaccination from clin.v_pat_vaccs4indication) as distinct_shots
select count(1) from (select distinct on (pk_vaccination) pk_vaccination from clin.v_pat_vaccs4indication) as distinct_shots
--vaccinations-by-indication (indications count)::::select count(1) from clin.v_pat_vaccs4indication group by pk_indication
-- select count(1) from clin.v_pat_vaccs4indication group by atc_indication
--vaccinations-by-indication (vaccine count)::::select count(1) from (select distinct on (pk_vaccine) pk_vaccine clin.v_pat_vaccs4indication) as distinct_vaccines
-- select count(1) from (select distinct on (pk_vaccine) pk_vaccine clin.v_pat_vaccs4indication) as distinct_vaccines
vaccinations-by-indication (consistency)::::select count(1) from clin.vaccination
select count(1) from (select distinct on (pk_vaccination) pk_vaccination from clin.v_pat_vaccs4indication) as distinct_shots
latest vaccinations (total count)::::select count(1) from clin.v_pat_last_vacc4indication where indication NOT ILIKE '%influenza%'
select count(1) from clin.v_pat_last_vacc4indication where indication NOT ILIKE '%influenza%'
latest vaccinations (patient count)::::select count(1) from clin.v_pat_last_vacc4indication where indication NOT ILIKE '%influenza%' group by pk_patient
select count(1) from clin.v_pat_last_vacc4indication where indication NOT ILIKE '%influenza%' group by pk_patient
latest vaccinations (shots count)::::select count(1) from clin.v_pat_last_vacc4indication group by pk_vaccination
select count(1) from clin.v_pat_last_vacc4indication group by pk_vaccination
latest vaccinations (indications count)::::select count(1) from clin.v_pat_last_vacc4indication group by pk_indication
select count(1) from clin.v_pat_last_vacc4indication group by atc_indication
latest vaccinations (vaccine count)::::select count(1) from clin.v_pat_last_vacc4indication group by pk_vaccine
select count(1) from clin.v_pat_last_vacc4indication group by pk_vaccine
requests on results::::select count(1) from clin.test_result where fk_request is not NULL
select count(1) from clin.test_result where fk_request is not NULL
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) 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
--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
select count(1) - 2 from ref.keyword_expansion
mapped keyword expansions::::select count(1) from ref.v_keyword_expansions
select count(1) - 2 from ref.v_keyword_expansions
organisations::::select count(1) from dem.org
select count(1) from dem.org
organisational units::::select count(1) from dem.org_unit
select count(1) from dem.org_unit
data sources::::select count(1) from ref.data_source
select count(1) from ref.data_source
bills with invoices but without VAT status::::select 0
select count(1) from bill.bill where (apply_vat is null) and (fk_doc is not null)
clinical items::::select count(1) from clin.clin_root_item
select count(1) from clin.clin_root_item
export items::::select count(1) from clin.export_item
select count(1) from clin.export_item
export items view::::select count(1) from clin.v_export_items
select count(1) from clin.v_export_items
export items integrity::::select ((select count(1) from clin.export_item) = (select count(1) from clin.v_export_items))
select ((select count(1) from clin.export_item) = (select count(1) from clin.v_export_items))
external care::::select count(1) from clin.external_care
select count(1) from clin.external_care
external care view integrity::::select TRUE
select ((select count(1) from clin.external_care) = (select count(1) from clin.v_external_care))
-- ------------------
-- commented out:
--ATC codes::::select count(1) from (select distinct on (code, term, fk_data_source) 1 from ref.atc) as uniq_atc
-- select count(1) from ref.atc
--ATC vs generic codes - internal consistency::::select 0
-- select code, term, fk_data_source from ref.atc except select code, term, fk_data_source from ref.generic_coding_system
--LOINC codes::::select count(1) from ref.loinc
-- select count(1) from ref.loinc
--LOINC vs generic codes - internal consistency::::select 0
-- select code, term, fk_data_source from ref.loinc except select code, term, fk_data_source from ref.generic_coding_system
--generic codes (total) - internal consistency::::select True
-- select ((select count(1) from ref.coding_system_root) = (select ((select count(1) from ref.atc) + (select count(1) from ref.loinc))))
-- ------------------
-- for debugging:
--skipped check::::select 'skipped in old' -- old
-- select 'skipped in new' -- new
--check definition error::select 1 -- old
-- select 1 -- new
--syntax error (old)::::selec 1 -- old
-- select 1 -- new
--syntax error (new)::::select 1 -- old
-- selec 1 -- new
--data mismatch error::::select 1 -- old
-- select 2 -- new
$upgrade plausibility checks$
#----------------------------------
[server local host]
name =
port = 5432
template database = template1
super user alias = postgres
schema base directory = ../sql/v21-v22/
schema = $schema$
$schema$
#----------------------------------
[user GNUmed owner]
name = gm-dbo
password =
[user postgres]
name = postgres
#password =
#----------------------------------
# these really shouldn't be changed
#----------------------------------
[GnuMed defaults]
database owner alias = GNUmed owner
groups = $groups$
$groups$
#----------------------------------
......@@ -21,10 +21,10 @@ loss. The Debian GNU/Linux packaged version of the GNUmed
server installs such a cron job by default.
.SH SEE ALSO
gm-backup_database(8)
gm-restore(8)
/etc/gnumed/gnumed-backup.conf
.SH AUTHOR
This manual page was written by Andreas Tille <tille@debian.org>,
This manual page was written by Andreas Tille <tille@debian.org>
for the Debian GNU/Linux system (but may be used by others).
.TH GM-BACKUP_DATA 8 "2009 January 8th" "GNUmed server data backup"
.SH NOTE
.I Deprecated in favour of gm-backup(8).
.SH NAME
.B gm-backup_data
- backup of GNUmed data
......@@ -19,8 +23,12 @@ If you really know what you are doing and want to
care for database schema and roles yourself this
script might suffice to backup the raw data.
It is recommended to use
.B gm-backup
instead.
.SH SEE ALSO
.B gm-backup_database(8)
.B gm-backup(8)
.B /etc/gnumed/gnumed-backup.conf
......
.TH GM-BACKUP_DATABASE 8 "2009 January 8th" "GNUmed server database backup"
.SH NOTE
.I Deprecated in favour of gm-backup(8).
.SH NAME
.B gm-backup_database
- complete backup of GNUmed database
......@@ -19,10 +23,14 @@ job to ensure that GNUmed patient data are safe against data
loss. The Debian GNU/Linux packaged version of the GNUmed
server installs such a cron job by default.
It is recommended to use
.B gm-backup
instead.
.SH SEE ALSO
gm-backup_data(8)
.B gm-backup_data(8)
/etc/gnumed/gnumed-backup.conf
.B /etc/gnumed/gnumed-backup.conf
.SH AUTHOR
This manual page was written by Andreas Tille <tille@debian.org>,
......
......@@ -14,7 +14,7 @@
a GNUmed database (such as "gnumed_VERSION")
.I <gm-dbo password>
the password for the databse owner <gm-dbo>
the password for the database owner <gm-dbo>
.I [--with-dump]
if this option is given a dump of the database schema structure
......
.TH GM-RESTORE_DATABASE_FROM_ARCHIVE 8 "2016 March 13th" "GNUmed server database restore"
.TH GM-RESTORE 8 "2016 March 13th" "GNUmed server database restore"
.SH NAME
.B gm-restore_database_from_archive
.B gm-restore
- restoring a GNUmed database
.SH SYNOPSIS
.B gm-restore_database_from_archive
.B gm-restore
.I <backup>
.I <backup>:
......@@ -13,11 +13,12 @@ a database backup file ("backup-gnumed_vX-*.tar.bz2") created by gm-backup
.SH DESCRIPTION
The
.B gm-restore_database_from_archive
.B gm-restore
script attempts to recreate from scratch the backed up GNUmed
database. It tries to be very conservative. It is intended
for interactive use by root and may have to be adjusted to
your needs.
database. It tries to be very conservative.
It is intended for interactive use by root and may have to be
adjusted to your needs.
.SH KNOWN PROBLEMS
......
.TH GM-RESTORE_DATA 8 "2011 May 10th" "GNUmed server data-only restore"
.SH NOTE
.I Deprecated in favour of gm-restore(8).
.SH NAME
.B gm-restore_data
- restoring data into an empty GNUmed database
......@@ -30,7 +34,9 @@ the backup file you intend to restore is a link to the
actual backup. Use the full path instead.
.SH SEE ALSO
gm-backup_database(8)
gm-restore(8)
gm-backup(8)
/etc/gnumed/gnumed-restore.conf
......