Updating DrugRef problem – solved

A client asked me to add a few new medications to their Oscar drugref database.
Sounded easy enough. There is an Admin function for that: Update DrugRef.

I checked on a more recent installation and the new medications were listed. (Neupro).

They were originally setup with v10 and are now running v12.1 build tag: Oscar12_1-3.1general169

I ran the Admin, Update Drugref, assuming that the program would download the latest Health Canada database and update the Oscar drugref database.

Unfortunately, the result was complete deletion of all data in the drugref database and zero meds.

The solution: I updated the DPDImport.class that contains the URL of the DrugRef database.

It can be found in:
/var/lib/tomcat6/webapps/drugref/WEB-INF/classes/org/drugref/ca/dpd/fetch/DPDImport.class

I just replaced the file with a more recent version and re-ran the DrugRef update.

It seems that the location of the file has changed from:
http://www.hc-sc.gc.ca/dhp-mps/prodpharma/databasdon/txt/allfiles.zip

to:
http://www.hc-sc.gc.ca/dhp-mps/alt_formats/zip/prodpharma/databasdon/allfiles.zip

I don’t know when the Health Canada database was moved, but if you have the same problem and your version of Oscar is from about July/August 2013, you may have the same problem.

You can confirm the problem by examining the DPDImport.class file.

The URL can be located within the file and checked. If it is pointing to the old location, then you have the same potential problem. An Admin user can do the update and erase all the medications.

More information on the Health Canada database at:
http://www.hc-sc.gc.ca/dhp-mps/prodpharma/databasdon/dpd_bdpp_data_extract-eng.php