gnumed-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gnumed-devel] [Gnumed-bugs] <bug>: on saving progress note


From: Slappinjohn
Subject: Re: [Gnumed-devel] [Gnumed-bugs] <bug>: on saving progress note
Date: Sun, 03 Feb 2013 19:59:21 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.11) Gecko/20121122 Icedove/10.0.11


Am 03.02.2013 17:55, schrieb Karsten Hilbert:
> \d clin.clin_root_item
                                           Table "clin.clin_root_item"
    Column     |           Type          
|                               Modifiers                              
---------------+--------------------------+-----------------------------------------------------------------------
 pk_audit      | integer                  | not null default
nextval('audit.audit_fields_pk_audit_seq'::regclass)
 row_version   | integer                  | not null default 0
 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()
 fk_encounter  | integer                  | not null
 fk_episode    | integer                  | not null
 narrative     | text                     |
 soap_cat      | text                     |
Indexes:
    "clin_root_item_pkey" PRIMARY KEY, btree (pk_item)
    "idx_cri_encounter" btree (fk_encounter)
    "idx_cri_episode" btree (fk_episode)
Check constraints:
    "clin_root_item_sane_soap_cat" CHECK (soap_cat IS NULL OR
(lower(soap_cat) = ANY (ARRAY['s'::text, 'o'::text, 'a'::text,
'p'::text, 'u'::text])))
Foreign-key constraints:
    "clin_root_item_fk_encounter_fkey" FOREIGN KEY (fk_encounter)
REFERENCES clin.encounter(pk)
ON UPDATE CASCADE ON DELETE RESTRICT
    "clin_root_item_fk_episode_fkey" FOREIGN KEY (fk_episode) REFERENCES
clin.episode(pk) ON UPDATE CASCADE ON DELETE RESTRICT
Rules:
    clin_ritem_no_del AS
    ON DELETE TO clin.clin_root_item DO INSTEAD  SELECT
clin.f_protect_clin_root_item() AS f_protect_clin_root_item
    clin_ritem_no_ins AS
    ON INSERT TO clin.clin_root_item DO INSTEAD  SELECT
clin.f_protect_clin_root_item() AS f_protect_clin_root_item
Triggers:
    tr_clin_item_mod AFTER INSERT OR DELETE OR UPDATE ON
clin.clin_root_item FOR EACH ROW EXECUTE PROCEDURE
clin.f_announce_clin_item_mod()
Inherits: audit.audit_fields
Number of child tables: 12 (Use \d+ to list them.)
> \d clin.clin_narrative ? 
                                           Table "clin.clin_narrative"
    Column     |           Type          
|                               Modifiers                              
---------------+--------------------------+-----------------------------------------------------------------------
 pk_audit      | integer                  | not null default
nextval('audit.audit_fields_pk_audit_seq'::regclass)
 row_version   | integer                  | not null default 0
 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()
 fk_encounter  | integer                  | not null
 fk_episode    | integer                  | not null
 narrative     | text                     |
 soap_cat      | text                     |
 pk            | integer                  | not null default
nextval('clin.clin_narrative_pk_seq'::regclass)
Indexes:
    "clin_narrative_pkey" PRIMARY KEY, btree (pk)
    "idx_clnarr_unique" UNIQUE, btree (fk_encounter, fk_episode,
soap_cat, modified_by, md5(narrative))
    "idx_clnarr_encounter" btree (fk_encounter)
    "idx_clnarr_episode" btree (fk_episode)
    "idx_narrative_modified_by" btree (modified_by)
"idx_narrative_soap_cat" btree (soap_cat) WHERE lower(soap_cat) = ANY
(ARRAY['s'::text, 'o':
:text, 'a'::text, 'p'::text, 'u'::text])
Check constraints:
    "clin_narrative_soap_cat_check" CHECK (soap_cat IS NULL OR
(lower(soap_cat) = ANY (ARRAY['s'::text, 'o'::text, 'a'::text, 'p'::text])))
    "clin_root_item_sane_soap_cat" CHECK (soap_cat IS NULL OR
(lower(soap_cat) = ANY (ARRAY['s'::text, 'o'::text, 'a'::text,
'p'::text, 'u'::text])))
    "narrative_neither_null_nor_empty" CHECK (btrim(COALESCE(narrative,
''::text)) <> ''::text)
Foreign-key constraints:
    "clin_narrative_fk_encounter_fkey" FOREIGN KEY (fk_encounter)
REFERENCES clin.encounter(pk) ON UPDATE CASCADE ON DELETE RESTRICT
    "clin_narrative_fk_episode_fkey" FOREIGN KEY (fk_episode) REFERENCES
clin.episode(pk) ON UPDATE CASCADE ON DELETE RESTRICT
Referenced by:
    TABLE "clin.clin_diag" CONSTRAINT "clin_diag_fk_narrative_fkey"
FOREIGN KEY (fk_narrative) REFERENCES clin.clin_narrative(pk) ON UPDATE
CASCADE ON DELETE RESTRICT
    TABLE "clin.lnk_code2narrative" CONSTRAINT
"lnk_code2narrative_fk_item_fkey" FOREIGN KEY (fk_item) REFERENCES
clin.clin_narrative(pk) ON UPDATE CASCADE ON DELETE CASCADE
Triggers:
    tr_clin_narrative_mod AFTER INSERT OR DELETE OR UPDATE ON
clin.clin_narrative DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE
PROCEDURE clin.trf_announce_clin_narrative_mod()
    tr_narrative_mod AFTER INSERT OR DELETE OR UPDATE ON
clin.clin_narrative DEFERRABLE INITIALLY IMMEDIATE FOR EACH ROW EXECUTE
PROCEDURE clin.trf_announce_narrative_mod()
    tr_sanity_check_enc_epi_insert BEFORE INSERT ON clin.clin_narrative
FOR EACH ROW EXECUTE PRO
CEDURE clin.trf_sanity_check_enc_epi_insert()
    zt_del_clin_narrative BEFORE DELETE ON clin.clin_narrative FOR EACH
ROW EXECUTE PROCEDURE audit.ft_del_clin_narrative()
    zt_ins_clin_narrative BEFORE INSERT ON clin.clin_narrative FOR EACH
ROW EXECUTE PROCEDURE audit.ft_ins_clin_narrative()
    zt_upd_clin_narrative BEFORE UPDATE ON clin.clin_narrative FOR EACH
ROW EXECUTE PROCEDURE audit.ft_upd_clin_narrative()
Inherits: clin.clin_root_item


> Thanks, Karsten 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]