I have a physician that through different form changes has used "Instructions" and "Plan" inside of his Assess/Plan page. He wants to pull previous with quicktext. I need to know if there is a way that I can pull a previous with an if then that will pull the most recent.
He was using plan, then using instructions, and is not using plan again. I have a obsprev plan going on right now but they want to capture the one that was entered as instructions as well. DOcument the most recent plan and edit it based on this visit.
We use this quite a bit - see it if works for you. "height"=obs term you want to replace.
{if obsprev("Height") <> "" then "Height: "+obsprev("height")+" inches \n\r" else "" endif}
It sounds like you need to use DURATIONDAYS to test which one is most recent.
{cond
case OBSPREV("PLAN") <> "" AND OBSPREV("INSTRUCTIONS") <>""
if DURATIONDAYS(LAST_SIGNED_OBS_DATE("INSTRUCTIONS"),LAST_SIGNED_OBS_DATE("PLAN")) > 0 then
OBSPREV("PLAN")
else
OBSPREV("INSTRUCTIONS")
endif
case OBSPREV("PLAN") <> "" AND OBSPREV("INSTRUCTIONS") ==""
OBSPREV("PLAN")
case OBSPREV("PLAN") == "" AND OBSPREV("INSTRUCTIONS") <> ""
OBSPREV("INSTRUCTIONS")
else
""
endcond}
Stick that in a quicktext and it should pull in the last signed obs term of either PLAN or INSTRUCTIONS, depending on which one is more recent. I tested it with some other obs terms and it worked. Please follow up with me if you encounter any issues or have questions.