#referral# #au# #table for referrals to defined individuals# # pk_audit# #integer# #nextval('audit.au ... lass)# # row_version# #integer# # modified_when# #timestamp with time zone# #now()# # modified_by# #name# #"current_user"()# # pk_item# #integer# #nextval('clin.cli ... lass)# # clin_when# #timestamp with time zone# #now()# # fk_encounter# #integer# # fk_episode# #integer# # narrative# #text# # soap_cat# #text# # id# #serial# # fk_referee# #integer# # fk_form# #integer# #clin_root_item_soap_cat_check# #CHECK (((soap_cat IS NULL) OR ... t))))# ## #referral_soap_cat_check# #CHECK (((soap_cat IS NULL) OR ... t))))# ## #audit_fields# #audit# #this table holds all the fields nee ... iting# # pk_audit# #serial# # row_version# #integer# # modified_when# #timestamp with time zone# #now()# # modified_by# #name# #"current_user"()# #audit_trail# #audit# #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.# # pk_audit# #serial# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #audited_tables# #audit# #All tables that need standard auditing must be recorded in this table. Audit triggers will be generated automatically for all tables recorded here.# # id# #serial# # schema# #name# #'public'::name# # table_name# #name# #log_access_log# #audit# ## # pk_audit# #integer# #nextval('audit.au ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # user_action# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_address# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_allergy# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_allergy_state# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # has_allergy# #integer# # comment# #text# # last_confirmed# #timestamp with time zone# # fk_encounter# #integer# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_atc_group# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # code# #text# # description# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_atc_substance# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_beh_fall_typ# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # code# #text# # kurzform# #text# # name# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_behandlungsfall# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # pk# #integer# # fk_patient# #integer# # fk_falltyp# #integer# # started# #date# # must_pay_prax_geb# #boolean# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_clin_aux_note# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_clin_diag# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_clin_hx_family# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_clin_item_type# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # type# #text# # code# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_clin_medication# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_clin_narrative# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_coded_phrase# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # term# #text# # code# #text# # xfk_coding_system# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_data_source# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # name_short# #text# # name_long# #text# # version# #text# # description# #text# # source# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_doc_desc# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # fk_doc# #integer# # text# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_doc_med# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # fk_encounter# #integer# # fk_episode# #integer# # fk_type# #integer# # comment# #text# # clin_when# #timestamp with time zone# # ext_ref# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_episode# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # fk_health_issue# #integer# # description# #text# # is_open# #boolean# # fk_encounter# #integer# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_form_data# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # fk_instance# #integer# # fk_form_field# #integer# # value# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_form_instances# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"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_form_def# #integer# # form_name# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_gender_label# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # tag# #text# # label# #text# # sort_weight# #integer# # comment# #text# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_health_issue# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # description# #text# # laterality# #character varying# # age_noted# #interval# # is_active# #boolean# # clinically_relevant# #boolean# # is_confidential# #boolean# # is_cause_of_death# #boolean# # fk_encounter# #integer# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_hx_family_item# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # fk_narrative_condition# #integer# # fk_relative# #integer# # name_relative# #text# # dob_relative# #timestamp with time zone# # condition# #text# # age_noted# #text# # age_of_death# #interval# # is_cause_of_death# #boolean# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_identity# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # deleted# #boolean# # pupic# #bpchar# # gender# #text# # karyotype# #text# # dob# #timestamp with time zone# # fk_marital_status# #integer# # cob# #bpchar# # deceased# #timestamp with time zone# # title# #text# # tob# #time without time zone# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_inbox_item_category# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # description# #text# # is_user# #boolean# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_inbox_item_type# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()# # audit_by# #name# #"current_user"()# # row_version# #integer# # modified_when# #timestamp with time zone# # modified_by# #name# # pk# #integer# # fk_inbox_item_category# #integer# # description# #text# # is_user# #boolean# #audit_trail_audit_action_check# #CHECK (((audit_action = 'UPDAT ... xt)))# ## #log_incoming_data_unmatchable# #audit# ## # pk_audit# #integer# #nextval('audit_tr ... lass)# # orig_version# #integer# # orig_when# #timestamp with time zone# # orig_by# #name# # orig_tableoid# #oid# # audit_action# #text# # audit_when# #timestamp with time zone# #now()#