bradymiller wrote on Thursday, July 09, 2009:
Hey,
Now working on the drugs/prescriptions lists and migration with the drug module and openemr’ prescriptions. Just wanted to get confirmation on the plan to deal with the upgrade sql script.
There are two bugs with the current drug lists, which were discussed above. The gram-microgram bug is nasty because if you choose grams in the drug module it then shows up in prescriptions as mcg and vice versa. So here are proposed fixes to the upgrade sql script:
UPDATE list_options SET option_id = ‘6’ WHERE option_id = ’ 6’ and list_id = ‘drug_route’;
UPDATE list_options SET title = ‘mcg’ WHERE option_id = ‘7’ and list_id = ‘drug_units’;
UPDATE list_options SET title = ‘grams’ WHERE option_id = ‘8’ and list_id = ‘drug_units’;
The following will be added to the upgrade script to add missing items (including blanks):
INSERT INTO list_options VALUES (‘drug_form’,‘0’,’’ , 0,0,0);
INSERT INTO list_options VALUES (‘drug_form’,‘10’,‘cream’ ,10,0,0);
INSERT INTO list_options VALUES (‘drug_form’,‘11’,‘ointment’ ,11,0,0);
INSERT INTO list_options VALUES (‘drug_units’,‘0’,’’ , 0,0,0);
INSERT INTO list_options VALUES (‘drug_route’, ‘0’,’’ , 0,0,0);
INSERT INTO list_options VALUES (‘drug_route’,‘13’,‘Both Ears’,13,0,0);
INSERT INTO list_options VALUES (‘drug_route’,‘14’,‘Left Ear’ ,14,0,0);
INSERT INTO list_options VALUES (‘drug_route’,‘15’,‘Right Ear’,15,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘0’,’’ , 0,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘10’,‘a.c.’ ,10,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘11’,‘p.c.’ ,11,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘12’,‘a.m.’ ,12,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘13’,‘p.m.’ ,13,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘14’,‘ante’ ,14,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘15’,‘h’ ,15,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘16’,‘h.s.’ ,16,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘17’,‘p.r.n.’,17,0,0);
INSERT INTO list_options VALUES (‘drug_interval’,‘18’,‘stat’ ,18,0,0);
Should I be surrounding these by anything the upgrade script to ensure don’t overwrite (possibly create items with identical id’s also) an upgraders customized values (these shouldn’t be very customized anyways since these are being used in drug module and required to be consistent with prescriptions values which are hard-coded (the hard-coding is soon to be a thing of the past hopefully).
At this point, I’m done integrating changes into drug module (about 11 files modified), and now working on integrating this into the prescription stuff.
-brady