I have done this before but for some reason I can't get this one to work. I am trying to add the type of procedure then the verbiage Prior Authorization. This is what I have, copied from what works in other forms, but not working now:
{!
IF OBSNOW("TYP OF PROC") == "" AND match(DOCUMENT.SUMMARY,"-Prior Authorization") == 0 THEN
ADD_DOCUMENT_SUMMARY(OBSNOW("TYP OF PROC")"-Prior Authorization")
ELSE ""
ENDIF
}
Any insight would be greatly appreciated.
Laurie
It looks like you are missing a plus sign between your obs term and prior authorization text. Otherwise, the syntax looks correct to me. This code will add "-Prior Aurthorization" to the summary if TYP OF PROC has nothing in it and the summary doesn't contain -Prior Authorization already.
{!
IF OBSNOW("TYP OF PROC") == "" AND match(DOCUMENT.SUMMARY,"-Prior Authorization") == 0 THEN
ADD_DOCUMENT_SUMMARY(OBSNOW("TYP OF PROC") + "-Prior Authorization")
ELSE "" ENDIF
}
Thanks Mike. Unfortunately it only produces - Prior Authorization in the summary, not the name of the procedure.
That is because you are checking if the obsterm "TYPE OF PROC" is blank, and only running the code if that is true. change the IF statement to IF OBSNOW("TYP OF PROC") <> "" AND match(DOCUMENT.SUMMARY,"-Prior Authorization") == 0 THEN
That should solve your issue
Thanks D. Changing it to what you posted did not resolve the issue. It actually took out the verbiage of -Prior Authorization.
Laurie
Yes, this is because no text was entered into the obs term for OBSNOW("TYP OF PROC").
I do not know where you are trying to use this code. if you are in a live document, where a user can type in a text field to populate the obsterm, the code above will only run if something is typed into the field.
If you are running this code in a letter or handout, you will want to use OBSPREV, for previouily entered info. Could you give us more info on where this code is running, and where you expect it to be used at?
Thank you,
d carpenter thank you for your help. It would have helped if I had imported the clinical kit after I made the change! Once I imported and tested it, it worked fine. Sometimes I don't know if I am coming or going.
Thanks again.
Laurie