Got this change request:
"Want to add some kind of “pop-up” or alert that comes up when a scheduled drug is added to the med list that alerts the prescriber to have the patient sign a controlled drug contract."
I don't know of a way to do that. I've looked at some Medication and eRx tables and don't see where that kind of info would be, much less if there is something in the mldefs files that would let us look for it.
Anyone have any ideas?
Thanks,
David Shower
OU Tulsa School of Community Medicine
In case you are still looking for information:
I had to generate a list of Schedule II meds - among other types - and used the GPI codes to do so. I started with Dr Nelsen's list and then got the other GPI codes I needed from the MEDINFO table, CLASSCODE and GPI fields.
Here’s the documentation for ClassCode
CLASSCODE - Represents the Controlled Substance or DEA class code, also known as "Schedule".
1 No accepted medical use
2 High abuse potential
3 Moderate abuse potential
4 Limited abuse potential
5 Limited abuse potential, small amounts
Blank Undetermined or not applicable
I wrote a couple of functions to run through MEDS_AFTER to parse and process the list. I've included the relevant code below, but removed the implementation specific code from ProcessMedicationChanges(). This should give you an overview of what worked for us. Contact me if you have questions.
Joan Nordberg
Boston Health Care for the Homeless Program
{
fn ProcessMedicationChanges()
{
local i = 0
local curMedTotal = 0
local curMeds = ""
local medType = ""
curMeds = getfield(MEDS_AFTER("delimited"), "|","")
if str(curMeds) <> "" then
curMedTotal = size(curMeds)
endif
for i = 1, i <= curMedTotal, i = i+1 do
curMeds[i] = getfield(curMeds[i],"^","")
endfor
for i = 1, i <= curMedTotal, i = i+1 do
medType = GetMedType(str(curMeds[i][4]))
/*code for processing medType */
endfor
}
}
{
fn GetMedType( sGPIcode)
{
local medType = ""
medType = IsSchedule2Med(sGPICode)
if medType == "" then
medType = IsBenzoMed(sGPICode)
endif
if medType == "" then
medType = "Other"
endif
return medType
}
}
{
fn IsSchedule2Med(sGPIcode)
{
local medSched2 = ""
local gCode = val(sGPIcode)
/*check if within a Schedule 2 GPI range */
if (gCode >= 43101005102900 and gCode <= 43101005103800) or
(gCode >= 47100030201505 and gCode <= 47100030201510) or
(gCode >= 49109902155210 and gCode <= 49109902155220) or
(gCode == 50300040000110) or
(gCode == 60100010102110) or
(gCode >= 60100055102010 and gCode <= 60100055102900) or
(gCode == 60100070100110) or
(gCode >= 61100020100305 and gCode <= 61109902107030) or
(gCode >= 61400016100320 and gCode <= 61400020107040) or
(gCode >= 65100015002210 and gCode <= 65100080107440) or
(gCode >= 65100087102110 and gCode <= 65100091100340) or
(gCode >= 65990002200120 and gCode <= 65990002600320) or
(gCode >= 65991503302020 and gCode <= 65991503352068) or
(gCode >= 65991803302020 and gCode <= 65991803302030) or
(gCode >= 90850030002010 and gCode <= 90850030002900) or
(gCode == 96485075102900) or
(gCode == 96485841502900) or
(gCode == 96645072752900) or
(gCode == 96665070102900) or
(gCode == 96788222102900) then
""
medSched2 = "Sched2"
/*userok("found S2: " + sGPIcode)*/
endif
return medSched2
}
}
{
fn IsBenzoMed(sGPIcode)
{
local medBenzo = ""
local gCode = val(sGPIcode)
/*check if within a benzo GPI range */
if (gCode >= 57100010000305 and gCode <= 57100070000310) or
(gCode >= 57999002106320 and gCode <= 57999002106330) or
(gCode == 57999002206320) or
(gCode >= 60201005000310 and gCode <= 60201040100310) or
(gCode >= 62992002200310 and gCode <= 62992002200320) or
(gCode >= 72100010000305 and gCode <= 72100030004060) or
(gCode == 96426448542900) or
(gCode == 96485803002900) or
(gCode == 96647076002900) then
""
medBenzo = "Benzo"
/*userok("found Benzo: " + sGPIcode)*/
endif
return medBenzo
}
}