openmrs-core icon indicating copy to clipboard operation
openmrs-core copied to clipboard

TRUNK-6030 : The allergy field in the Allergy UI should validate the input string

Open subhamkumarr opened this issue 1 year ago • 2 comments

The allergy field in the Allergy UI allows the user to enter a numeric value, considering allergies cannot have numeric name, we must validate the input string before allowing the user to procced further

Description of what I changed

This pull request enhances the AllergyValidator in the Allergy UI to provide improved validation for the allergen field. Previously, the allergen field allowed users to enter numeric values, which is not a valid scenario for allergy names.

Changes Made:

  • Updated the AllergyValidator class to include validation for numeric values in the allergen field.

  • If the allergen field contains numeric values, a custom error is triggered to inform the user about the restriction on using numeric values for allergy names.

    How to Test:

    • Enter a valid non-numeric allergen name. The validation should pass.
    • Attempt to enter an allergen name containing numeric values. The validation should reject the input and display an appropriate error message.

Issue I worked on

https://openmrs.atlassian.net/issues/TRUNK-6030

Checklist: I completed these to help reviewers :)

  • [X] My IDE is configured to follow the code style of this project.

    No? Unsure? -> configure your IDE, format the code and add the changes with git add . && git commit --amend

  • [X] I have added tests to cover my changes. (If you refactored existing code that was well tested you do not have to add tests)

    No? -> write tests and add them to this commit git add . && git commit --amend

  • [X] I ran mvn clean package right before creating this pull request and added all formatting changes to my commit.

    No? -> execute above command

  • [X] All new and existing tests passed.

    No? -> figure out why and add the fix to your commit. It is your responsibility to make sure your code works.

  • [X] My pull request is based on the latest changes of the master branch.

    No? Unsure? -> execute command git pull --rebase upstream master

subhamkumarr avatar Jan 17 '24 11:01 subhamkumarr

@dkayiwa @ibacher Sir, Could you please review this PR.

subhamkumarr avatar Jan 17 '24 14:01 subhamkumarr

tl;dr our action detected no activity on this PR and will close it in 30 days if the stale label is not removed.

OpenMRS welcomes your contribution! It means a lot to us that you want to contribute to equity in healthcare!

This PR has not seen any activity in the last 5 months. That is why we wanted to check whether you are still working on it or need assistance from our side. Please note that this is an automated message and we might very well be the reason why there has not been any activity lately. We certainly do not want to discourage you from contributing. We do need to be honest in that OpenMRS has limited resources for reviewing PRs.

If you do not have time to continue the work or have moved on you don’t need to do anything. We will automatically close the PR in 30 days. We hope to see you back soon :) If you would like to continue working on it or require help from us please remove the stale label and respond by commenting on the issue.

github-actions[bot] avatar Aug 04 '24 00:08 github-actions[bot]