I need to be able to translate LISTASSESSNEW without the signing provider. Our providers don't want to see their name next to all of the assessments. Can someone help me with the code to accomplish this?
Are you trying to do this in an update or after the update is signed? Here is some code I did for a handout to show the assessments from the most recent visit:
{fn get_last_assessments() { local aPD,cPD,ePD ePD = 0 local iPD = getRowCount('Assessments') while iPD > 0 do iPD = iPD-1 aPD = getRow('Assessments',iPD,'SDID') cPD=aPD if cPD > ePD then ePD =cPD 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 else "" endif endwhile if cP=="" then return "None entered" else "" endif return str(cP) }}
{get_last_assessments()}
{fn get_prob_from_sprid(passedsprid) { passedsprid = replacestr(passedsprid,".00","") local aSP, cSP local iSP = getRowCount('_MasterProb') while iSP > 0 do iSP = iSP-1 aSP = getRow('_MasterProb',iSP,'SPRID','DESCRIPTION') if aSP[1] = passedsprid then cSP=aSP[2] else "" endif endwhile return cSP }}
David, I am trying to do this in an update itself.
Well, if you are doing it in the update itself, you will need to do something like
DOCUMENT.ASSESSMENTS = replacestr(LISTASSESSNEW("full"),USER.REALNAME,"")
Not sure if it will work but the premise is to replace the providers name with a blank. Might even try "- "+USER.REALNAME if there really is a dash and a space before the name.
Well, that is close to what I am currently doing, and it works most of the time, however for some reason it is not replacing the name all of the time. Here is what I have:
{cfmt(fnReplStr_LC(LISTASSESSNEW(),USER.REALNAME, ""), "", "Status of Existing Problems:", "B,1", "")}
{! fn fnReplStr_LC(strBuf, strTarget, strReplacement)
{
local nMatch = match(strBuf, strTarget)
while (nMatch > 0) do
strBuf = remove(strBuf, nMatch, size(strTarget))
strBuf = insert(strBuf, nMatch, strReplacement)
nMatch = match(strBuf, nMatch + size(strReplacement), strTarget)
endwhile
return (strBuf)
}
In your while statements, I'm not sure why you even do the insert - I don't think that is actually accomplishing anything. And I'm not sure your resetting the nMatch value needs to be any different than where you first set nMatch. Let's say nMatch starts with a value of 30 and your provider name size is 20. That statement says match the new strBuff beginning 50 spaces in. You could actually start looking past or inside the next provider name in some cases I would think.
Have you looked at a trace file to see what is happening when it doesn't remove the name correctly?
I have not done a tracefile, because it is so random I never know when it is going to happen. I actually got that code from these forums and modified it a little. I may just try the replacestr without the function and see if that helps.