GSoC 2024: Validation Rule Builder for the Form Builder - Final Presentation

GSoC 2024: Validation Rule Builder for the Form Builder

Project Title: Validation Rule Builder for Form Builder

Mentors: Dennis Kigen (primary mentor), and Hadijah (backup mentor)

Contributor: Senthil Athiban M

Project Link: Wiki Page

Overview

OpenMRS Form Builder is used to create forms with an interactive builder, but creating conditional logic has traditionally been challenging, requiring users to write complex JavaScript expressions directly into the schema. Without a user-friendly interface, building these advanced logics can be difficult and error-prone. To address this, the project involved developing a Validation Rule Builder for the Form Builder, enabling users to create complex rules effortlessly, without needing to worry about JavaScript expressions. The tool provides a real-time preview and minimizes errors, significantly enhancing the user experience and making the process more accessible.

Objectives

i) Rule Definition: Create custom rules for form fields, including conditional logic, validation logic with custom error messages, and calculation logic that automatically fills form fields with computed values.

ii) Reduce Manual Effort: Eliminate the need for users to write complex JavaScript expressions, thereby reducing manual effort. Instead, provide an intuitive, user-friendly interface that empowers users to build sophisticated logic in seconds, enhancing productivity and user experience.

iii) Real-Time Validation: Ensure that the logic being created is valid and functional as users build it, preventing errors and saving time.

Figma Design

Architecture

Contributed Repository

Pull Request

Documentation

https://openmrs.atlassian.net/wiki/spaces/projects/pages/114426045/Validation+Rule+Builder

Demo Videos

Summary

During my GSoC project, I accomplished the following:

  1. Developed a User-Friendly Validation Rule Builder: Created an intuitive interface that allows users to easily build validation rules within the form builder.
  2. Enabled Advanced Logic Creation: Added functionality for users to create complex conditional logic, validation logic, and calculation logic directly within forms, enhancing the formā€™s capabilities.
  3. Implemented Rule Management: Provided features to edit and delete existing rules, giving users full control over their form logic.
  4. Enhanced Rule Complexity: Enabled the creation of multiple conditions and actions for each rule within a form field, allowing for more granular and customized logic.
  5. Supported Multiple Rules per Field: Allowed users to define multiple rules for a single form field, offering greater flexibility and precision in form behavior.

Future Works

  1. Store Rules in a Table: Implement functionality to save the logic created for form fields in a structured table format. This table will be accessible via a separate tab next to the interactive builder, displaying all rules in a single view with options to edit and delete, streamlining rule management.
  2. Duplicate Rule Functionality: Introduce the ability for users to duplicate existing rule definitions, allowing for easy replication and application of similar logic across different form fields, saving time and reducing redundancy.
  3. Expand Action Types: Add new action types to the rule builder, such as the ability to automatically navigate to a specific page when certain conditions are met, enhancing the interactivity and dynamic behavior of forms.
  4. End-to-End Test Cases: Develop comprehensive end-to-end test cases for various calculation logic scenarios, including ā€œNext Visit Dateā€ and ā€œTreatment Dateā€ calculations, ensuring robustness and accuracy in real-world applications.

Talk Threads

Weekly blog posts

Community Bonding

Coding Period

Thoughts on GSoC

Google Summer of Code has been a life-changing experience for me, teaching me more about understanding product requirements and client engagement than just writing code. I had an incredible time collaborating with my mentors, fellow contributors, and the O3 squad. This internship gave me a deeper understanding of what software engineering truly entails ā€” how software benefits users, saves time, and reduces costs.

On the technical side, I gained significant knowledge in areas such as React best practices, testing, and documentation. A special thanks to my mentor, Dennis Kigen, for encouraging me to dive deeper into React best practices, which have greatly improved my coding skills. Iā€™m also very grateful to my backup mentor for their invaluable support, especially during the initial stages of the project.

2 Likes