Does anyone have a function written that can insert the names of all staff with the word nurse in their job title? I am trying to use the GET_USER_LIST() function but can't seem to get it right. Thanks!
This should get you started. it will return a comma separated string of users with Job Title. I modified another function I had and did not test this. I think the Job Title may be a numerical reference to Job titles in the system. Use the output to determine how you can filter on Job Title.
{!fn User_List(){
/* builds array of users from _UserSearch */
Local lstringname, lloginname, luserName, luserStatus, luserSpecialty, luserJob, luserPvid,
luserHomeloc,luserSpecialtyName
Local pCounter
Local result=""
Local i = getRowCount('_Usersearch')
For pCounter = 0, pCounter< i, pCounter = pCounter + 1
Do
lusername = getRow('_Usersearch',pCounter,'FirstName') + " " + getRow('_Usersearch',pCounter,'LastName')
lstringname = ReplaceStr(lusername, ",", ";")
luserHomeloc = getRow('_Usersearch',pCounter,'HomeLocation')
luserPvid = getRow('_Usersearch',pCounter,'PVID')
luserStatus = getRow('_Usersearch',pCounter,'Status')
luserSpecialty = getRow('_Usersearch',pCounter,'Specialty')
luserJob = getRow('_Usersearch',pCounter,'JobTitle')
lloginname = getRow('_Usersearch',pCounter,'loginname')
luserSpecialtyName = find('SpecialtyTypes','Description','SPID',luserSpecialty)
luserNPI = getRow('_Usersearch',pCounter,'NPI')
IF result="" Then
result = lstringname + " (JobTitle:" + str(luserJob) + ")"
ElSE
result = result + "," + lstringname + " (JobTitle:" + str(luserJob) + ")"
ENDIF
Endfor
Return result
}}