Had a odd request today. A provider wants a field to show differently if the patient bday is with 2 weeks.
Anyone out there created something like this before I embark on this journey?
Hello,
I haven't created this specifically, but you can use the durationdays function.
It would look something like this Durationdays(str(PATIENT.DATEOFBIRTH),str(._todaysdate) < 14)
I am not sure if the syntax is exactly right but that should give you what you need.
Try this:
DURATIONDAYS(replacestr(str(PATIENT.DATEOFBIRTH),sub(str(PATIENT.DATEOFBIRTH),7),sub(str(._TODAYSDATE),7)),str(._TODAYSDATE)) > 0 and DURATIONDAYS(replacestr(str(PATIENT.DATEOFBIRTH),sub(str(PATIENT.DATEOFBIRTH),7),sub(str(._TODAYSDATE),7)),str(._TODAYSDATE)) <= 14
This works, but only if today's date is after DOB.
For example if patients DOB is 9/18 is will not trigger but if it is 9/10 it triggers.
Obviously it should be a piece I just need to reverse, just got to find it.
EDIT:
Got it! Thanks for your help. Here it is:
DURATIONDAYS(replacestr(str(._TODAYSDATE),sub(str(._TODAYSDATE),7),sub(str(PATIENT.DATEOFBIRTH),7)),str(PATIENT.DATEOFBIRTH)) > 0
and
DURATIONDAYS(replacestr(str(._TODAYSDATE),sub(str(._TODAYSDATE),7),sub(str(PATIENT.DATEOFBIRTH),7)),str(PATIENT.DATEOFBIRTH)) < 15