GSoC 2023 with OpenMRS | Coding Week 04
Another week of the Google Summer of Code 2023 has flown by and this past week has been particularly exciting as I’ve been working on a very new feature of the SDK : the “Appointment Scheduling”.
The Appointment Scheduling module is a crucial component of the OpenMRS system, enabling healthcare providers to efficiently manage patient appointments. However, this functionality was lacking in the Android SDK, limiting healthcare professionals’ ability to utilize it on mobile devices. In order to bridge this gap, I perfomed the following activities to integrate the Appointment Scheduling functionality into the Android SDK.
Resource Collection and Flow Study:
To understand the intricacies of appointment scheduling in OpenMRS, I collected resources related to the appoitments module. This included studying existing documentation, reviewing code repositories, and engaging with my mentor Rishabh to gain insights of the module.
Understanding Appointment Blocks and Time Slots:
Appointment Blocks and Time Slots are fundamental concepts within the OpenMRS Appointment Scheduling module. I understood their relationship to each other, and their role in facilitating efficient appointment scheduling. This knowledge formed the foundation for the subsequent integration work.
This diagram helped me a lot to understand the basic relation between Appointment model classes. Dropping this here for future references.
Local Database Creation and Online to Offline Entity Conversion:
One of the significant challenges encountered during the integration of Appointment Scheduling functionality in the Android SDK for OpenMRS was the implementation of a local room database to store the response obtained from the REST API. This process involved mapping the incoming nested objects to the appropriate local room classes. To address this challenge I created the new offline entities for offline support and storage of the Appointments functionality, as well as the addition of necessary convertors.
These new entities helped to mirror the necessary data structures and attributes, enabling the offline storage of appointment-related information.
Moreover, handling nested objects posed a specific challenge during the entity conversion process. It was necessary to devise a strategy to map the incoming nested objects from the REST API response to the appropriate local room classes. I analyzed the relationships between the objects and defining the necessary associations within the entities. By effectively mapping the nested objects, a comprehensive representation of the appointment data could be stored in the local room database.
In addition, to facilitate the conversion process from online to offline entities, converters were implemented. These converters allowed for the translation of the data between the REST API response format and the local room entities.
This week was the most challenging and I enjoyed a lot implementing a feature to the SDK.
Here’s the PR (Currently under review):
Thank you for reading and stay tuned for week 3 progress :)
Connect with me on LinkedIn: www.linkedin.com/amshubham