Dumped on 2008-09-07
table for referrals to defined individuals
| 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,
| 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)))) |
this table holds all the fields needed for auditing
| 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) |
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.
| 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 |
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
All tables that need standard auditing must be recorded in this table. Audit triggers will be generated automatically for all tables recorded here.
| 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 |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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,
| Name | Constraint |
|---|---|
| audit_trail_audit_action_check | CHECK (((audit_action = 'UPDATE'::text) OR (audit_action = 'DELETE'::text))) |
| 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() | |