Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Validation for Insurance input fields in patient registration form #8672

Closed
2 tasks
nihal467 opened this issue Sep 30, 2024 · 11 comments · Fixed by #8836
Closed
2 tasks

Add Validation for Insurance input fields in patient registration form #8672

nihal467 opened this issue Sep 30, 2024 · 11 comments · Fixed by #8836
Assignees
Milestone

Comments

@nihal467
Copy link
Member

nihal467 commented Sep 30, 2024

Describe the bug

Currently, the patient registration form lacks frontend validation for the insurance fields, and the backend only validates the member ID and policy ID.

To Reproduce
Steps to reproduce the behavior:

  1. Go to the patient tab
  2. Click on add patients
  3. scroll down and click Add insurance
  4. without filling in the fields submit it
  5. See an error

Expected behavior

  • add backend validation for insurer name
  • add frontend validation for member id, policy id and insurer name

Screenshots

image

@syedfardeenjeelani
Copy link
Contributor

hi @nihal467 i would like to try to work on this can you please assign it to me

@rithviknishad
Copy link
Member

@syedfardeenjeelani as mentioned, this requires backend validation first followed by FE validation.

Would you be making the backend PR too?

@syedfardeenjeelani
Copy link
Contributor

syedfardeenjeelani commented Sep 30, 2024

@rithviknishad hey as of now i would be only able to make a FE validation pr please let me know if that is okay if not then someone else can take it

@rithviknishad
Copy link
Member

Yes it's okay, just create an issue in backend repo too

@syedfardeenjeelani
Copy link
Contributor

@rithviknishad sure thank you

@syedfardeenjeelani
Copy link
Contributor

@rithviknishad hello and @nihal467 please check the video below and let me know if would like me to do any changes

All.fields.are.mandatory.1.mp4

@rithviknishad
Copy link
Member

Use field_required from the i18n locale (useTranslations) for the required field errors. Also ensure that this error is present only for fields having the prop required=true set.

@syedfardeenjeelani
Copy link
Contributor

@rithviknishad we are getting the error from the validator.ts which is something like this
if (
!value.policy_id.trim() ||
!value.subscriber_id.trim() ||
(enable_hcx && (!value.insurer_id?.trim() || !value.insurer_name?.trim()))
)
return "All fields are mandatory";

so should i use field_required from the i18n locale here instead of "All fields are mandatory"

@rithviknishad rithviknishad added this to the hcx milestone Oct 1, 2024
@krVatsal
Copy link

Can i work on this issue?

@syedfardeenjeelani
Copy link
Contributor

@krVatsal hello i have already raised a pr for this feel free to take up on a different issue thank you

@syedfardeenjeelani
Copy link
Contributor

@rithviknishad please review this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment