How to compute Next appointment with doday

Dear Team,

I would like to seek technical team providing a solution to compute next appointment with today to get less than 5 days in order to notify the client coming a health facility for next 5 days.

For instant. One client visits a health facility on 01/Jan/2025 and next appointment date is on 05/Feb/2025. Assume that today is 01/Feb/2025. we compute a date diff between (01/Feb/2025, 05/Feb/2025) and get the result 5 days. So, HF staff is able to notify a client coming a HF in advance. So on the DHIS2 2.40, how to compute this for solution for HF staff. Thanks!

Regards,
LCAynar

Hi @LCaynar

If you’re using the latest update for version 2.40, you can use the program stage notification.

You could create a program rule that will trigger the action to schedule a message (or ‘send the message’ action) to be sent five days (or four?) from the enrollment date.

The trigger will be for the specified program stage only, and the expression should validate to true:
d2:daysBetween(V{current_date}, #{next_appointment_date}) <= 5

The #{next_appointment_date} data element - a date data element with 'next schedule date` configured, see example by @Caroline in this ticket.

You will need to create a message template from the Program stage notifications:

I hope this gives you an idea but please test and post back to let us know how it works for you or if any issue comes up.

Thanks!

1 Like

Dear @Gassim ,

Thanks you so much for your prompt help. One more thing, could we show those clients on event report as a line listing. Therefore, the HF staff can contact the clients directly based on this list.

Best and Thanks!
LCAynar

Hi @LCaynar

Yes, I think this is a feature that the Line Listing app can help. Please check out the Line Listing app playlist on the DHIS2 YouTube channel.

Does the post above solve the issue? Please mark the post as solve if it does. If you’re still facing an issue with this specific example, please feel free to reply with feedback on how it goes. You’re welcome to create a new topic if there’s a different issue you’d like help with.

Thanks!

1 Like

A post was split to a new topic: Dashboard error: ‘There was a problem loading this plugin’ (Line List)