I am wanting to write a code that would have a set of nested useryesno prompts. Basically, if the answer to the first useryesno is "yes" then I want it to trigger another useryesno. Does anyone if this is possible. Thanks!
if useryesno("...") == "Yes" then
if useryesno("....") == "Yes" then
...
else "" endif
else "" endif
Thanks! That's close to what I was doing but I couldn't get it to work. This is what I have and now.
{!IF(DOCUMENT.NEW_MED_HIST "") and (DOCUMENT.NEW_DIAB == "") THEN
DOCUMENT.NEW_DIAB == "Done" AND IF useryesno("Is patient diabetic?") == "Yes" THEN
IF useryesno("Is patient insulin depedent?") == "Yes" THEN
"Patient needs scheduled as first surgery of the day."
ELSE "Patient needs scheduled in the A.M." ENDIF
ELSE "No diabetic scheduling criteria required." ENDIF ENDIF}
The first prompt comes up and if they select "yes" then the second prompt comes up. At that point no matter they select the prompt goes away but they are never shown the alert message.
F(DOCUMENT.NEW_MED_HIST "") - you are missing operator ==
DOCUMENT.NEW_DIAB == "Done" AND IF useryesno("Is patient diabetic?") == "Yes" THEN
probably dont need AND here
I find that the MEL CASE statements are easier for this sort of thing.
Note: The editor will not let me save the code indentation for some reason. When indented properly it becomes much easier to follow..
For example:
local a
local b
local c
a= useryesno("First Question")
cond
case a == "No"
b = useryesno("Don't tell me NO for an answer!")
cond
case b == "No"
c = useryesno("Do you like money?")
cond
case c == "Yes"
userok("Finally!")
case c == "No"
userok("ID 10 T Error!")
endcond
case b == "Yes"
userok("Thanks for reconcidering")
endcond
case a == "Yes"
userok("You'd better answer yes...")
endcond