Dumped on 2024-12-23

Index of database - gnumed_v21


Table: basic_unit

basic units are SI units, units derived from them and the Unity

basic_unit Structure
F-Key Name Type Description
pk serial PRIMARY KEY
name_short text UNIQUE NOT NULL
name_long text UNIQUE

Tables referencing this one via Foreign Key Constraints:

Index - Schema public


Table: form_field_types

form_field_types Structure
F-Key Name Type Description
name text UNIQUE
pk serial PRIMARY KEY

Tables referencing this one via Foreign Key Constraints:

Index - Schema public


Table: form_fields

List of fields for a particular form

form_fields Structure
F-Key Name Type Description
pk serial PRIMARY KEY
fk_form integer UNIQUE#1 UNIQUE#2 NOT NULL
long_name text UNIQUE#1 NOT NULL

The full name of the form field as presented to the user
template_placeholder text UNIQUE#2 NOT NULL

The name of the field as exposed to the form template. In other words, the placeholder in form_defs.template where the value entered into this field ist to be substituted. Must be a valid identifier in the form template's script language (viz. Python)
help text

longer help text
form_field_types.pk fk_type integer NOT NULL

the field type
param text

a parameter for the field's behaviour, meaning is type-dependent
display_order integer

used to *suggest* display order, but client may ignore

Index - Schema public


Table: form_job_queue

Queue table for rendered form instances. Note that the rows in this table will get deleted after processing. This is NOT an archive of form jobs.

form_job_queue Structure
F-Key Name Type Description
pk serial PRIMARY KEY
fk_form_instance integer NOT NULL

points to the unrendered source instance of the form, useful for recalling submitted jobs for changing
form bytea NOT NULL

the rendered form, IOW binary data such as a PDF file
form_job_targets.pk fk_job_target integer NOT NULL

points to the job target
submitted_when timestamp with time zone NOT NULL DEFAULT now()

when was this form job submitted
fk_submitted_by integer NOT NULL

who of the staff submitted this form job
submitted_from text NOT NULL

the workplace this form job was submitted from
status text NOT NULL DEFAULT 'submitted'::text

status of the form job: - submitted: ready for processing - in progress: being processed - removable: fit for removal (either cancelled, timed out or done) - halted: do not process

Index - Schema public


Table: form_job_targets

the form job targets (eg. printers, faxes, smtp servers) in whatever granularity is needed locally, can be used for load balancing/round robin servicing busy queues

form_job_targets Structure
F-Key Name Type Description
pk serial PRIMARY KEY
target text UNIQUE NOT NULL

Tables referencing this one via Foreign Key Constraints:

Index - Schema public


Table: form_print_defs

form_print_defs Structure
F-Key Name Type Description
pk serial PRIMARY KEY
fk_form integer UNIQUE NOT NULL
fk_papersize integer NOT NULL
offset_top integer NOT NULL

in mm - and yes, they do change even within one type of form, but we do not want to change the offset for all the fields in that case
offset_left integer NOT NULL
pages integer NOT NULL DEFAULT 1
printer text NOT NULL
tray text NOT NULL
manual_feed boolean NOT NULL DEFAULT false
papertype text NOT NULL

type of paper such as "watermarked rose", mainly for user interaction on manual_feed==true
eject_direction character(1) NOT NULL
orientation character(1) NOT NULL

Index - Schema public


Table: gm_client_db_match

allows lookup of whether a given client version can work with a particular database revision

gm_client_db_match Structure
F-Key Name Type Description
pk serial PRIMARY KEY
client_type text UNIQUE#1 NOT NULL

the type of client this row refers to
client_version text UNIQUE#1 NOT NULL

the version of the client this row refers to
db_identity_hash text UNIQUE#1 NOT NULL

the identity_hash of a database revision that the client version can work with

Index - Schema public


Table: housekeeping_todo

this table stores items that originate in headless processes running in the background but need to be brought to the attention of someone, say, errors that an integrity checker may find

housekeeping_todo Structure
F-Key Name Type Description
pk serial PRIMARY KEY
reported_when timestamp with time zone NOT NULL DEFAULT now()
reported_by text NOT NULL DEFAULT "current_user"()

who or what reported this condition, may be a user or software
reported_to text NOT NULL DEFAULT 'admin'::text

who is this condition reported to, user or admin, used for filtering
problem text NOT NULL

a description of the reported condition
solution text

a proposed solution to the problem
context text

specific context for this condition that would make the problem field unnecessary complex and bulky
category text NOT NULL

a category for the condition, this is used for filtering, too
cookie text

stores arbitrary information related to the condition, mostly used for semantic duplicates detection, eg. do not report on a single problem more than once in subsequent runs of, say, an import script

 

housekeeping_todo Constraints
Name Constraint
housekeeping_todo_reported_to_check CHECK ((reported_to = ANY (ARRAY['user'::text, 'admin'::text])))

Index - Schema public


Table: test_norm

each row defines one set of measurement reference data

test_norm Structure
F-Key Name Type Description
pk serial PRIMARY KEY
fk_ref_src integer UNIQUE#1 NOT NULL

source this reference data set was taken from
data text UNIQUE#1 NOT NULL

the actual reference data in some format, say, XML or like in a *.conf file
comment text

Index - Schema public


Table: unit

units as used in real life

unit Structure
F-Key Name Type Description
pk serial PRIMARY KEY
basic_unit.pk fk_basic_unit integer

what is the SI-Standard unit for this, e.g. for the unit mg it is kg
name_short text NOT NULL
name_long text
factor double precision NOT NULL DEFAULT 1.0

what factor the value with this unit has to be multiplied with to get values in the basic_unit
shift double precision NOT NULL DEFAULT 0.0

what has to be added (after multiplying by factor) to a value with this unit to get values in the basic_unit

Index - Schema public


Function: _(text)

Returns: text

Language: SQL

will return either the translation into i18n.curr_lang.lang for the current user or the input, created in public schema for easy access

select i18n._($1)

Function: _(text, text)

Returns: text

Language: SQL

will return either the translation into <text> (2nd argument) for the current user or the input, created in public schema for easy access

select i18n._($1, $2)

Function: f_rfi_type2item()

Returns: trigger

Language: PLPGSQL

function used to check referential integrity from clin.lnk_type2item to clin.clin_root_item with a custom trigger

declare
	dummy integer;
	msg text;
begin
	-- does fk_item change at all ?
	if TG_OP = 'UPDATE' then
		if NEW.fk_item = OLD.fk_item then
			return NEW;
		end if;
	end if;
	-- check referential integrity
	select into dummy 1 from clin.clin_root_item where pk_item=NEW.fk_item;
	if not found then
		msg := 'referential integrity violation: clin.lnk_type2item.fk_item [' || NEW.fk_item || '] not in <clin_root_item.pk_item>';
		raise exception '%', msg;
		return NULL;
	end if;
	return NEW;
end;

Function: f_set_encounter_timezone()

Returns: trigger

Language: PLPGSQL

begin
	if TG_OP = 'INSERT' then
		NEW.source_time_zone := (select (extract(timezone from (select now()))::text || 'seconds')::interval);
	else
		NEW.source_time_zone := OLD.source_time_zone;
	end if;
	return NEW;
end;

Generated by PostgreSQL Autodoc

W3C HTML 4.01 Strict