Home  Beta programs 
  Welcome to Mobipocket Developer Center
powered by FreeFind

Creating Content

Getting Started
What is the Mobipocket file formatHow do I create a Mobipocket eBookStandard eBooksAdvanced eBooks
eBook features
Cross-platform feature supportImage supportTable supportCover PageParagraph rendering and hyphenationHyperlinksGuide itemsFramesIndexes and DictionariesSectionsAuthoring tips
Extended eBook features
DatabasesSQL queriesJavascriptHTML forms
Open-eBook HTML tagsSupported HTML entitiesHTML form tagsMobipocket custom tagsOPF x-metadata tagsMobipocket URLsMobipocket Document Object Model (DOM)Mobipocket Active Server Pages (ASP)Mobipocket Active Data Objects (ADO)Mobipocket Javascript Objects
Drug interaction module
Advanced topics
Setting margins
Home | Hide TOC | Download Sample | Add to Favorites

Drug Interaction Module

The Mobipocket Reader Pro 4.5 or higher contains a built-in drug interaction module . This module uses drug interaction information to be compiled in the current eBook.

This built-in Module offers the following options :

  1. Allows the user the add any number of drug in a custom list. View the cart, add or remove items in it
  2. Within the drug list, the user can then compute drug interactions and view any potential interaction information related to them.

How to use the Drug Interaction Module

  1. Generate 2 custom XML files . The first one contains the links between drugs and interaction classes. The second one contains interaction information between 2 classes.
  2. Add a link to these 2 XML files in to OPF , so that the PRCGEN.exe will put them in the PRC file
  3. In the HTML content of the PRC, add a link or a button (with some Javascript Code) to add the current drug to the drug list . This allows the user to add a new drug name to the drug list.
  4. Finally add a link (Javascript onclick code) from the main page or table of content to display the drug list.

Interaction XML Data Files

speclass.xml : Drug Interaction Class information. This files contains for each drug name all the interaction classes related to the drug. 

<?xml version="1.0">
     <Name>Drug Name goes here</Name >
     <ClassName>Interaction Class Name goes here</ClassName >

classclass.xml :  Interaction Class Couples : this file contains the list of interactions between 2 classes, and some HTML information related to it.

<?xml version="1.0">
     <class1>Interaction Class Name goes here</class1 >
     <class2>Second Interaction Class Name goes here</class2 >
     <desc content="raw-text">some HTML goes here </desc>
     <class1>Second Interaction Class Name goes here</class1 >
     <class2>Interaction Class Name goes here</class2 >
     <desc content="raw-text">some HTML goes here </desc>


Warning : for a given interaction class couple, you need to specify 2 interactions (A,B) and (B,A).

Link Interaction XML Data files in the OPF

Add 2 item nodes in the manifest section of the OPF, which points to the previous 2 XML files.
If (and this is very likely the case) you already have an index of drug names you can specify the name of the drug index in the merge-into="" attribute of thefirst item node in order to save space and not duplicate the names of drugs in the PRC file.

<item type="mbp-special-medicinteract-definitions" href="speclasse.xml" media-type= "text/xml"< STRONG> merge-into< /STRONG> ="drug"/>
<item type="mbp-special-medicinteract-interactions" href= "classeclasse.xml" media-type= "text/xml"/>< BR> </manifest>

Javascript Code for the Drug List

Add some Javascript code in the content to deal with Drug List/
To add a drug to the list :
<a onclick="cart.add('interactions','drug name goes here')">< /STRONG> Add this Drug to the list</a>

To go to the drug list :
<a onclick="open('oeb:cart?name=interactions&amp;title=Drugs')">Go to the drug list</a>

Warning : the Cart Name (in the car.add() function and in the oeb:cart?name=xxx url) has to be exactly  'interactions', in order to make the interaction computation work.


The user interface for the drug list and the interaction results cannot be customized in the current version 4.8.

Copyright 2000-2007 Mobipocket.com