# GNUmed database system bootstrapping config file
#-------------------------------------------------
# license: GPL v2 or later
# author: Karsten Hilbert@gmx.net

#----------------------------------
[revision control]
file = $Source: /home/ncq/Projekte/cvs2git/vcs-mirror/gnumed/gnumed/server/bootstrap/update_db-v10_v11.conf,v $
version = $Revision: 1.25 $

#----------------------------------
[installation]
interactive = yes

keep temp files = no

description = $description$
This will update an existing GNUmed version 10
database to the version 11 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$
v10_fixups-pre_v11
v10-v11-static
v10-v11-dynamic
v11-fixups
v11-test_data
$bundles$

#----------------------------------
[bundle v10_fixups-pre_v11]
database alias = gnumed_v11
minimum postgresql version = 8.1
schema base directory = ../sql/v9-v10/fixups/
schema = $schema$
v10-blobs-delete_document-fixup.sql
v10-dem-identity-dob_trigger-fixup.sql
v10-clin-allergy-fixup.sql
v10-clin-v_pat_allergy_state_journal-fixup.sql
v10-clin-v_emr_journal-fixup.sql
v10-clin-trf_invalidate_review_on_result_change-fixup.sql
$schema$

#----------------------------------
[bundle v10-v11-static]
database alias = gnumed_v11
minimum postgresql version = 8.1
schema base directory = ../sql/v10-v11/static/
schema = $schema$
v11-gm-schema_revision-static.sql
v11-ref-data_source-static.sql
v11-ref-loinc-static.sql
v11-ref-atc-static.sql
v11-bill-schema.sql
v11-bill-bill_item.sql
v11-clin-test_type_unified-static.sql
v11-clin-test_type-static.sql
v11-clin-hospital_stay-static.sql
v11-clin-current_medication-static.sql
v11-clin-health_issue-static.sql
v11-blobs-lnk_hospital_stay-static.sql
$schema$

#----------------------------------
[bundle v10-v11-dynamic]
database alias = gnumed_v11
minimum postgresql version = 8.1
schema base directory = ../sql/v10-v11/dynamic/
schema = $schema$
v11-drop_obsolete_groups-dynamic.sql
v11-gm-is_null_or_non_empty_string.sql
v11-i18n-tx_or_null.sql
v11-i18n-force_curr_lang.sql
v11-i18n-upd_tx-dynamic.sql
v11-ref-data_source-dynamic.sql
v11-ref-loinc-dynamic.sql
v11-ref-atc-dynamic.sql
v11-ref-v_coded_terms.sql
v11-bill-bill_item-dynamic.sql
v11-blobs-delete_document.sql
v11-cfg-cfg_str_array.sql
v11-cfg-report_query-dynamic.sql
v11-dem-v_basic_person.sql
v11-dem-v_staff.sql
v11-dem-v_pat_addresses.sql
v11-dem-v_person_jobs.sql
v11-clin-allergy-dynamic.sql
v11-clin-v_pat_allergy_state_journal.sql
v11-clin-hospital_stay-dynamic.sql
v11-clin-v_pat_hospital_stays.sql
v11-clin-v_pat_hospital_stays_journal.sql
v11-clin-current_medication-dynamic.sql
v11-clin-keyword_expansion-data.sql
v11-clin-health_issue-dynamic.sql
v11-clin-v_health_issues.sql
v11-clin-v_health_issues_journal.sql
v11-clin-v_pat_episodes_journal.sql
v11-blobs-lnk_hospital_stay-dynamic.sql
v11-clin-test_type-dynamic.sql
v11-clin-v_meta_test_types-dynamic.sql
v11-clin-v_unified_test_types-dynamic.sql
v11-clin-v_test_results.sql
v11-clin-v_test_results_journal.sql
v11-clin-v_hx_family.sql
v11-clin-v_hx_family_journal.sql
v11-dem-v_provider_inbox.sql
v11-clin-v_emr_journal.sql
v11-dem-street-dynamic.sql
v11-dem-urb-dynamic.sql
$schema$

#----------------------------------
[bundle v11-fixups]
database alias = gnumed_v11
minimum postgresql version = 8.1
schema base directory = ../sql/v10-v11/fixups/
schema = $schema$
v11-cfg-report_query-fixup.sql
v11-clin-v_narrative4search-fixup.sql
$schema$

#----------------------------------
[bundle v11-test_data]
database alias = gnumed_v11
minimum postgresql version = 8.1
schema base directory = ../sql/test-data/
schema = $schema$
test_data-Kirk_hospital_stay-dynamic.sql
test_data-Kirk_medication-dynamic.sql
test_data-Kirk_multi_results-dynamic.sql
$schema$

#----------------------------------
[database gnumed_v11]
name = gnumed_v11
override name by = GM_CORE_DB
drop target database = 1
target version = v11
transfer users = 1
template database = gnumed_v10
template version = v10
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/v10-v11/
schema = $schema$
$schema$

superuser schema = $superuser schema$
superuser/v11-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) + 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
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) + 4) 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) + 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) + 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
$upgrade plausibility checks$

script base directory = ../sql/v10-v11/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/v10-v11/
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$

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