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

Re: Drug lists



Elizabeth Barham <soggytrousers@yahoo.com> writes:

> If we provided a schema or DTD along with the tools to insert/export
> the data into the (non-XML) DB, then I believe end-users would be
> more easily able to adapt it to their needs.

What about this:

A product that reads in an XML file along with it's matching
schema. From the schema it generates all the necessary header files
and sets up the database (berkeley) and then inserts the data
automatically.

As an example:

<?xml version="1.0"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema";>

<xs:complexType name="drugType">
  <xs:sequence>
    <xs:element name="tradename" type="xs:string" />
    <xs:element name="manufacturer" type="firmType"/>
</xs:complexType>

<xs:complexType name="firmType">
  <xs:sequence>
    <xs:element name="label_code" type="xs:string"/>
    <xs:element name="name" type="xs:string" />
  </xs:sequence>
</xs:complexType>

<xs:element name="drug" type="drugType"/>

</xs:schema>

>From this we could map each complexType into a particular database
linked from it's container via a primary key.

struct drugType {
  char* tradename;
  unsigned long   firm_primary_key;
  void* marker; // tradename would have to point to the next byte
                // after marker.
};

struct firmType {
  char* label_code;
  char* name;
  void* marker;
};

BerkeleyDB is able to match up against same Key/Data pairs so we could
automatically reduce repetition although the XML data will for a
particular drug could be all the data we have upon the drug (the XML
file looks like it's 'everything' but it's really a join).

Elizabeth


-- 
To UNSUBSCRIBE, email to debian-med-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org



Reply to: