I would like to display ONLY the medications a patient is taking for hypertension. Can anyone help?
I know CPS can do a search along the same lines, so it must recognize categories of meds on some level? - ie, I can run an inquiry on patients where Medication Code, active (Classification Lookup) is Antihypertensives.
Also, CCC-CPOE form does it when you push "add template" to the assessment of HTN. I just want the same list of meds displayed in another place in another form.
Obviously creating a list of every single HTN medication and writing MEL to cover all of those is always an option, (but also obviously not a good one as meds change).
Thanks so much for your help!
The way I pull this off in my forms is to use the GPI code in MEDS_AFTER("delimited"). The GPI is the hierarchy of medications and contain groups like antihypertensives, antidepressants, antipsychotics, etc. For your case, antihypertensives all have a GPI that start with 37. Here is a list of Drug groups and classes and their GPI starting number.
You can also take this a step further and pull out specific medications by narrowing down your GPI number to a certain type of drug. If you need the code to do this on your form let me know.
Awesome, thanks!
We are doing diabetes meds, HTN meds, and cholesterol meds.
Thanks !
BJ
If you wouldn't mind sharing the MEL code, that would be great! Thanks again!
BJ
In the function below, you send it the beginning numbers of the GPI followed by how many numbers you sent it. So, GetMedsByClass("37", 2) would give you all the antihypertensive meds the patient is on or "None" if it didn't find any. You can also send it like GetMedsByClass("37", 2, MED_LIST_CHANGES()) if you want it to update every time their are changes in medications. I use it like this for when I put it in data display windows.
{fn GetMedsByClass(med_class, num, update) { local rets = "" local meds_array = getfield(MEDS_AFTER("delimited"), "|", "") for i = 1, i <= size(meds_array), i = i + 1 do local med_array = getfield(meds_array[i], "^", "") if (ok(med_array[4])) then if (med_array[4] <> "") then if (sub(med_array[4], 1, num) == med_class) then rets = rets + med_array[1] + HRET else continue endif else continue endif else continue endif endfor if (rets == "") then rets = "None" endif return rets }}
I have not really dealt with MEL but we are trying to do the same but we are trying to do this on a History View. Will this command work there to? Or can this only be used when building forms?
Yeah, it can be used there too. Just call it after you put the function in like so:
{fn GetMedsByClass(med_class, num, update) { local rets = "" local meds_array = getfield(MEDS_AFTER("delimited"), "|", "") for i = 1, i <= size(meds_array), i = i + 1 do local med_array = getfield(meds_array[i], "^", "") if (ok(med_array[4])) then if (med_array[4] <> "") then if (sub(med_array[4], 1, num) == med_class) then rets = rets + med_array[1] + HRET else continue endif else continue endif else continue endif endfor if (rets == "") then rets = "None" endif return rets }}{FMT("Antihypertensive Medications", "B,U,2") + HRET +FMT(GetMedsByClass("37", 2), "")}
Can you also use this when building handouts?
Yes, this will work for letters and handouts as well.
If I want to use multiple GPI #'s for hypertension would I do the following:
}}{FMT("Antihypertensive Medications", "B,U,2") + HRET +FMT(GetMedsByClass("37","36","39", 2), "")}
No. I'd have to modify the function to be called like that. To pull that off you would have to call it like
{GetMedsByClass("37", 2)
GetMedsByClass("36", 2)
GetMedsByClass("39", 2)}