gnumed-devel
[Top][All Lists]
Advanced

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

[Gnumed-devel] re: concrete example


From: scaredycat
Subject: [Gnumed-devel] re: concrete example
Date: Thu, 30 Sep 2004 21:17:28 +1000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616



insert into test_org
        (fk_org, fk_adm_contact, fk_med_contact, internal_name, comment)
values (
        7777777,
        (select i_id from v_basic_person where firstnames='Leonard' and 
lastnames='Spock' and dob='1931-3-26+2:00'::timestamp),
        (select i_id from v_basic_person where firstnames='Leonard' and 
lastnames='McCoy' and dob='1920-1-20+2:00'::timestamp),
        'Syan"s Lab',
        'a dummy lab for Syan to store blood pressure'
);


for clinician measured and recorded data, are applications going to use 3 | -3 | | | your own practice ,
or an application instance test_org ?

insert into test_type
        (fk_test_org, code, name, comment, conversion_unit)
values (
        currval('test_org_pk_seq'),
        'sBP',
        'systolic blood pressure',
        'right arm, sitting, standard size cuff assumed',
        'Pa'
);

insert into test_type_local (code, name)
values (
        'RR',
        'systolic blood pressure'
);


insert into lnk_ttype2local_type (fk_test_type, fk_test_type_local)
values (
        currval('test_type_pk_seq'),
        currval('test_type_local_pk_seq')
);



insert into test_type
        (fk_test_org, code, name, comment, conversion_unit)
values (
        currval('test_org_pk_seq'),
        'dBP',
        'diastolic blood pressure',
        'right arm, sitting, standard size cuff assumed',
        'Pa'
);

insert into test_type_local (code, name)
values (
        'RR',
        'diastolic blood pressure'
);

insert into lnk_ttype2local_type (fk_test_type, fk_test_type_local)
values (
        currval('test_type_pk_seq'),
        currval('test_type_local_pk_seq')
);


so code 'RR' is a key to the basic test type, and all test_type that need to be converted are connected via lnk_ttype2local_type , and local_type will point with attribute code to
the  basic test_type ?


insert into test_result (
        fk_encounter,
        fk_episode,
        fk_type,
        val_num,
        val_unit,
        val_normal_min,
        val_normal_max
) values (
        currval('clin_encounter_id_seq'),
        (select pk from clin_episode where name='blood pressure follow-up'),
        (select pk from test_type where code='sBP' and ...),
        '140',
        'mmHG',
        '105',
        '130'
);



insert into test_result (
        fk_encounter,
        fk_episode,
        fk_type,
        val_num,
        val_unit,
        val_normal_min,
        val_normal_max
) values (
        currval('clin_encounter_id_seq'),
        (select pk from clin_episode where name='blood pressure follow-up'),
        (select pk from test_type where code='dBP' and ...),
        '80',
        'mmHG',
        '65',
        '85'
);


Karsten






reply via email to

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