gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] family history table


From: Richard Terry
Subject: Re: [Gnumed-devel] family history table
Date: Mon, 21 Mar 2005 08:42:31 +1100
User-agent: KMail/1.5.4

Just a question as I'm not sure I  quite understand how you are linking this 
stuff.

We constantly change data in a medical record system - FH included. I often 
find the one of us may have put in a history, only to find out weeks, or 
months down the track that the information was either wrong/misdaignosed.

Have you allowed in the design for the family history condition to be modified 
in a way that will re-appear in every other related family members notes? ie 
not have the old information still come up in someone elses notes.

I know this is fairly basic, and I'm sure you have done it, but just wanted to 
check.

Richard

On Fri, 18 Mar 2005 04:06 am, Karsten Hilbert wrote:
> BTW, here is the current, enhanced table:
>
> create table clin_hx_family (
>       pk serial primary key,
>       fk_narrative_condition integer
>               default null
>               references clin_narrative(pk)
>               on update cascade
>               on delete restrict,
>       fk_relative integer
>               default null
>               references xlnk_identity(xfk_identity)
>               on update cascade
>               on delete set null,
>       relationship text
>               not null
>               check (trim(relationship) != ''),
>       name_relative text
>               default null
>               check (coalesce(trim(name_relative), 'dummy') != ''),
>       dob_relative timestamp with time zone
>               default null,
>       age_noted text,
>       age_of_death interval
>               default null,
>       is_cause_of_death boolean
>               not null
>               default false
> ) inherits (clin_root_item);
>
> alter table clin_hx_family add constraint narrative_null_or_not_empty
>       check (coalesce(trim(narrative), 'dummy') != '');
>
> alter table clin_hx_family add constraint link_or_know_relative
>       check (
>               -- from linked narrative
>               (fk_narrative_condition is not null and fk_relative is null and
> name_relative is null and dob_relative is null) or
>               -- from linked relative
>               (fk_narrative_condition is null and fk_relative is not null and
> name_relative is null and dob_relative is null) or
>               -- from name
>               (fk_narrative_condition is null and fk_relative is null and 
> name_relative
> is not null) );
>
> alter table clin_hx_family add constraint link_or_know_condition
>       check (
>               (fk_narrative_condition is not null and narrative is null)
>                       or
>               (fk_narrative_condition is null and narrative is not null)
>       );
>
> -- FIXME: constraint trigger fk_narrative -> has_type(fHx)
>
> select add_table_for_audit('clin_hx_family');
>
> comment on table clin_hx_family is
>       'stores family history items';
> comment on column clin_hx_family.clin_when is
>       'when the family history item became known';
> comment on column clin_hx_family.fk_encounter is
>       'encounter during which family history item became known';
> comment on column clin_hx_family.fk_episode is
>       'episode to which family history item is of importance';
> comment on column clin_hx_family.narrative is
>       'fHx-typed narrative holding the condition
>        the relative suffered from, must be NULL
>        if fk_narrative_condition is not';
> comment on column clin_hx_family.soap_cat is
>       'as usual, must be NULL if fk_narrative_condition is not but
>        this is not enforced and only done in the view';
> comment on column clin_hx_family.fk_narrative_condition is
>       'can point to a narrative item of a relative if in database';
> comment on column clin_hx_family.fk_relative is
>       'foreign key to relative if also in database';
> comment on column clin_hx_family.relationship is
>       'how is the afflicted person related to the patient,
>        maybe make nullable later when fk_relative or
>        fk_narrative_condition is not null and the relationship
>        is defined there';
> comment on column clin_hx_family.name_relative is
>       'name of the relative if not also in database';
> comment on column clin_hx_family.dob_relative is
>       'DOB of relative if not also in database';
> comment on column clin_hx_family.age_noted is
>       'at what age the relative acquired the condition';
> comment on column clin_hx_family.age_of_death is
>       'at what age the relative died';
> comment on column clin_hx_family.is_cause_of_death is
>       'whether relative died of this problem, Richard
>        suggested to allow that several times per relative';





reply via email to

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