gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] database abstraction layer


From: Hilmar Berger
Subject: Re: [Gnumed-devel] database abstraction layer
Date: Tue, 22 Oct 2002 23:36:54 +0200 (CEST)

> > Sorry, it's in test-area/gmDrug. There is gmDrugObject.py and, as a small
> > example, amis.conf
> I am already hacking on it for about 1.5 hours. Couldn't
> resist :-))
 
> Hilmar, would you mind giving a short theory of operation ?
All right, I will try my best to give a short intro in few lines.

It should work like that: 

1. All data is accessed via a abstraction object (class Drug). The
characteristics of the data accessed are loaded from a config file
(queryConfigSource). 

2. Queries are grouped together to query groups. All queries of one
group are accessed via a common name and fetched from the backend at once. 

3. Every query is described by a query string, the variables that should
be filled with the data returned and the parameters that should be mapped
to the query. Mapped parameters can be set via the dictionary mVars in the
Drug instance. The query description is read from the config file
mentioned above. Queries are identified by a item type=query and the query
group named by query=aNAME. The config group name [test1],[test2] used for
every entry right now has no meaning.

4. All queries of a group are fetched from the backend once the
method GetData(group name) of the Drug object is called. Results are
returned as a dictionary of all variables returned by the query. 

The implementation is far from being perfect right now, I plan to rewrite
it so that queries can automatically set variables in a dictionary that
can be reused for mapping in subsequent queries. Next I will connect this
object to the frontend (reference browser) via a DrugView object that will
know about the parameters needed to fill specific parts of the  product
information sheet, drug indexes and so on. This object will query what
parameters are available for a specific database and adjust the output to
that case.
Write access is missing completely as of now, but it should be possible to
add that lateron.

Hope I could give at least some hints on how the supposed application will
be.

Hilmar








reply via email to

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