Drugref 2 Prescribing Database
Drugref is OSCAR’s drug database service.
The drug list is abstracted from Health Canada’s Drug Product Database on an “as is” basis. While the OSCAR Deb updates drugref quarterly, you can update anytime.
Document Version History
- v1.0 – Initial instructions – Mar 1, 2023
- v1.1 – Instructions including suggestions for scripting updates – Dec 14, 2024
Documentation Copyright © 2023-2024 by Peter Hutten-Czapski MD under the Creative Commons Attribution-Share Alike 4.0 Unported License
Updating Drugref
Simply navigate to Administration > Integration > Update Drugref
Click on the “Update Drugref” button and wait up to an hour. You will be able to renew existing drugs during this period. At some point you will temporarily loose the ability to Rx new ones from the drop down search.
TIPS
- Health Canada’s Drug Product Database is updated at the beginning of each month (although not always the first of the month), more frequent updates are not useful.
- Drugref will handle most drug safety tweaks however the full set can be invoked using mysql -uroot -p****** drugref < /usr/share/oscar-emr/tallMANdrugref.sql
- Drugref can be directly updated with a script
- If Drugref Update fails you will loose all the data that allows you to make a new Rx, you will only be able to renew. You can recover with mysql -uroot -p****** drugref < /usr/share/oscar-emr/drugref.sql
SCRIPT
For a cronjob you can create an executable drugrefUpdate.cron in the usual fashion
#!/bin/bash
#
# drugrefUpdate.cron
# a script designed to be triggered by a monthly cron job to update drugref
# with the current months Health Canada DPD release
if [ -f /usr/share/tomcat9/bin/version.sh ] ; then
TOMCAT=tomcat9
else
if [ -f /usr/share/tomcat8/bin/version.sh ] ; then
TOMCAT=tomcat8
else
if [ -f /usr/share/tomcat7/bin/version.sh ] ; then
TOMCAT=tomcat7
fi
fi
fi
CATALINA_HOME=/usr/share/${TOMCAT} PROPFILE=$CATALINA_HOME/oscar.properties
db_password="${db_password:-$(sed '/^\#/d' $PROPFILE | grep 'db_password' | tail -n 1 | cut -d "=" -f2- | sed 's/^[[:space:]]*//;s/[[:space:]]*$//')}"
wget --no-check-certificate https://localhost:8443/drugref/Update.jsp && mysql -uroot -p${db_password} drugref < /usr/share/oscar-emr/tallMANdrugref.sql
Manual Updates
Drugref can be directly updated with your browser invoking https://localhost:8443/drugref/Update.jsp. You will have to wait until drugref is updated (up to an hour) before the page will load, but when it does it will show you the current state of your updated database
Update Drugref Database!
Table Name | Number of Rows |
---|---|
CdTherapeuticClass | 42649 |
CdPackaging | 39146 |
CdDrugProduct | 38561 |
CdSchedule | 43711 |
LinkGenericBrand | 38561 |
CdForm | 47588 |
CdPharmaceuticalStd | 22133 |
CdDrugSearch | 78810 |
CdRoute | 48595 |
CdActiveIngredients | 96261 |
CdInactiveProducts | 65609 |
Interactions | 3872 |
CdCompanies | 43433 |
CdDrugStatus | 124054 |
CdVeterinarySpecies | 4875 |
Time spent on importing data: 34 minutes
Time spent on new generic import: 3 minutes
Added Descriptor and Strength
Number of drug names being added descriptor: 1699
Number of drug names being added strength: 17662