Skip to end of metadata
Go to start of metadata

You are viewing an old version of this content. View the current version.

Compare with Current View Version History

« Previous Version 22 Next »

The Notifications Mediator service allows external tools to setup and schedule notifications for clients. This notifications act as reminders, so the user are aware of future activities. This, together with the Communication Mediator Service, allows the sending of the notifications through different communication channels.

Page content:

How does it works?

The following steps explains how does all the technology stack works together:

  1. An external tool wants to perform an action on Notification Mediator Service.

  2. The request goes to OpenHim that acts as an API Gateway.

  3. OpenHim sends the request directly to the Notification Mediator Service to handle the operation.

  4. Notification Mediator Service executes either:

    1. A request information to a data persistence tool to retrieve data.

    2. A delivery of information to the Communication Mediator Service.

  5. After all the processes are executed, the Notifications Mediator service responds back to OpenHim.

  6. OpenHim delivers a response to the external tool, letting the external tool to know if something went wrong or if everything was successful.

The following diagram shows how the technology stack is connected:

To know the DHIS2 event structure, you can check DHIS 2 Maintenance (psi-mis.org), program stage: CWS Notifications.


Send Notifications → move to a dedicated page

POST /dhis2/send-notifications

Send Notification endpoint retrieves all scheduled messages up to the time the endpoint is called and where the notification status is set as 'scheduled'. This endpoint prepares message content to be sent to Communication Mediator Service. After sending the messages, this service updates the notification status. Additional notes are included in the notification in case of message delivery failure or errors encountered within the messaging service.

This endpoint is meant to be triggered by a cron job provided by OpenHIM. However, Send Notifications endpoint is exposed so the users can manually trigger the sending of notifications

There are two main reasons to do it by date ranges:

  • DHIS2 endpoints restrictions

  • We get the notifications pending to send before the current minute and after the previous 7 days. This way, if for some reason we have notifications pending to send for any reason (the server was down, DHIS2 was not working in the previous hours…) we can send the previous notifications.

  • No labels