gnumed-devel
[Top][All Lists]
Advanced

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

Re: [Gnumed-devel] pharm information as XML


From: Horst Herb
Subject: Re: [Gnumed-devel] pharm information as XML
Date: Mon, 7 Feb 2005 16:00:56 -0500
User-agent: KMail/1.7.1

On Mon, 7 Feb 2005 09:44, Karsten Hilbert wrote:
> Now, is it possible to support this kind of interaction hidden
> behind a drugref API adapter ?

Easy:

class ifapadapter(drugrefapi_base):
 def __init__(...)
  #tells the adapter how to "connect"
  ...
  #tells the adapter what's available:
  addfunc(searchdrug, '_search_name', ['drug_genericname', 'drug_brandname')

 def searchdrug(searchexpr):
  #this function does all the interaction with the database
  #connect to database by whatever means
  #run the query and retrieve the result by whatever means
  return [{'drug_genricname': 'blah', 'drug_brandname' : 'blahblah'}]


That's basically it. Everything else, like the caching etc., is handled by the 
baseclass.

Horst




reply via email to

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