I have a form that was built by someone else, and it does have some wonderful functionality, but one thing that it does that is driving our providers crazy is translating "Dr. John Smith Md" when the providers would like for it to translate "Dr. John Smith" and I'm not sure how to correct the syntax of the code for this. Any suggestions would be most appreciated. The code is currently written as follows:
{
local temp = ""
local temp2 = ""
local who = ""
cond
case DOCUMENT.ASKCONSULT_DOC <> ""
who = fnCaseStr(DOCUMENT.ASKCONSULT_DOC,"Title")
case PATIENT.REFMDLASTNAME <> ""
who = fnCaseStr(PATIENT.REFMDLASTNAME,"Title")
case PATIENT.PCP <> ""
who = PCP_NAME("Last",FALSE)
endcond
if (who <> "" and match(tolower(who),"dr.") == 0 and match(tolower(who),"doctor") == 0) then
who = "Dr. " + who
endif
There is probably a more efficient way to do this but we would need to see the other functions that your code is calling. You can try adding this to to bottom of the code you posted:
local strsize = size(who)
who = remove(who,strsize-2,2)
This should remove the last two characters from your string or the MD.
Brad
Thank you so much, I will try this.
As it ended up - the form was actually working correctly. The problem was how the users have been entering the provider name in the referring provider tables. Once that was fixed, the form was translating exactly as it should.