We have providers using a quick text called .myhpi with the symbol language of {LASTOBSVALUEBYUSER("HPI")}
I have a surgeon now who is working with a NP and the NP will need to pull in the providers specific HPI while prepping the patient. What language could I use to accomplish this? View prior HPI does not work in this scenario as the patient see's multiple providers within the database. The above quick text only works if the provider pulls it in himself.
Any help would be greatly appreciated!
Thanks,
Sirna
Only other thing I can think of is using something like this form: HPI at the bottom you will notice a data display that allows users to basically surf through all the recorded hpi
I am only able to see the language used on the form, not the form itself. Could you post a screenshot of the form?
Without getting fancy writing a function to look at an mldef file object, I would give them a quick text that called a USEROK box calling LISTOBSVALUEBYLOC("HPI"). That would give them all the HPI's from the current location of the document. There is also a LASTOBSVALUEBYLOC if you could be sure that the last time the HPI was filled out in that location of care was the one they would be looking for.
David this is perfect! Thank you very much!!
Hey David,
Another question...Have you ever built language to pull in an HPI from a specified date? I would think there are way to many variables to accomplish this, but wanted to check with you first.
Thank you again!
Sirna
Here is some code for a function I copied from CHUG (sorry, didn't get the original author) that I had in my "Code Library". It looks for the last observation value entered by a particular users. Where you see [5], that is username. The date would be [2] (look at the help for LIST_OBS. You could modify this and pass in your date rather than a username to find what you are looking for:
fn LastObsValueForUser (obsname,usrname){
// This function retrieves the last signed observation value
// signed in a document by the specified user
// ASSUMPTION: values are always ordered by Obsdate decending
// List_Obs is based on ViewPencilObs (mldefs7.txt) which is currently sorted
// by date but not guaranteed to remain that way
local aObsdata =
getfield(List_Obs(obsname,'Signed','Delimited','value'),"|","")
local aThisObs
local result=""
for i=1, i <= size(aObsdata), i=i+1
do
aThisObs = getfield(aObsdata[i],"^","")
//skip any value not from this LOC
if aThisObs[5] <> usrname then result = "" else
if aThisObs[5] == usrname then result = aThisObs[1] break
endif
endif
endfor
return result}
Do you think the function above should use aThisObs[4] - signing user, instead of aThisObs[5] - entering user ?
The function requires you to pass the user you are looking for so it depends on your work flow I guess.
Yay, our developer fixed the code formatting problem. If you use the code tags when creating your post (use the TEXT tab rather than the VISUAL tab) it will keep your formatting.
Might have to refresh to see it.