I'm working on a VFE form where I would like the data to populate and be editable if the date of the last entry in the obs term was within the previous 90 days. (I want it set up this way in case a person has more than one procedure scheduled).
Here's what I've got so far (see attached .dlg). I need everything to store in obs terms. I've tried using duration days but it's not pushing the value to the field in case in needs to be edited. Is there a way to do it through the "Set Values" feature in VFE?
Any tips would be appreciated!
Happy St. Patrick's Day!
Natalie
Hello,
I looked in the button and I think this is the bit of code you are referring to (please correct me if I'm wrong):
//Proposed Surgery
{
if (DURATIONDAYS(LASTOBSDATE("TYP OF PROC"),STR(._TODAYSDATE))<90)
THEN OBSNOW("TYP OF PROC") = OBSPREV("TYP OF PROC")
else "" endif
}
I changed the syntax for updating the obsnow.
Give this a try:
//Proposed Surgery
{
if (DURATIONDAYS(LASTOBSDATE("TYP OF PROC"),STR(._TODAYSDATE))<90)
THEN OBSNOW("TYP OF PROC", OBSPREV("TYP OF PROC"))
else "" endif
}
Brad
That makes so much sense! Thank you so much 🙂 It worked beautifully
I ended up editing the code and thought I'd share in case it's helpful to someone else. When I just did the simple OBSNOW(obs term,OBSPREV()) I had bugs where the info would disappear when I tabbed out. The code below worked beautifully:
{
if (DURATIONDAYS(LAST_SIGNED_OBS_DATE("TYP OF PROC"),STR(._TODAYSDATE))>90) OR OBSPREV("TYP OF PROC") =="" THEN ""
else OBSNOW("TYP OF PROC",OBSPREV("TYP OF PROC"))
endif
}