Providers want to include previous HPI and CPOE assessments that they entered. There might be HPI from other providers in the same obs term. I am thinking about using a quick text and pull the obsvalue from List_Obs for the user that is logged in. Are there better solutions? also would this work for assessment in CPOE.
Depending on your users workflow, LASTOBSVALUEBYUSER might be helpful to you here and simpler. From the Centricity help file:
LASTOBSVALUEBYUSER
description Returns the last observation value signed by the currently logged in user for the specified observation term type Data symbol function syntax LASTOBSVALUEBYUSER(‘obsname’) arguments The name of the observation term for which you would like data returned when to evaluate When inserted in the chart note or continuously returns Returns the last observation value signed by the currently logged in user for the specified observation term example {LASTOBSVALUEBYUSER(‘Height’)} Returns the last height observation value signed by the currently logged in user. 69 |
awesome thank you bhoover. beats writing a new function.
is there something similar for assessments?
Here's a demo form I had in my code library on pulling assessments:
And here is a function I have to pull assessments by user. You can try this and modify it:
{fn get_last_assessments_ForCurrentUser()
{
local aPD,cPD,ePD,strAssessedBy
ePD = 0
local iPD = getRowCount('Assessments')
while iPD > 0 do
iPD = iPD-1
aPD = getRow('Assessments',iPD,'SDID')
strAssessedBy = find("_UserSearch","LoginName","PVID",getRow('Assessments',iPD,'USRID'))
if USER.LOGINNAME == strAssessedBy then
cPD=aPD
if cPD > ePD then
ePD =cPD
else
""
endif
else
""
endif
endwhile
local aP,cP
cP = fmt("Problems discussed at your last visit:","B") + HRET
local iP = getRowCount('Assessments')
while iP > 0 do
iP = iP-1
aP = getRow('Assessments',iP,'SDID','ANNOTATE','SPRID')
if aP[1] = ePD then
/* cP=cP + get_prob_from_sprid(aP[3]) + HRET + "Assessment: " + aP[2] + HRET */
cP=cP + find("_MasterProb", "Description","SPRID",aP[3]) + HRET + "Assessment: " + aP[2] + HRET
else
""
endif
endwhile
if cP=="" then return "None entered" else "" endif
return str(cP)
}}
{get_last_assessments_ForCurrentUser()}
Thank you David. I was planning to loop over LIST_ASSESSMENTS to find the user in question and return the last assessment by the user.
However, what you are doing here is very interesting. I cannot find getRow and getRowCount in the list of pre-defined function in Centricity. Also you are referring to SPRID and SDID. I did not know we could access those fields straight from the database.
Yes, the getrow stuff is what you learn by reading the CHUG boards for years and looking at the CCC files in the client directory and reading how they write their functions/code. Those database fields are accessible when you use the objects in the mldef text files located in the root of the client installs. These are being accessed from the _MasterProb object in the mldefs2.txt file.