Drugs database schema of FreeDiams
This section is written primarily for developers. FreeDiams is programmed to manage multiple therapeutic databases. To add a data source, you just need to create a database data meeting the criteria described below with SQLite.
Drugs database
Name of the Drugs database file
All drugs databases must use the above schema for their filename:
- No specific suffixe
- 'drugs' filename forbidden
- Mandatory extension : db
- Example : drugs-usa.db
Tables of the database
The database should contain several tables linked together through primary keys.
There is one for each drug unique identifier number (UID). This unique identifier number
may have a special name (CIS for France, PZN Germany…). This designation
can be completed in the table INFORMATIONS.
The various tables are:
- DRUGS: contains the UID, the name of the drug and information on marketing;
- COMPOSITION: Contains a description of various molecules to the drug
- PACKAGING: contains the format of treatment (packaging)
- LK_MOL_ATC : contains links between code molecules and ATC codes (ids)
So far, FreeDiams does not take into account the table PACKAGING.
The DRUGS table
Schema :
- UID : Unique Identifier for Drug, typically per-country
- NAME : Commercial, “brand” name of the drug
- FORM : Form of the drug (e.g. tablet, capsule, powder, solution, cream, soap bar)
- ROUTE : route of administration (e.g. oral, intravenous, ophthalmic, rectal, topical)
- ATC : drug's Anatomical Therapeutic Chemical classification system code
- GLOBAL_STRENGTH : contains the globale strenght of the drug. Only used for the drugs name construction. See also:
INFORMATIONS.DRUGS_NAME_CONSTRUCTOR.
- Ex : 2.5mg;6.5mg
- TYPE_MP (optional) : marketing permission (AMM in French, Schedule in CA)
- AUTHORIZATION (optional) : type of authorisation
- MARKETED : Boolean :: Yes = 1 ; No = 0
- LINK_SPC (optional) : internet link to a “summary of product characteristics”
The COMPOSITION table
A drug can contain multiple molecules. One molecule can be present in a specific form and be metabilized into another (see NATURE / LK_NATURE).
Schema:
- UID : UID of the drug
- MOLECULE_FORM : form of the drug (redundant with DRUGS.FORM)
- MOLECULE_CODE : unique identifier of the molecule
- MOLECULE_NAME : name of the molecule
- DOSAGE : molecule amount (per amount of form) e.g. “325 mg”
- DOSAGE_REF : reference amount of form e.g. “1 tablet”, “2 mL suspension”
- NATURE : must be one of two kinds :
- SA (can be used as default value) : name of Active substance
- FT : name of Tranformed substance
- LK_NATURE :
- Link from SA to FT
The LK_MOL_ATC table
This table is essential for the calculation of drug interactions.
The interactions' search engine uses the molecular composition of drugs. Each molecule
must be linked to a code ATC (via its identifier from the database \e iam). Interactions are
calculated on the basis of ATC codes.
Schema :
- MOLECULE_CODE = link to COMPOSITION.MOLECULE_CODE
- ATC_ID = link to INTERACTION_DATABASE.ATC.ID (not the CODE)
The PACKAGING table
This table is optional.
Schema :
- UID : UID of the Drug
- PACKAGE_UID : UID of the packaging
- LABEL : label of the packaging
- STATUS :
- Active packaging → A
- Inactive packaging → B
- MARKETING :
- Marketing cancelled → A
- Unknown Marketing date → N
- Commercialized → C
- Suspended Marketing → S
- DATE : most recent commercial update
- OPTIONAL_CODE : can complete the MAIN_CODE
The INFORMATIONS table
Schema :
- VERSION : Version of the db (please be read the page : \ref versionning). See this as a primary key. FreeDiams will read the first
selected row of the database as database informations.
- NAME : Name of the database to display to the user. Translations are supported using syntax 'two-character ISO language code=name',
unquoted, without any egal sign in the name and with line breaks delimiting multiple languages (see below).
- <code>
fr=French name en=English name sp=Spanish de=Deutsch xx=All other languages </code
- IDENTIFIANT : unique identifiant for FreeDiams.
- This identifiant must be unique for all drugs databases provided for FreeDiams
- French AFFSSAPS database = “FR_AFSSAPS”
- FDA database = “USA_FDA”;
- Canadian database = “CANADIAN”;
- COMPAT_VERSION : FreeDiams application version dependency
- PROVIDER : Provider of the datas (eg FDA)
- WEBLINK : Web site of the provider
- COMPLEMENTARY_WEBSITE : Web site of additionnal informations on the database
- AUTHOR : Author of the database (eg Me)
- LICENSE :
- DATE : Date of release; format MUST BE formatted : yyyy-MM-dd
- DRUG_UID_NAME : Name to use for the drug UID
- PACK_MAIN_CODE_NAME : Name to for the packaging main code
- ATC : boolean ; ATC is available for each drugs in the database
- INTERACTIONS : boolean : manages interactions
- AUTHOR_COMMENTS : place to hold your comment
- LANGUAGE_COUNTRY : language and country specificity. Format = language_country where :
- language is a lowercase, two-letter, ISO 639 language code,
- territory is an uppercase, two-letter, ISO 3166 country code,
- and codeset and modifier are ignored.
- DRUGS_NAME_CONSTRUCTOR : string to use for the drug name construction. Some tokens will be replaced by their values. You can use these
tokens :
- NULL value is replaced by “NAME” only
- “NAME” : for the name of the drug ( == DRUGS.NAME)
- “FORM” : for the name of the drug ( == DRUGS.FORM)
- “ROUTE” : for the name of the drug ( == DRUGS.ROUTE)
- “GLOBAL_STRENGTH” : for the name of the drug ( == DRUGS.GLOBAL_STRENGTH)
- Eg : NAME, FORM (GLOBAL_STRENGTH) == AMOXICILLINE, TABLETS (1g)
- Eg : NAME, FORM, ROUTE - * GLOBAL_STRENGTH == AMOXICILLINE, TABLETS, ORAL - * 1g
The SEARCH_ENGINES table
This table allow developpers to add search engines to help users. These search engines will be added to the Protocol Creator Dialog under the button Help and Informations.
Available tokens:
- [[ONE_ATC_CODE]] –> 1 ATC CODE == 1 more link
- [[DRUG_ATC]] –> if known the DRUGS.ATC value (ATC code)
- [[ATC_CODES]] –> all know ATC Codes of the drug (and its molecular components)
- [[ATC_LABELS]] –> all known ATC Label of the drug (and its molecular components)
- [[DRUG_NAME]] –> exact value of the DRUGS.NAME field
- [[CONSTRUCTED_DRUG_NAME]] –> the constructed drug name like inform in the INFORMATIONS.DRUGS_NAME_CONSTRUCTOR
- [[DRUG_UID]] –> the UID of the drug
Interactions database
Interactions are calculated from ATC code of each components of drugs.
Some components are grouped into “interactions classes” which are shown in the ATC classification
under the codes ZXX.
Each drugs databases that provides links from their components to ATC codes, give the
possibilities to calculate the drugs interactions.
Table INTERACTIONS
Is mainly a link table.
- ID : unique identifier of the interaction
- ATC_ID1 : link to ATC.ID of the first interacting molecule or class
- ATC_ID2 : link to ATC.ID of the second interacting molecule or class
- INTERACTION_KNOWLEDGE_ID : link to the INTERACTION_KNOWLEDGE
Table INTERACTION_KNOWLEDGE
This table contains the content of the interaction.
- ID : unique identifier
- TYPE : type of interaction (encoded string)
- I : Information
- P = Precaution
- T = Take in account
- D = Inadvisable
- C = Contraindication
- RISK_FR : risk content in french
- MANAGEMENT_FR : management of the interaction in french
- RISK_EN : risk content in english
- MANAGEMENT_EN : management of the interaction in english
- XML : XML encoded (future use)
Database informations
Drugs databases are stored inside /Resources/databases/drugs.
You can use whatever file name you want. File name must end with .db file extension. The INFORMATIONS
table will be examinated. If it does not contains errors, the drugs database will be concidered as
usable by FreeDiams.