File: v16-ref-paperwork_templates.sql

package info (click to toggle)
gnumed-server 16.17-1
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 42,064 kB
  • sloc: sql: 1,190,603; python: 11,850; sh: 1,082; makefile: 19
file content (71 lines) | stat: -rw-r--r-- 2,001 bytes parent folder | download | duplicates (7)
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
-- ==============================================================
-- GNUmed database schema change script
--
-- License: GPL v2 or later
-- Author: karsten.hilbert@gmx.net
-- 
-- ==============================================================
\set ON_ERROR_STOP 1

-- --------------------------------------------------------------
\unset ON_ERROR_STOP
alter table ref.paperwork_templates drop constraint engine_range cascade;
\set ON_ERROR_STOP 1


alter table ref.paperwork_templates
	add constraint engine_range
		check (engine in ('T', 'L', 'H', 'O', 'I', 'G', 'P'));


comment on column ref.paperwork_templates.engine is
'the business layer forms engine used to process this form, currently:
	- T: plain text
	- L: LaTeX
	- H: Health Layer 7
	- O: OpenOffice
	- I: image editor (visual progress notes)
	- G: gnuplot scripts (test results graphing)
	- P: PDF form (FDF based)'
;

-- --------------------------------------------------------------
\unset ON_ERROR_STOP
insert into ref.form_types (name) values (i18n.i18n('pdf form'));
\set ON_ERROR_STOP 1

select i18n.upd_tx('de_DE', 'pdf form', 'PDF-Formular');

-- --------------------------------------------------------------
\unset ON_ERROR_STOP
insert into ref.form_types (name) values (i18n.i18n('form header'));
\set ON_ERROR_STOP 1

select i18n.upd_tx('de', 'form header', 'Formularkopf');

delete from ref.paperwork_templates where name_long = 'Formularkopf (GNUmed-Vorgabe)';

insert into ref.paperwork_templates (
	fk_template_type,
	instance_type,
	name_short,
	name_long,
	external_version,
	engine,
	filename,
	data
) values (
	(select pk from ref.form_types where name = 'form header'),
	'other form',
	'Formularkopf (GMd)',
	'Formularkopf (GNUmed-Vorgabe)',
	'v16.0',
	'L',
	'form-header.tex',
	'real template missing'::bytea
);

select i18n.upd_tx('de', 'other form', 'sonstiges Formular');

-- --------------------------------------------------------------
select gm.log_script_insertion('v16-ref-paperwork_templates.sql', 'v16');