Add Blood Group Field to Patient Profile
Issue Summary
Add Blood Group field to Patient Profile to capture and display essential medical information.
Problem Statement
Currently, the patient profile does not include a blood group field.
- There is no option to input or store blood group while creating/editing a patient
- Blood group is not displayed in the patient profile
- This affects medical usability, especially in emergency situations
Impact:
- Doctors and coordinators lack critical patient information
- Reduces effectiveness of treatment and emergency handling
Reproduction:
- Go to patient registration or edit form
- Observe that no blood group field exists
- Check patient profile → blood group is missing
Proposed Solution
- Add a Blood Group dropdown field in patient form
- Use predefined values: A+, A-, B+, B-, AB+, AB-, O+, O-
- Store the selected value in backend and database
- Display blood group in patient profile
Components to update:
- Patient form UI
- Patient profile UI
- Backend API & schema
Test-Driven Development
Acceptance Criteria (Given-When-Then)
Scenario 1: Add blood group while creating patient
Given user is on patient registration form
When user selects a blood group and submits the form
Then the patient should be created with selected blood group
And the value should be stored in database
Scenario 2: Display blood group in profile
Given a patient has a blood group saved
When user views the patient profile
Then the blood group should be displayed correctly
Scenario 3: Dropdown validation
Given user is filling the patient form
When user opens blood group dropdown
Then only valid predefined blood group options should be visible
Test Cases
| Test ID | Test Description | Precondition | Test Steps | Expected Result | Priority |
|---|---|---|---|---|---|
| TC-001 | Add blood group in form | Form loaded | 1.Select blood group | Data saved correctly | High |
| TC-002 | Display blood group | Patient exists | 1.Open profile | Blood group shown | High |
| TC-003 | Dropdown validation | Form loaded | 1.Open dropdown | Only valid options visible | Medium |
Unit Test Requirements
Components/Functions to Test:
| Module/Component | Function/Hook | Test Cases to Cover |
|---|---|---|
| PatientForm.tsx | handleChange | TC-001 |
| PatientProfile.tsx | render | TC-002 |
Test Assertions Required:
-
Renders correctly with initial state -
Handles user input correctly -
Calls API with correct payload -
Updates UI with blood group -
Handles empty/default value
Implementation Details
Files to Change
| File Path | Action | Purpose |
|---|---|---|
| src/components/PatientForm.tsx | Modify | Add dropdown field |
| src/pages/PatientProfile.tsx | Modify | Display blood group |
| backend/models/patient.js | Modify | Add schema field |
| backend/routes/patient.js | Modify | Accept field in API |
Technical Considerations
- Use enum validation for blood group
- Keep field optional for backward compatibility
- Ensure API handles null/default values
UI/UX Requirements
- Dropdown with predefined options
- Clear label: “Blood Group”
- Show “N/A” if not available
Testing Strategy
Manual Testing
- Open patient form
- Select blood group and submit
- Open profile → verify display
Automated Testing
-
Form input tests -
API payload tests -
UI render tests
Definition of Done
-
Blood group field added -
Data stored and retrieved correctly -
Displayed in profile -
Tests passing -
No UI or backend errors
Additional Context
Notes
- Blood group is critical for emergency medical use
- Future scope: filtering patients by blood group
Edited by Damanagari Sathwika