Background: Patient payment queuing at hospital cashier desks is a persistent operational challenge in resource-limited healthcare settings. The University Teaching Hospital of Butare (CHUB), a 450-bed public tertiary referral centre in Huye, Rwanda, implemented an asynchronous Mobile Money payment module integrated with its OpenClinic GA hospital management information system (HMIS) through the Irembo payment gateway. This paper, the first in a two-part series, provides the full technical description of the integration architecture. The companion paper (Part II) reports the quantitative performance evaluation of the deployed system.
Objectives: To describe: (1) the overall system architecture of the Irembo-OpenClinic GA integration; (2) the dual payment trigger pathway design (patient-initiated SMS and staff-initiated HMIS form); (3) the four-step Irembo Application Programming Interface (API) transaction workflow covering invoice creation, payment initiation, status polling, and callback confirmation; (4) the background processing scheduler and retry mechanism; and (5) the system data model and database design supporting audit and financial reconciliation.
Methods: Technical description is based on direct analysis of the OpenClinic GA source code deployed at University Teaching Hospital of Butare (CHUB), including the Java service layer, the JavaServer Pages (JSP) presentation layer, the background scheduling daemon, and the Irembo Pay Representational State Transfer Application Programming Interface (REST-API) integration (the Irembo mobile money service component). All source artefacts described represent the production code deployed at CHUB in October 2025.
Results: The integration implements a non-blocking, asynchronous payment initiation model using a four-step Irembo API transaction workflow. Two trigger pathways are supported: patient-initiated via a pseudo Unstructured Supplementary Service Data (USSD) Short Message Service (SMS) command (*CODE*1*{patientId}*{payerPhoneNumber}#), and staff-initiated via a modal form within the HMIS patient profile page. A multi-threaded background scheduler (a 10-thread pool with a 20-second base interval) continuously processes pending inquiries and confirms payments without blocking clinical workflows. The data model comprises six database tables capturing the full payment lifecycle from billed item to financial credit, with a dedicated status-history audit log. An exponential-backoff retry mechanism (up to three attempts, 5–60 seconds delay) handles transient API failures. Webhook callback verification uses Hash-based Message Authentication Code with Secure Hash Algorithm 256-bit (HMAC-SHA256) signature validation.
Conclusions: The described architecture delivers genuine queue elimination by dispatching payment requests asynchronously to patient handsets, enabling payment confirmation without physical cashier attendance. The design is reproducible within any OpenClinic GA deployment and provides a reference model for asynchronous mobile money integration in sub-Saharan African hospital settings.