Hi. I'm trying to get the EDC to show in the Patient Banner during the time of pregnancy, and up to 56 days following the EDC. It appears to work until approximately five months out in the pregnancy, and then it appears to no longer fit the criteria and displays "no." Is it something to do with the way the EDC field is being calculated? (It is a number field, I believe.) This is the code that I have at this point, with the word "no" just showing while I work with it, intending to eliminate it once it goes live:
{if (obsany("EDC")"" and (adddates(obsany("EDC"),"0","0","57"))>str(._todaysdate)), "EDC: " + obsany("EDC"), "no"}
If someone could explain how to eliminate that initial condition and still have the second one work, too, that would be helpful. It seems like it shouldn't be needed, but when I try removing it, I get an error, so I know I must be using the wrong syntax.
Thank you,
Mary
It would probably look more like this:
{if obsany(“EDC”) >str(._todaysdate) and adddates(obsany(“EDC”),”0″,”0″,”57″)>str(._todaysdate) then
“EDC: ” + obsany(“EDC”)
else
“no”
endif}
I would run a trace and make sure your EDC obs term is playing nice with the date functions. Might need to convert it also.
Thanks for the suggestion - will definitely try it!