# 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 11
database to the version 12 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$

#v12-test_data

bundles = $bundles$
v11_fixups-pre_v12
v11-v12-static
v11-v12-dynamic
$bundles$

#----------------------------------
[bundle v11_fixups-pre_v12]
database alias = gnumed_v12
minimum postgresql version = 8.1
schema base directory = ../sql/v11-v12/fixups/
schema = $schema$
$schema$

#----------------------------------
[bundle v11-v12-static]
database alias = gnumed_v12
minimum postgresql version = 8.1
schema base directory = ../sql/v11-v12/static/
schema = $schema$
v12-gm-log_script_insertion.sql
v12-ref-drug-static.sql
v12-ref-substance_in_drug-static.sql
v12-dem-message_inbox-static.sql
v12-clin-consumed_substance-static.sql
v12-clin-substance_intake-static.sql
v12-clin-health_issue-static.sql
v12-clin-episode-static.sql
v12-clin-procedure-static.sql
$schema$

#----------------------------------
[bundle v11-v12-dynamic]
database alias = gnumed_v12
minimum postgresql version = 8.1
schema base directory = ../sql/v11-v12/dynamic/
schema = $schema$
v12-gm-nullify_empty_string.sql
v12-cfg-cfg_str_array-dynamic.sql
v12-ref-drug-dynamic.sql
v12-ref-substance_in_brand-dynamic.sql
v12-dem-message_inbox-dynamic.sql
v12-clin-health_issue-dynamic.sql
v12-clin-episode-dynamic.sql
v12-clin-procedure-dynamic.sql
v12-clin-consumed_substance-dynamic.sql
v12-clin-substance_intake-dynamic.sql
v12-clin-reviewed_test_results-dynamic.sql
v12-clin-v_health_issues.sql
v12-clin-v_health_issues_journal.sql
v12-clin-v_pat_episodes.sql
v12-clin-v_pat_episodes_journal.sql
v12-clin-v_pat_items.sql
v12-clin-v_emr_journal.sql
v12-clin-v_narrative4search.sql
v12-clin-v_potential_problem_list.sql
v12-clin-v_problem_list.sql
v12-ref-paperwork_templates.sql
$schema$

#----------------------------------
[bundle v12-test_data]
database alias = gnumed_v12
minimum postgresql version = 8.1
schema base directory = ../sql/test-data/
schema = $schema$
test_data-Kirk-diagnostic_certainty-dynamic.sql
test_data-Kirk-procedure-dynamic.sql
$schema$

#----------------------------------
[database gnumed_v12]
name = gnumed_v12
drop target database = 1
target version = v12		#devel
transfer users = 1
source database = gnumed_v11
source version = v11
audit disable = 0
schema base directory = ../sql/v11-v12/
schema = $schema$
$schema$

superuser schema = $superuser schema$
superuser/v12-public-gm_sth_user.sql
$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
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
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
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
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
generic codes::::select count(1) from ref.coding_system_root
  select count(1) from ref.coding_system_root
data sources::::select count(1) from ref.data_source
  select count(1) from ref.data_source
messages::::select count(1) from dem.provider_inbox
  select count(1) from dem.message_inbox
operations::::select count(1) from clin.operation
  select count(1) from clin.operation
$upgrade plausibility checks$

script base directory = ../sql/v11-v12/python/
data import scripts = $data import scripts$
import-form-templates.py
$data import scripts$

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

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

groups = $groups$
$groups$

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