Has anyone seen or created a function to return all the patient's pharmacies? REGPHARMACY() only pulls back the first pharmacy alphabetically from the patient's contacts. I'd like to use this on the Clinical Visit Summary handout.
Thanks,
David
OU-Tulsa
David,
I think I've done this but don't have time to find the mel just now, but I recall that you can get it from the Businees object or table. there's a 'Pharmacies' object in the Business table (mldefs8) and you may be able to get started with something like this. I'll try to find the code and post later.
if getrow("Business",n, "ISPHARMACY") == "Y"
Came up with this and it seems to work - thanks for the idea! I'd still like to see what you have if you find it.
{fn get_pharmacies()
{local a,c
local i = getRowCount('Business')
// Loop thru patients meds
while i > 0 do
i = i-1
a = getRow('Business',i,'searchName','Address1','Address2','City','State','Zip','primPhone','ISPHARMACY')
if a[1] <> "" and a[8] ="Y" then c=c+"|" + a[1] + " - " + a[2] + "" + a[3] + " " + a[4] + ", " + a[5] + " " + a[6] + " " + a[7] + HRET else "" endif
endwhile
if c=="" then return "None entered" else "" endif
local result=sort(getfield(c,"|",""))
local arr_size=size(result)
for a=1, a<arr_size, a=a+1
do
if result[a]==result[a+1] then remove(result,a+1) arr_size=arr_size-1 else "" endif
endfor
local result1 = str(result)
result1 = replacestr(result1,","," ")
return str(result1)
}}
{get_pharmacies()}
Does this work in the Data display of a form?
If so can you send me a screen shot or the .dlg file
I am building a phone note and would love to display the patients pharmacies and addresses so that the phone staff can verifiy.
thanks
Verline Price RN BSN
Have the same question about trying to pull a complete pharmacy list.
I've tried this function but results are always "none entered" even when there are pharmacies saved to the patients chart. Is there anything special needed to access the table 'business'?
Any suggestions would be appreciated.
I would be interested in this as well so we could pull it in as a data display on the phone note. If you could send the mel or dlg file it would be greatly appreciated!!
Thanks
Christal
There seems to be a bug in that you have to go to the patient's registration tab before this will work in some instances. I believe it is a known issue with GE.