I have a form that is set to look at document variables for dates of an initial treatment plan and follow up dates. The provider is asking if I can create an alert in the document to prompt her when the treatment plan follow up is due again. Typically every 3 months. Can anyone give me advice on how to create this?
Good morning!
If you have a date of the treatment plan, and you want to alert the provider when she is in a note that it has been over 3 months, then you can use the DURATIONDAYS(date1,date2) function to calculate the time, and the USEROK(message) function to make a popup appear. here is a sample of code that uses the functions
//I am using daysPassed as a variable to hold the number of days since Treatment plan
//DOCUMENT.INITIAL_TX_PLAN is assumed to be a date in the form of dd/mm/yyyy
{daysPassed == DURATIONDAYS(DOCUMENT.INITIAL_TX_PLAN,str(._TODAYSDATE))}
{!if (daysPassed >90) then
USEROK("It has been " + daysPassed + " days since your initial treatment. Treatment plan follow up is due!")
endif}
If the plan is more than 90 days old, the popup will activate. if not, then nothing happens.
Please let me know if you have any questions on using this code, or if you are trying to do something else.