GSoC Journey: Week 08 of Coding Period
Hello folks,
Myself Senthil Athiban, a final year undergraduate student at Madras Institute of Technology. This blog represents a continuous series documenting my journey through GSoC. If you haven’t already read my previous blogs, I encourage you to check out my previous blogs here. I have been selected as a GSoC student at OpenMRS for the Validation Rule Builder for the Form Builder project. My primary mentor is Dennis Kigen, and my backup mentor is Hadijah Kyampeire.
📅 Week 8: July 15— July 19
Tasks to be Completed:
- Calculation Function Integration: Implement a streamlined approach for adding calculation functions with just 4–5 lines of code to simplify the process.
- Date Calculation Feature: Integrate a new date calculation feature to enable autofilling of form fields based on calculated values.
Tasks Completed
✅ Streamlined Workflow: Implemented a new approach to simplify the addition of calculation functions in the validation rule builder, improving overall efficiency and code maintainability.
✅ Adding Date Calculations: Introduced new calculation functions for date fields, including calcNextVisitDate
and calcTreatmentEndDate
, along with a helper function, calcGravida
.
📚 Documentation: Created new examples and tutorial guides to help users understand the functionality of the newly added calculation logic.
Challenges Faced
Adding Calculation Functionality
In software development, implementing new functionalities often requires adjusting the existing codebase, which can sometimes result in convoluted code. When I first attempted to integrate calculation functions into the validation rule builder, I encountered several challenges. These changes not only altered the code structure but also led to less maintainable code, despite having comprehensive test cases in place.
Problem: The initial approach proved to be non-scalable and prone to errors, which underscored the need for a more efficient solution.
Solution: To address this, I developed a streamlined approach that simplifies the process of adding new calculation functions. This approach focuses on enhancing workflow efficiency by introducing a more structured and reusable logic that minimizes potential errors and improves code maintainability.
With this new approach, you can add new calculation logic in four simple steps:
- Add the Calculation Name: Include the new calculation name in the
calculateFunctions
array according to its category. - Define Arguments: Specify the arguments required for the new calculation function.
- Configure Condition Schema: Set up the
conditionSchema
for the new calculation function. - Test the Logic: Finally, test the new logic within the validation rule builder to ensure it works as expected.
Lesson Learned
Implementing a structured approach for adding new features can prevent code complexity and enhance maintainability. Clear steps for integrating functionalities improve efficiency and reduce errors. Reusability and thorough testing are crucial for ensuring that new logic is reliable and consistent. This experience underscores the value of organized and scalable solutions in software development.
Plans for Next Week
- Manual Testing: Conduct thorough testing of the validation rule builder with complex form logics to ensure functionality and reliability.
- Bug Fixing: Address and resolve any bugs identified during testing, aiming to minimize errors and improve overall performance.
About Me
I’m Senthil Athiban, a final-year undergraduate student from India. By day, I play with VS Code by building new projects, and by night, I contribute to projects on GitHub. My journey is driven by a passion for software development and a curiosity to explore new technologies.
🔗 Connect with Me
- GitHub: senthil-k8s
- LinkedIn: Senthil Athiban M
- Twitter: @senthil_k8s