File: update_db-v19_v20.conf

package info (click to toggle)
gnumed-server 21.11-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 45,408 kB
  • ctags: 3,891
  • sloc: sql: 1,210,640; python: 13,526; sh: 1,476; makefile: 19
file content (287 lines) | stat: -rw-r--r-- 10,975 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
# 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-v19_v20.conf
version = 1.0

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

keep temp files = no

description = $description$
This will update an existing GNUmed version 19
database to the version 20 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$
v19_fixups-pre_v20
v19-v20-static
v19-v20-dynamic
v20-fixups
$bundles$


#----------------------------------
[bundle v19_fixups-pre_v20]
database alias = gnumed_v20
minimum postgresql version = 9.1
schema base directory = ../sql/v18-v19/fixups/
schema = $schema$
v19-bill-v_bills-fixup.sql
v19-bill-bill_item-fixup.sql
v19-dem-lnk_org_unit2ext_id-fixup.sql
v19-dem-org-fixup.sql
v19-dem-org-idx-fixup.sql
v19-dem-v_orgs_v_org_units-fixup.sql
v19-dem-v_praxis_branches-fixup.sql
v19-clin-encounter-fixup.sql
v19-clin-test_org-fixup.sql
v19-clin-test_type-fixup.sql
v19-find_potentially_misappropriated_soap-fixup.sql
$schema$

#----------------------------------
[bundle v19-v20-static]
database alias = gnumed_v20
minimum postgresql version = 9.1
schema base directory = ../sql/v19-v20/static/
schema = $schema$
v20-gm-notifying_tables-static.sql
v20-clin-patient-static.sql
v20-clin-export_item-static.sql
v20-clin-external_care-static.sql
v20-clin-test_type-static.sql
v20-clin-test_result-static.sql
v20-clin-suppressed_hint-static.sql
$schema$

#----------------------------------
[bundle v19-v20-dynamic]
database alias = gnumed_v20
minimum postgresql version = 9.1
schema base directory = ../sql/v19-v20/dynamic/
schema = $schema$
v20-gm-register_notifying_table.sql
v20-notifications-dynamic.sql
v20-clin-sanity_checks.sql
v20-role_management.sql
v20-cfg-cfg_str_array-dynamic.sql
v20-dem-identity-dynamic.sql
v20-dem-v_basic_person.sql
v20-dem-v_pat_addresses.sql
v20-dem-v_staff.sql
v20-dem-v_external_ids4org_unit.sql
v20-bill-bill-dynamic.sql
v20-blobs-doc_obj-dynamic.sql
v20-clin-patient-dynamic.sql
v20-clin-encounter-dynamic.sql
v20-clin-lnk_pat2vaccination_course-dynamic.sql
v20-clin-incoming_data_unmatched-dynamic.sql
v20-clin-v_incoming_data_unmatched.sql
v20-clin-test_type-dynamic.sql
v20-clin-test_result-dynamic.sql
v20-clin-v_test_types.sql
v20-clin-v_test_results.sql
v20-clin-v_test_results_journal.sql
v20-clin-export_item-dynamic.sql
v20-clin-v_export_items.sql
v20-clin-external_care-dynamic.sql
v20-clin-remove_old_empty_encounters.sql
v20-ref-v_auto_hints.sql
v20-clin-suppressed_hint-dynamic.sql
v20-clin-v_emr_journal.sql
v20-clin-v_narrative4search.sql
v20-dem-v_message_inbox.sql
v20-ref-loinc_staging-dynamic.sql
v20-ref-paperwork_templates.sql
v20-GKV_Stempel.sql
v20-Wells_Score.sql
v20-NSAR_Auswahl.sql
v20-LQTS_Score.sql
v20-cfg-report_query.sql
v20-release_notes-dynamic.sql
$schema$

#----------------------------------
[bundle v20-fixups]
database alias = gnumed_v20
minimum postgresql version = 9.1
schema base directory = ../sql/v19-v20/fixups/
schema = $schema$
v20-clin-substance_intake-fixup.sql
v20-dem-org-idx-fixup.sql
v20-clin-procedure-fixup.sql
$schema$

#----------------------------------
[bundle v20-test_data]
database alias = gnumed_v20
minimum postgresql version = 9.1
schema base directory = ../sql/test-data/
schema = $schema$
$schema$

#----------------------------------
[database gnumed_v20]
name = gnumed_v20
override name by = GM_CORE_DB
drop target database = 1
target version = v20
transfer users = 1
template database = gnumed_v19
template version = v19
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/v19-v20/
schema = $schema$
$schema$

superuser schema = $superuser schema$
superuser/v20-install-pg_trgm.sql
$superuser schema$

script base directory = ../sql/v19-v20/python/
data import scripts = $data import scripts$
v20-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
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
denormalized episodes::::select count(1) from clin.v_pat_episodes
	select count(1) from clin.v_pat_episodes
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
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
messages::::select count(1) + 1 from dem.message_inbox
	select count(1) from dem.message_inbox
test orgs::::select count(1) from clin.test_org
	select (select count(1) from clin.test_org) - (select count(1) from clin.test_org where comment = 'auto-generated by v20-clin-test_type-dynamic.sql')
branded drug component intakes::::select count(1) from clin.substance_intake where fk_drug_component is not null
	select count(1) from clin.substance_intake where fk_drug_component is not null
substance intakes::::select count(1) from clin.substance_intake where fk_drug_component is null
	select count(1) from clin.substance_intake where fk_drug_component is null
vaccines::::select count(1) from clin.vaccine
	select count(1) from clin.vaccine
vaccines (must have indications)::::select 0
	select count(1) from clin.v_vaccines where indications is NULL
vaccinations::::select count(1) from clin.vaccination
	select count(1) from clin.vaccination
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) + 1 from ref.paperwork_templates
	select count(1) from ref.paperwork_templates
automatic hints::::select count(1) from ref.auto_hint
	select count(1) from ref.auto_hint
suppressed hints::::select 0; -- select count(1) from clin.suppressed_hint
	select count(1) from clin.suppressed_hint
raw keyword expansions::::select count(1) + 3 from ref.keyword_expansion
	select count(1) from ref.keyword_expansion
mapped keyword expansions::::select count(1) + 3 from ref.v_keyword_expansions
	select count(1) from ref.v_keyword_expansions
organisations::::select (select count(1) from dem.org) - (select count(1) from dem.org where description = 'unknown laboratory')
	select (select count(1) from dem.org) - (select count(1) from dem.org where description = 'unknown laboratory') - (select count(1) from dem.org where description = _('generic praxis'))
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)
$upgrade plausibility checks$



#organisational units::::select (select count(1) from dem.org_unit) - (select count(1) from dem.org_unit where description = 'branch of unknown laboratory' and fk_org = (select pk from dem.org where description = 'unknown laboratory')) - (select count(1) from dem.org_unit where description = 'generic praxis branch')
#	select (select count(1) from dem.org_unit) - (select count(1) from dem.org_unit where description = 'branch of unknown laboratory' and fk_org = (select pk from dem.org where description = 'unknown laboratory')) - (select count(1) from dem.org_unit where description = 'generic praxis branch')
#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))))


#----------------------------------
[server local host]
name = 
port = 5432
template database = template1
super user alias = postgres
schema base directory = ../sql/v19-v20/
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$

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