Dumped on 2008-09-07

Index of database - gnumed_v10


Schema au


Table: au.referral

table for referrals to defined individuals

au.referral Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_fields_pk_audit_seq'::regclass)
row_version integer NOT NULL
modified_when timestamp with time zone NOT NULL DEFAULT now()
modified_by name NOT NULL DEFAULT "current_user"()
pk_item integer NOT NULL DEFAULT nextval('clin.clin_root_item_pk_item_seq'::regclass)
clin_when timestamp with time zone NOT NULL DEFAULT now()
clin.encounter.pk fk_encounter integer NOT NULL
clin.episode.pk fk_episode integer NOT NULL
narrative text

inherited from clin.clin_root_item; stores text of referral letter
soap_cat text
id serial PRIMARY KEY
dem.identity.pk fk_referee integer NOT NULL

person to whom the referral is directed
clin.form_instances.pk fk_form integer NOT NULL

foreign key to the form instance of this referral.

Table au.referral Inherits clin_root_item,

 

au.referral Constraints
Name Constraint
referral_soap_cat_check CHECK (((soap_cat IS NULL) OR ((((lower(soap_cat) = 's'::text) OR (lower(soap_cat) = 'o'::text)) OR (lower(soap_cat) = 'a'::text)) OR (lower(soap_cat) = 'p'::text))))

Index - Schema au


Schema audit


Table: audit.audit_fields

this table holds all the fields needed for auditing

audit.audit_fields Structure
F-Key Name Type Description
pk_audit serial PRIMARY KEY
row_version integer NOT NULL

the version of the row; mainly just a count
modified_when timestamp with time zone NOT NULL DEFAULT now()

when has this row been committed (created/modified)
modified_by name NOT NULL DEFAULT "current_user"()

by whom has this row been committed (created/modified)

Index - Schema audit


Table: audit.audit_trail

Each table that needs standard auditing must have a log table inheriting from this table. Log tables have the same name with a prepended "log_". However, log_* tables shall not have constraints.

audit.audit_trail Structure
F-Key Name Type Description
pk_audit serial PRIMARY KEY
orig_version integer NOT NULL

the version of this row in the original table previous to the modification
orig_when timestamp with time zone NOT NULL

previous modification date in the original table
orig_by name NOT NULL

who committed the row to the original table
orig_tableoid oid NOT NULL

the table oid of the original table, use this to identify the source table
audit_action text NOT NULL

either "update" or "delete"
audit_when timestamp with time zone NOT NULL DEFAULT now()

when committed to this table for auditing
audit_by name NOT NULL DEFAULT "current_user"()

committed to this table for auditing by whom

 

audit.audit_trail Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.audited_tables

All tables that need standard auditing must be recorded in this table. Audit triggers will be generated automatically for all tables recorded here.

audit.audited_tables Structure
F-Key Name Type Description
id serial PRIMARY KEY
schema name UNIQUE#1 NOT NULL DEFAULT 'public'::name
table_name name UNIQUE#1 NOT NULL

Index - Schema audit


Table: audit.log_address

audit.log_address Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
id integer
id_street integer
aux_street text
number text
subunit text
addendum text
lat_lon point

Table audit.log_address Inherits audit_trail,

 

audit.log_address Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_allergy

audit.log_allergy Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk_item integer
clin_when timestamp with time zone
fk_encounter integer
fk_episode integer
narrative text
soap_cat text
pk integer
substance text
substance_code text
generics text
allergene text
atc_code text
fk_type integer
generic_specific boolean
definite boolean

Table audit.log_allergy Inherits audit_trail,

 

audit.log_allergy Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_allergy_state

audit.log_allergy_state Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
id integer
fk_patient integer
has_allergy integer

Table audit.log_allergy_state Inherits audit_trail,

 

audit.log_allergy_state Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_atc_group

audit.log_atc_group Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk integer
code text
description text

Table audit.log_atc_group Inherits audit_trail,

 

audit.log_atc_group Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_atc_substance

audit.log_atc_substance Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk integer
code text
name text
ddd_amount numeric
fk_ddd_unit integer
route text
comment text

Table audit.log_atc_substance Inherits audit_trail,

 

audit.log_atc_substance Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_beh_fall_typ

audit.log_beh_fall_typ Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk integer
code text
kurzform text
name text

Table audit.log_beh_fall_typ Inherits audit_trail,

 

audit.log_beh_fall_typ Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_behandlungsfall

audit.log_behandlungsfall Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
pk integer
fk_patient integer
fk_falltyp integer
started date
must_pay_prax_geb boolean

Table audit.log_behandlungsfall Inherits audit_trail,

 

audit.log_behandlungsfall Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_clin_aux_note

audit.log_clin_aux_note Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk_item integer
clin_when timestamp with time zone
fk_encounter integer
fk_episode integer
narrative text
soap_cat text
pk integer

Table audit.log_clin_aux_note Inherits audit_trail,

 

audit.log_clin_aux_note Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_clin_diag

audit.log_clin_diag Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk integer
fk_narrative integer
laterality bpchar
is_chronic boolean
is_active boolean
is_definite boolean
clinically_relevant boolean

Table audit.log_clin_diag Inherits audit_trail,

 

audit.log_clin_diag Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_clin_hx_family

audit.log_clin_hx_family Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk_item integer
clin_when timestamp with time zone
fk_encounter integer
fk_episode integer
narrative text
soap_cat text
pk integer
fk_hx_family_item integer

Table audit.log_clin_hx_family Inherits audit_trail,

 

audit.log_clin_hx_family Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_clin_item_type

audit.log_clin_item_type Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk integer
type text
code text

Table audit.log_clin_item_type Inherits audit_trail,

 

audit.log_clin_item_type Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_clin_medication

audit.log_clin_medication Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()
audit_by name NOT NULL DEFAULT "current_user"()
row_version integer
modified_when timestamp with time zone
modified_by name
pk_item integer
clin_when timestamp with time zone
fk_encounter integer
fk_episode integer
narrative text
soap_cat text
pk integer
last_prescribed date
fk_last_script integer
discontinued date
brandname text
generic text
adjuvant text
dosage_form text
ufk_drug text
drug_db text
atc_code text
is_cr boolean
dosage numeric[]
period interval
dosage_unit text
directions text
is_prn boolean

Table audit.log_clin_medication Inherits audit_trail,

 

audit.log_clin_medication Constraints
Name Constraint
audit_trail_audit_action_check CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text)))

Index - Schema audit


Table: audit.log_clin_narrative

audit.log_clin_narrative Structure
F-Key Name Type Description
pk_audit integer NOT NULL DEFAULT nextval('audit.audit_trail_pk_audit_seq'::regclass)
orig_version integer NOT NULL
orig_when timestamp with time zone NOT NULL
orig_by name NOT NULL
orig_tableoid oid NOT NULL
audit_action text NOT NULL
audit_when timestamp with time zone NOT NULL DEFAULT now()