Does anyone know how to determine either the loginname or the job title of the responsible provider for a document? The only function I can find that returns job title directly is USER_JOBTITLE() but this works only for the currently logged-in user.
The function GETUSERINFO(loginname) will provide the job title but you need the login name of the responsible provider. According to the documentation in the help file, both DOCUMENT.PROVIDER and DOCUMENT.RESPONSIBLE are supposed to return the loginname of the responsible provider, but they both return the "REALNAME" (e.g. Harry Winston) instead of the login name. Is there some other function that returns the actual login name for the DOCUMENT.PROVIDER?
I can't seem to find any other way to do this other than using the GET_USER_LIST function but this seems unnecessarily complicated and indirect.
This is for CPS but I'm pretty sure it works in EMR too, it will find the provider loginname, then you can look up anything you want. You could also use another find to lookup the jobtitle but I dont have the code for that handy.
find("_UserSearch","loginname","RealName",document.provider)
Do you have documentation of the find() function? It isn't in the CEMR help file. I tried it in a form and it didn't produce any output. Perhaps it is only a CPS function.
Below, I did a write up a long time ago here it might also be useful.
find
description Gets a value out of an object. type MEL utility function syntax find(object, field [,key] [,key_value]) arguments
returns The value of field comment The four-argument version is useful for searching objects with more than one row. Single-row objects can use the two-argument format. Note that the current row in either case is not disturbed. Objects and their fields are described in text files named MLDEFS*.TXT in the EMR directory. example find("patient", "lastname") returns Smith find("Group","GID","groupname","Cardiology") This example returns the GID value (100) from the object named Group where the groupname is cardiology. where used Encounter Form Editor: MEL expressions |
THANK YOU!!!
On a hunch, I tried using the str() function to the result of find() and it worked. So, the function call I used was "str(find("_UserSearch","loginname","RealName",document.provider))" and that did return the login name of the responsible user.
This seems odd because it suggests that the result returned by the function is an array, but it seems to consist of only a single token.
I noticed that the function definition includes a reference to MLDEFS*.TXT which are included with the single user EMR.