# 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 version 8
database to the version 9 schema. It does not do
any harm to the data contained within.

The existing database is cloned first. The copy is
then modified. The original database remains unchanged.
$description$

bundles = $bundles$
v8-v9-static
v8-v9-dynamic
$bundles$

#----------------------------------
[bundle v8-v9-static]
database alias = gnumed_v9
minimum postgresql version = 8.1
schema base directory = ../sql/v8-v9/static/
schema = $schema$
v9-dem-lnk_identity2comm.sql
v9-clin-test_result-static.sql
v9-clin-lab_request-static.sql
v9-clin-incoming_data_unmatch-static.sql
v9-clin-incoming_data_unmatch-static2.sql
v9-clin-coded_phrase.sql
v9-clin-episode-static.sql
v9-clin-health_issue-static.sql
v9-clin-keyword_expansion-static.sql
v9-ref-static.sql
v9-ref-coding_system_root-static.sql
v9-ref-loinc-static.sql
$schema$

#----------------------------------
[bundle v8-v9-dynamic]
database alias = gnumed_v9
minimum postgresql version = 8.1
schema base directory = ../sql/v8-v9/dynamic/
schema = $schema$
v9-i18n-dynamic.sql
v9-cfg-report_query.sql
v9-cfg-cfg_str_array.sql
v9-cfg-db_logon_banner.sql
v9-ref-data_source-dynamic.sql
v9-ref-coding_system_root-dynamic.sql
v9-ref-loinc-dynamic.sql
v9-ref-atc-dynamic.sql
v9-ref-v_coded_terms.sql
v9-dem-v_person_comms.sql
v9-clin-allergy-dynamic.sql
v9-clin-coded_item_narrative.sql
v9-clin-coded_phrase.sql
v9-clin-test_result-dynamic.sql
v9-clin-lab_request-dynamic.sql
v9-clin-episode-dynamic.sql
v9-clin-health_issue-dynamic.sql
v9-clin-incoming_data_unmatch-dynamic.sql
v9-clin-v_codes4diag.sql
v9-clin-v_test_results.sql
v9-clin-encounters-dynamic.sql
v9-blobs-delete_document.sql
v9-blobs-doc_type-dynamic.sql
v9-dem-v_provider_inbox.sql
v9-clin-v_emr_journal.sql
v9-clin-keyword_expansion-dynamic.sql
v9-clin-keyword_expansion-data.sql
v9-i18n-translations.sql
$schema$

#----------------------------------
[database gnumed_v9]
name = gnumed_v9
drop target database = 1
target version = v9
transfer users = 1
source database = gnumed_v8
source version = v8
audit disable = 0
schema base directory = ../sql/v8-v9/
schema = $schema$
$schema$

superuser schema = $superuser schema$
$superuser schema$

upgrade plausibility checks = $upgrade plausibility checks$
identities::::select count(1) from dem.identity
select count(1) from dem.identity
names::::select count(1) from dem.names
select count(1) from dem.names
addresses::::select count(1) from dem.address
select count(1) from dem.address
episodes::::select count(1) from clin.episode
select count(1) from clin.episode
encounters::::select count(1) from clin.encounter
select count(1) from clin.v_pat_encounters where type != 'administrative encounter'
issues::::select count(1) from clin.health_issue
select count(1) from clin.health_issue
documents::::select count(1) from blobs.doc_med
select count(1) from blobs.doc_med
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
clinical items::::select count(1) from clin.clin_root_item
select count(1) from clin.clin_root_item
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
$upgrade plausibility checks$

script base directory = ../sql/v8-v9/python/
data import scripts = $data import scripts$
$data import scripts$

#----------------------------------
[cluster]
host name = 
port = 5432
maintenance database = template1
schema base directory = ../sql/v8-v9/
schema = $schema$
$schema$

#----------------------------------
# these really shouldn't be changed
#----------------------------------
[GnuMed defaults]

groups = $groups$
$groups$

#----------------------------------
