Patient Name field is accepting numeric values
Issue Summary
The Patient Name field is accepting numeric values, which is invalid. Users can enter numbers (e.g., 211) without any validation, whereas the field should only accept alphabetic characters.
Problem Statement
- Patient Name field allows numeric input
- No validation to restrict numbers
- Invalid data is being stored in the system
Screenshot
Steps to Reproduce:
- Open the patient form
- Enter "211" in the Patient Name field
- Submit the form
- Observe that it is accepted
Impact:
- Incorrect patient data
- Poor data quality
Proposed Solution
- Add validation to allow only alphabetic characters (A–Z, a–z)
- Reject numeric input using regex: ^[A-Za-z\s]+$
- Show error message: "Patient name must contain only letters"
Test-Driven Development
Acceptance Criteria
Scenario 1: Reject numeric input Given the user is on the patient form When the user enters "211" in the Patient Name field Then a validation error should be shown And the form should not be submitted
Scenario 2: Accept valid input Given the user is on the patient form When the user enters "Laxmi" in the Patient Name field Then the input should be accepted And the form should be submitted successfully
Test Cases
| Test ID | Description | Steps | Expected Result |
|---|---|---|---|
| TC-001 | Numeric input | Enter 211 | Error shown |
| TC-002 | Valid input | Enter Laxmi | Accepted |
| TC-003 | Mixed input | Enter Laxmi123 | Error shown |
Implementation Details
- Add validation in PatientForm component
- Update frontend and backend validation
- Add unit tests for validation
Definition of Done
- Numeric values are rejected
- Validation error is shown
- Valid names are accepted
- Tests are passing