Menu

You guys need some good drugs ... in your DB

Developers
McAlister
2010-06-16
2014-01-18
  • McAlister

    McAlister - 2010-06-16

    I went to do a quick query on your drug table and found it empty!  But searching for drugs when writing an Rx worked?  How can this be?  Apparently it is because the drug searcher is doing a screen scrape of a commercial web page.

    For our purposes, we can't abide this.  So I downloaded the National Drug Code files from the FDA, created an alter set to make a set of tables the data can call home, scared up a perl script to parse the NDC reference files into the pharma_ tables, and am about to alter the drug lookup class to use the tables instead of the web site.

    I'm intending to take the string they type in, look for drugs names '%like%' it, resolve them to their active ingredients, circle back to grab all drugs containing an active ingredient shared with the '%like%'ed drugs, sort alphabetically, and display. 

    Thoughts?  Comments?  Instructions on how to submit the whole killamajig as a patch?

    Thanks,
    -Simone

     
    • burt brown

      burt brown - 2014-01-18

      Simone,

      Appreciate your ideas as I try to also do same thing with NDC codes. This was posted in 6/2010- did you try it and did it work? Thanks

       
  • McAlister

    McAlister - 2010-06-16

    Oh,

    I also hope to have a non-proprietary database of drug-to-drug interactions soon that can be leveraged with the above pharmacopia to alert doctors when the prescribe something that reacts badly with something the patient is already taking.

     
  • ZH Healthcare

    ZH Healthcare - 2010-06-16

    Hey Simone
    I liked your idea.  it is gonna be useful. 
    While Simone is at it, can someone tell me how the CAMOS RX interacts with the general RX?  Haven't been able to figure it out.
    Sam
    www.zhservices.com

     
  • Sam Bowen

    Sam Bowen - 2010-06-16

    OpenEMR Support has been working on a drug-drug interaction module that includes drug-drug, drug-food, drug-allergy and drug-disease  interaction checking.  This code is currently being reviewed by ViSolve with the intent of moving the GPL code into OpenEMR in the very near future.  Currently this is based on the Lexi-Comp database but our intent was to use the RxNorm database which is a free government sponsored drug database.  I have been waiting for this code to be reviewed by Tony McCormick, the Meaningful Use project manager and QA to be performed by ViSolve.  We will be glad to move this code into the SVN repository for joint work so that we can share the work that has already been done by you and by our team.

    The code has a second module that will be using a direct SureScripts connection for prescription writing.  It has been proposed that we use either Nu-Crop or Dr.First as an intermediary step since the direct connection to SureScripts will likely not be finished till late this year.  Using Nu-Crop or Dr.First will allow an earlier certification for the OpenEMR Project. (Assuming there is a certification body, who knows).

    Simone, is the database that you are using RxNorm?

    Tony, since this is still untested should this be in the CVS code base or in SVN and can you help me get it there?

    Sam Bowen, MD
    http://openmedsoftware.org

     
  • Pieter W

    Pieter W - 2010-06-16

    http://www.netmedicpr.com Demo has a medication database in place. And finds it's medication in that database. I like your idea of an official FDA or WHO database with Generic references.

    The OpenEMR Drug database is used as soon as you activate In-house medication since V 3.1 (? Don't take this for granted, took it from my own mental memory.)

    You also could take a peak at :
    http://vicareplus.com/demo/openemr/interface/login/login_frame.php where you find a working V4.0 database where latest fine tuning is available and where you find the latest of options.

    And Demo's on www.OpenEMR.org should not be forgotten.

    If I find some time I will try to be more specific because, what you try to accomplish is a great step forwards for OpenEMR. It was under scrutiny some time ago, but most probably a lot of silence due to complications or due to lack of time.

    I appreciate your efforts!

    Pimm

     
  • McAlister

    McAlister - 2010-06-16

    I'm just basing this on my last job ( Healthtrans LLC ).  We loaded drugs based on a file from First Data Bank.  Each drug in the file had a unique NDC 11 ( National Drug Code ) That specified not just what it was but also its packaging.  If you chop the last two digits off an NDC 11 you get an NDC9 which has the same information minus the packaging data. 

    The FDA NDC files are missing the last two digits for a lot of drugs, so I am storing them as 9's instead of 11's.  It irks me but as 9's you still have all the data about ingredients that you need for drug utilization review.  So I am populating the following tables:

    mysql> show tables like 'pharma\_%';
    +-----------------------+
    | Tables_in_openemrdev (pharma\_%) |
    +-----------------------+
    | pharma_dea_schedules             |
    | pharma_drug_dosages              |
    | pharma_drug_ingrediants          |
    | pharma_drugs                     |
    | pharma_ingrediants               |
    | pharma_route_of_admins           |
    +-----------------------+

    The route of administration table, dosage table, and dea ingrediants table are definition tables.  Just codes and their meanings.  The Drug Table looks like so:

    mysql> describe pharma_drugs;
    +---------+---------+----+---+------+-----+
    | Field        | Type         | Null | Key | Default | Extra |
    +---------+---------+----+---+------+-----+
    | ndc9         | varchar(9)   | NO   | PRI | NULL    |       |
    | trade_name   | varchar(100) | NO   |     | NULL    |       |
    | prescription | tinyint(1)   | NO   |     | NULL    |       |
    | schedule_id  | varchar(1)   | NO   |     | NULL    |       |
    | route_id     | varchar(3)   | NO   |     | NULL    |       |
    | dosage_id    | varchar(3)   | NO   |     | NULL    |       |
    +---------+---------+----+---+------+-----+

    And the drug_ingrediants table joins the drug and ingrediants table allowing you to see the active ingrediants in each drug and their proportions. ( 30 MG of that, 20 ML of this, etc ).

    mysql> describe pharma_drug_ingrediants;
    +----------+---------+----+---+------+-----+
    | Field         | Type        | Null | Key | Default | Extra |
    +----------+---------+----+---+------+-----+
    | ndc9          | varchar(9)  | NO   | PRI | NULL    |       |
    | ingrediant_id | int(11)     | NO   | PRI | NULL    |       |
    | quantity      | varchar(10) | NO   |     | NULL    |       |
    | units         | varchar(5)  | NO   |     | NULL    |       |
    +----------+---------+----+---+------+-----+

     
  • McAlister

    McAlister - 2010-06-16

    As for drug to drug, I'm waiting to hear back from the Pharmacists quality alliance so I don't know which DB they are going to recommend.

    But for submission … can I get instructions tailored for idiots?  I've been a big iron IBM/C coder for years so I live in terror of violating process and I've never worked on an open source project before so about all I'm sure of is that I won't have to take a clip board around and get signatures.  =)

    -Simone

     
  • McAlister

    McAlister - 2010-06-16

    OH, this is the source data I worked with:

    http://www.fda.gov/Drugs/InformationOnDrugs/ucm142438.htm#download

    FDA, National Drug Database.  If there is a better or preferred database out there and coding needed to integrate it I can do that.

    -Simone

     
  • Brady Miller

    Brady Miller - 2010-06-17

    hey,

    Sounds very cool. We keep some perl scripts in openemr/contrib/util (ie. loading icd9 codes etc.). This would be a good place to store your perl scripts (do not feel the need to keep them in the same format as the current perl scripts). I'd probably then have the perl scripts:
    1. create the tables in openemr database if do not yet exist
    2. drop tables in openemr database if already exist (or some other mechanism to allow updating them)
    3. parse raw file you downloaded and load the data into the tables

    Then you can adjust internals via openemr to use your drug table instead for lookup (could either use a global to set this, decide on the fly if your table actually exists, or give both options to use internet or your tables(if they exist)).

    This would be a good way to get the raw pieces in there and functional, and give others a way to use it. Then, can further integrate it.

    This is just some quick advice, and is not the way you have to do it.

    For us to check out your patches and code, can upload patches to the tracker and/or use git at the github.com repository:
    http://github.com/openemr/openemr

    Check out this page for new developer instructions:
    http://www.openmedsoftware.org/wiki/New_Developer_Information

     
  • McAlister

    McAlister - 2010-06-18

    OK, I have a branch put up to git hub with the changes.

    I'm looking into RxNorm to get an idea of the data Dr.Bowen has.  If RxNorm is a better DB I'd like to adapt to using it instead.  I'm on aim with the handle of SimoneAikenAIM if you want to discuss?  If the FDA DB is better but I didn't retrieve data he needs I can alter mine to support what you are doing.

    Also, I would like very much to be part of the meaningful use work.  If there is any specific tasks open you could assign me?

    Thanks,
    -Simone

     
  • McAlister

    McAlister - 2010-06-18

    Ahh instructions!  Few months out of HT and I'm acting like people can read my mind.  This mostly uses perl and DBD::mysql is a must have.

    In sql/Alters is a perl script that when run will create the drug tables and some FDA schedule data.  Should an error occur it will be printed to screen and stored in a log file. 

    in sql/Load is a script formularyLoad.pl.  If you run it the usage instructs you on where to get the FDA drug database zip file.  In my svn I have a copy in the folder with it but it is fairly large and I worried that posting it to git would be inconsiderate of your space limitations.  If it is OK I can toss the current one up.  FDA updates that file quarterly.

    The zip creates a folder with a dozen data files inside.  I parse them into the 6 pharma_* tables created in the first part.  The primary tables are pharma_drugs, pharma_ingredients, and pharma_drug_ingredients ( which relates the two ).  The other three translate codes in the pharma_drugs table to English strings suitable for human display.

     
  • McAlister

    McAlister - 2010-06-18

    OK looking into RxNorm it looks like they use the FDA drug code lib as a data source, so I bet they contain everything I have and more. 

    Dr Bowen, when will your module be ready for check in?  If it is a ways out, can I help?  Or can the drug loading piece be released early?

    Thanks,

    -Simone Aiken

     
  • Brady Miller

    Brady Miller - 2010-06-18

    Tony and Sam,
    Best place to put your code is on a branch in Tony's git repository. If he doesn't know how to do it yet, just send it to me and I'll happily put it in a branch on my git repository. Difficult for Simone to help with this function if he can't look at the code.
    thanks,
    brady

     
  • Tony McCormick

    Tony McCormick - 2010-06-18

    We agree.  As soon as Jeremy gets back next week we will post the code on my github as a branch.
    -Tony

     
  • Sam Bowen

    Sam Bowen - 2010-06-18

    Dear Simone,

    As discussed above we discussed placing this code on the github as it is currently not stable enough to place in CVS.  We are not hung up on RxNorm.  The current code is written for the proprietary database "Lexi-Comp."  RxNorm will not meet requirements for the SureScripts e-prescribing but we are interested in a free solution for those that don't want or don't need a USA based SureScripts solution.  So if the FDA drug code lib is what works we are fine with that.

    The Meaningful Use Project has been meeting every Monday night at 10 PM EDT (7 PM PDT).  We have a team in India, Visolve, that attends the meeting as well.  We need help working on the UI for items: 18, 19, 20, 21 and 23.  John Williams and Garden State Health Systems have been working on the interoperability pieces which includes generation of CCRs and CCDs but have asked for help with the database connections and UI.

    http://www.openmedsoftware.org/wiki/OpenEMR_Certification

    Jeremy Wallace works with me here in Hickory, NC and will be back from vacation on Tuesday.

    Sam Bowen, MD
    http://openmedsoftware.org

     
  • John Williams

    John Williams - 2010-06-19

    2011 certification of OpenEMR requires two (2) drug coding systems in OpenEMR:  1) either Lexi-Comp or FirstDataBank in an e-prescribing module; and 2) RXNORM in the OpenEMR database.

    RXNORM is clearly defined as a M.U. stage 1 requirement in the Interim Final Rule (row 3 of table 2A on page 79 of http://www.federalregister.gov/OFRUpload/OFRData/2009-31216_PI.pdf )

    The assumption is that the selected e-prescribing drug database vendor provides a mapping to RXNORM.  Can anyone confirm this and/or explain this mapping is done?

    The use of RXNORM is specifically required to code the Medication List ( IFR, page 79, Table 2A, row 3, and meaningful use objective 6) and within the  Patient Summary Record (IFR page 79, Table 2A, row 1)  required for  Meaningful Use Objectives 20, 21, 23 (www.openmedsoftware.org/wiki/OpenEMR_Certification).by the IFR pages 59 and 59.  The Patient Summary Record will also be used in Meaningful use Objectives 18 and 19 (see the OpenEMR Cert Wiki, and IFR pages 56 and 57)

    My firm, Garden State Health Systems is developing a fully coded, 18 section, CCR and CCD Level 3, to provide maximum interoperability of Certified OpenEMR in a) standardas-based health information exchange;  b)  NHIN Direct;  and c)  the HL7 Standards for Privacy Policy and Consent Directives (http://healthit.hhs.gov/portal/server.pt/gateway/PTARGS_0_11673_911865_0_0_18/StP&S_Consent_Directive_Standards_Singureanu051410.ppt)

    For the fully coded, 18 section, CCR and CCD L3, we are nearing completion a detailed requirements definition including analysis of ASTM E 2369-05 (CCR), HITSP C32, C80, C83, and the CDA Release 2 CCD L:evel 3.  (This work is also informed by lessons learned from development of a less-than-fully-coded, six section, CCR and CCD Level 2 in OpenEMR, which are inadequate for the interoperability objectives listed above)

    We seek a  volunteer developer with competancy in OpenEMR user interface and database design to implement the "front end" of the fully coded, 18 section, CCR & CCD L3  described above.  Interested parties may contact  john.b.williams@gmail.com.    

     
  • McAlister

    McAlister - 2010-06-19

    2011 certification of OpenEMR requires two (2) drug coding systems in OpenEMR: 1) either Lexi-Comp or FirstDataBank in an e-prescribing module;

    Really?  By Name?  I'm not sure my vocabulary is adequate to express my disappointment there.  CPT's are bad enough.  Any dataset mandated by law should be curated by a public office and made public domain.


    The assumption is that the selected e-prescribing drug database vendor provides a mapping to RXNORM.

    Every electronic interchange I've done that passed drug information could do so using NDC-11's.  They are essentially barcodes, specifying not just the drug but also the manufacturer and packaging information.  I know RxHub and Surescripts understand them.  And since RxNorm takes the FDA db as a data source I'm assuming they will as well.  First Data Bank definitely provides them because they were our data source.  I'd be shocked if lexi-comp doesn't have them.

    However, the FDA DB was short on packaging data for a lot of the drugs and thus could only construct NDC- 9s.  These still identify *what* the drug is with dosage, strength, active ingredients, etc but doesn't tell you how much per container.  Which, arguably, the doctors office could care less about since they'll have the pharmacist count out however many they prescribe.  And the clearinghouses can map their NDC 11 data to NDC 9s easily enough by dropping the last two digits.  I've never seen a drug coverage plan that discriminated by package size so the case of an NDC9 containing NDC11's that aren't all covered or all rejected is technically possible but exceedingly unlikely.

    I spoke with Tony and he expressed interest in having me do some UI work for CPOE.  What you need sounds like UI work that effects CPOE so I'll get on email.

    -Simone

    * I can't pull up your IFR link.

     
  • Sam Bowen

    Sam Bowen - 2010-06-20

    Dear Simone,

    Please send me your email at

    drbowen@openmedsoftware.org

    We would like to invite you to the Monday night meetings.

    Don't shoot the messenger.  Most of these requirements were created by politicians.  While the Feds are slowly warming up to the idea of open source development, that does not mean that they are excessively friendly or helpful.  Most of these regs are aimed at large proprietary vendors.  The small mammals have to stay "light of foot" to avoid being trampled by the average brontosaurus. (and sshhh, they don't know that brontosaurus has been renamed.)

    Sam Bowen, MD
    http://openmedsoftware.org

     
  • Ram

    Ram - 2010-11-18

    Hi all,

    Just come across this discussion and i've few questions. Hope i'll get some answers here..

    Why 'RxNorm' database will not meet the requirements for the Surescripts implementation?

    Does 'FDA' database provide durg-drug and drug-allery interaction? I guess not…

    General question.. In commercial drug databases, which one is the best? Lexicomp, First Data Bank or Medi-span?

    - Ram

     
  • Mission Arogya

    Mission Arogya - 2012-04-27

    Hi,
    Can anyone please update the status on these works, specifically the drug-drug and/or drug-allergy interaction check in OpenEMR? The good news for our project  in the developing countries are, we can use the US based drug listings as a starting point.
    Here are our specific questions:

    1. Dr. Bowen had mentioned the following - "OpenEMR Support has been working on a drug-drug interaction module that includes drug-drug, drug-food, drug-allergy and drug-disease  interaction checking.  This code is currently being reviewed by ViSolve with the intent of moving the GPL code into OpenEMR in the very near future." – There is  apgae also as following http://open-emr.org/wiki/index.php/Drug_Decision_Support
    Whether this is part of OpenEMR 4.1.0 ? if not, please let us know if this will be available soon and if not, we will like to start to work on this?

    2. There is a mention from John Williams about “2011 certification of OpenEMR requires two (2) drug coding systems in OpenEMR: 1) either Lexi-Comp or FirstDataBank in an e-prescribing module; and 2) RXNORM in the OpenEMR database.” It further mentions that "My firm, Garden State Health Systems is developing a fully coded, 18 section, CCR and CCD Level 3, to provide maximum interoperability of Certified OpenEMR in a) standardas-based health information exchange;  b)  NHIN Direct;  and c)  the HL7 Standards for Privacy Policy and Consent Directives "
    Can we know exactly what drug database has been included  as part of openEMR 4.1.0. We are assuming the Lexi-Comp database is required for the US certification and is not available in the OpenEMR open-source code and is only available via one of the e-prescribing solution. Thus, we are assuming that RxNorm is available and we can follow the step
    http://www.open-emr.org/wiki/index.php/Import_RxNorm_and_SNOMED_Tables to import the RxNorm DB in openEMR. Please confirm.

    3.  What database/drug source is used In the “Prescription” functionality for "Drug Search"? If we follow the RxNorm import as above, whether the “Drug Search” will look up the RxNorm database? If we want to use a country specific database what will be the steps to do this? 

    4. Also, is there any specific reason that the "medication" list is not looking up any drug database such as the one in the "Prescription" area, instead of it is relying on creating an homegrown inventory?  Is it possible to load it with RxNorm database or any other country specific drug database? What will be the steps to do this? 

    5. In the CAMOS module, where the drug lists are populated from?

     
  • Brady Miller

    Brady Miller - 2012-04-27

    Hi,

    1. This code doesn't exist. Now rely on the Rx module (either the allscripts or newcrop) to do this on their end.

    2. No drug database is included in OpenEMR. The RxNorm can be imported by the steps on above wiki link.

    3. The RxNorm database has not been integrated into OpenEMR's prescription module. This is something that needs to be done: http://www.open-emr.org/wiki/index.php/Active_Projects#Integrate_RXNorm
    To use alternative databases should not be too difficult to support. Suggest using a mechanism akin to what is used for supporting different coding structures in the of the custom/code_types.inc.php script.

    4. The medication module and prescription module need to be integrated: http://www.open-emr.org/wiki/index.php/Active_Projects#Integrate_medications_and_prescriptions
    (after integrating, then would be straightforward to use the mechanisms created in 3. above)

    5. CAMOS data (including meds) are populated from here:
    interface/forms/CAMOS/table.sql

    -brady
    OpenEMR

     

Log in to post a comment.