gnumed-devel
[Top][All Lists]
Advanced

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

[Gnumed-devel] re: tricky


From: Syan Tan
Subject: [Gnumed-devel] re: tricky
Date: Wed, 01 Jun 2005 22:27:53 +0800



here's a first implementation of a med record sql exporter.

It works using the original schemascan.py code, but had to do some 
specific things like:

1. prevent dumping "domain info" data e.g  type tables , vaccination knowledge
schemas.
Also prevents backtracking from static data onto other xlnk_identity or 
identity 
It's hard to get a program to distinguish domain data from "instance" data , 
without
specifically labelling things.


2. cater for xlnk_identity using xfk_identity as both an alternate primary key
and a foreign key

3. order the inserts in dependency order.
 - the set constraints all deferred; didn't seem to do anything , so had to 
order
inserts.
 
It uses a temp table of ( table, old_id, new_id) at the start of the script,
to remap the ids, and then "select new_id from id_remap where table=x and old_id
= id"
for all the key fields ).

The script also tries to insert test_type_unified entries to ensure they
are there before inserting the identity data, but doesn't fail if they are 
there,
because they are not part of the transaction.

To test it worked, a modified run of cygwin/install_schema.sh was used which 
had no test data in it.

a gzip dumped of the empty gnumed database is supplied. 
run (assuming a successfully installed gnumed db was install and 
dropped, so the users and groups have been set up)

rec.sql is the output of running schemascan.py on a 
test gnumed database with kirk loaded ( can do pg_dump, then createdb -U gm-dbo
gnumedtest and use an alternate database). 

In order to test rec.sql works, 
do

dropdb -U gm-dbo gnumed (if not loading from gnumedtest)

creatdb -U gm-dbo gnumed

psql -f gnumed.test.sql -U gm-dbo gnumed 

run gm-from-cvs.sh
should work, but no Kirk.

psql -f rec.sql -U gm-dbo gnumed

 this last should work.

run gm-from-cvs.sh
find Kirk
the emr-tree, emr-dump, document tree, lab_viewer, and vaccinations 
seem to show up all transferred information.

Hope it works on other installations.









 

 

Attachment: schemascan.py
Description: Binary data

Attachment: pg_hba.conf
Description: Binary data

Attachment: gnumed.test.sql.gz
Description: Binary data


reply via email to

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