I have this function that I use to list all active users at a specific location...how can I change this to only look at the role of physician?
{fn dd_list_users_by_loc(loc)
{
local get_loc_abbrev = getfield(loc, "(", "")
local loc_abbrev
local uname
local result = ""
local final_result = ""
local formatted_list = ""
local alpha_list=""
/*get location of care abbbreviation from the location list drop down*/
if loc <> ""
then loc_abbrev = sub(get_loc_abbrev[2], 1, size(get_loc_abbrev[2])-1)
endif
/*get the delimited user list using the location abbreviation*/
local user_list = getfield(get_user_list(loc_abbrev, "", "delimited"), "|", "")
for
count=1, count<=size(user_list), count=count+1
do
uname=getfield(user_list[count], "^", "")
if result <> "" then result = result + "|" + uname[2]
else result = uname[2]
endif
endfor
/*stip out any commas in user names*/
if result <> "" then final_result= replacestr(result, ",", "") else "" endif
/*put commas back in where pipes were for the drop down*/
if final_result <> ""
then formatted_list = "," + replacestr(final_result, "|", ",") else ""
endif
alpha_list=str(sort(getfield(formatted_list, ",", ""), TRUE))
return alpha_list}
}
Any help would be appreciated.
Try changing this:
local user_list = getfield(get_user_list(loc_abbrev, "", "delimited"), "|", "")
To this:
local user_list = getfield(get_user_list(loc_abbrev, "Physician", "delimited"), "|", "")
Thank you!!!