LHR Manual Testing Guide
📋 Main Document: Implementation Progress | 📊 Gap Analysis: Gap Analysis | 🔍 Code Review: Review Checklist
Prerequisites
Environment Setup
- Backend server running on
http://localhost:3000 - Frontend server running on
http://localhost:3001 - Database with test data
- Valid JWT token:
Bearer eyJhbGciOiJIUzI1NiJ9.eyJ1c2VyX2lkIjoyMSwiZXhwIjoxNzU4MTk0NzgzfQ.vbuwyCJQ7BdYpOYiVz0k0-oqZuGRdwdMTvOdpN1E0gI
Test Data Requirements
- Test clinic (ID: 11)
- Test patient (clinic_patient_id: 21, patient_id: 23)
- Test doctor (ID: 8)
- Test appointment (ID: 29)
Phase 1: Careplan Creation Testing
URL: http://localhost:3001/cms/prescription/29/21/queue?did=8
1.1 Page Load Test
-
Page loads without errors
- Check browser console for JavaScript errors
- Check network tab for failed API requests
- Verify page renders completely
-
Authentication works
- User is not redirected to login
- JWT token is valid and not expired
- User has appropriate permissions
-
Initial data loads
- Patient information displays
- Appointment details show
- Tabs are visible and clickable
1.2 Tab Navigation Test
-
Vitals Tab
- Tab is accessible and renders
- Vitals form is displayed
- Can switch between vitals types
- Form validation works
-
Observations Tab
- Tab renders without errors
- Clinical notes form is available
- Text input works properly
- Auto-save functionality (if implemented)
-
Medications Tab
- Tab renders correctly
- Medication search/add functionality
- Dosage and frequency inputs work
- Can add/remove medications
-
Investigations Tab
- Tab loads properly
- Lab test selection works
- Can add/remove investigations
- Test categories are available
-
Advice Tab
- Tab renders correctly
- Advice text input works
- Can add multiple advice items
- Proper formatting
1.3 Data Entry Test
-
Add Vitals Data
Test Data: - Blood Pressure: 120/80 mmHg - Heart Rate: 72 bpm - Temperature: 98.6°F - Weight: 70 kg -
Add Clinical Observations
Test Data: - Chief Complaint: "Headache for 2 days" - Clinical Notes: "Patient appears well, no distress" - Physical Examination: "Normal examination" -
Add Medications
Test Data: - Medication 1: Paracetamol 500mg, TID x 3 days - Medication 2: Ibuprofen 400mg, BID x 5 days -
Add Investigations
Test Data: - CBC with differential - Basic Metabolic Panel - Urinalysis -
Add Advice
Test Data: - "Take medications as prescribed" - "Rest and adequate fluid intake" - "Follow up if symptoms worsen"
1.4 Form Validation Test
-
Required Fields
- Try to proceed without required fields
- Verify appropriate error messages
- Check field highlighting
-
Data Format Validation
- Invalid vital signs values
- Invalid medication dosages
- Invalid date formats
-
Business Logic Validation
- Drug interaction checking (if implemented)
- Allergy checking (if implemented)
- Dosage range validation
1.5 Auto-Save Test
- Auto-save Functionality
- Enter data and wait for auto-save
- Refresh page and verify data persistence
- Switch tabs and verify data retention
Phase 2: Careplan Finalization Testing
2.1 Finalization Process
-
Complete Required Fields
- Ensure all mandatory fields are filled
- Add diagnosis if required
- Verify all tabs have necessary data
-
Finalization Button
- Button is enabled when requirements met
- Click finalization button
- Observe loading states
-
Success Confirmation
- Success message displayed
- No error messages in console
- Page updates appropriately
2.2 Backend Data Verification
Check Prescription Table
-- Verify prescription is marked as final
SELECT id, is_final, diagnosis, observations
FROM prescriptions
WHERE id = [prescription_id];Check Patient Medicine Creation
-- Verify patient medicines were created
SELECT pm.*, p.medicine_name
FROM patient_medicines pm
JOIN prescriptions p ON pm.prescription_id = p.id
WHERE p.id = [prescription_id];Check Patient Problem Creation (Our Implementation)
-- Verify patient problems created from diagnosis
SELECT * FROM patient_problems
WHERE clinic_id = 11 AND patient_id = 23
ORDER BY created_at DESC;Check Sync to LHR
# Check Rails logs for sync completion
tail -f log/development.log | grep "LHR sync completed"2.3 Document Generation Test
-
Prescription PDF
- Verify prescription PDF generates
- Check PDF content accuracy
- Verify download functionality
-
Additional Documents (If Implemented)
- Clinical impression documents
- Individual medication documents
- Lab order documents
Phase 3: LHR View Testing
URL: http://localhost:3001/cms/careplan/patient/21
3.1 Page Load Test
-
Initial Load
- Page loads without errors
- Patient header information displays
- All tabs are visible
-
Data Loading
- Loading states display appropriately
- Data loads within reasonable time
- No infinite loading states
3.2 Patient Summary Dashboard
-
Patient Information
- Name, age, gender display correctly
- Medical ID is shown
- Contact information accurate
-
Key Metrics
- Active problems count
- Current medications count
- Recent visits count
- Health score calculation
-
Recent Vitals
- If vitals data exists: displays properly
- If no vitals: proper empty state message
- Vitals trending indicators work
3.3 Problems Tab Testing
-
Problems List Display
- Shows existing problems or empty state
- Problems sorted appropriately
- Problem details are accurate
-
Create New Problem
Test Data: - Problem Name: "Hypertension" - Problem Code: "I10" - Severity: "Medium" - Status: "Active" - Onset Date: Current date - Clinical Notes: "Newly diagnosed"- Form submission works
- Success message displayed
- Problem appears in list
-
Edit Problem
- Click edit on existing problem
- Modify fields (e.g., change severity)
- Save changes
- Verify updates persist
-
Resolve Problem
- Click resolve on a problem
- Confirm resolution
- Problem status updates to "resolved"
- Problem moves to resolved section
-
Delete Problem
- Click delete on a problem
- Confirm deletion
- Problem removed from list
- Verify from database it's soft deleted
3.4 Medications Tab Testing
-
Current Medications
- Shows active medications or empty state
- Medication details accurate
- Status indicators work
-
Medication Timeline
- Historical medications display
- Chronological ordering
- Status changes tracked
-
Update Medication Status
- Change medication from active to inactive
- Update takes effect immediately
- Changes persist after refresh
3.5 Encounters Tab Testing
-
Encounter History
- Shows appointment history
- Displays encounter details
- Proper chronological order
-
Encounter Details
- Click on encounter
- View detailed information
- Associated prescriptions link
-
Schedule Follow-up
- Click schedule follow-up
- Follow-up form appears
- Can schedule new appointment
3.6 Vitals Trends Tab Testing
-
Vitals Chart
-
If vitals data exists:
- Chart displays properly
- Different vital types selectable
- Time range filters work
- Trend indicators accurate
-
If no vitals data:
- Proper empty state message
- Helpful guidance text
- No chart errors
-
-
Chart Interactions
- Hover tooltips work
- Zoom functionality
- Data point selection
- Export functionality (if implemented)
3.7 Clinical Assessments Tab Testing
-
Assessments Display
- Shows clinical assessments or empty state
- Assessment details accurate
- Proper sorting
-
Assessment Details
- Click on assessment
- View full assessment details
- Associated data links work
Phase 4: Error Handling & Edge Cases
4.1 Network Error Testing
-
Offline Behavior
- Disconnect network
- Try to perform operations
- Proper error messages shown
-
Timeout Handling
- Simulate slow responses
- Verify timeout handling
- User feedback provided
4.2 Authorization Testing
-
Expired Token
- Use expired JWT token
- Verify redirect to login
- Proper error handling
-
Insufficient Permissions
- Test with limited user role
- Verify permission-based UI
- Proper error messages
4.3 Data Validation Testing
-
Invalid Data Submission
- Submit forms with invalid data
- Check field-level validation
- Verify error message clarity
-
Concurrent Updates
- Two users editing same data
- Check conflict resolution
- Data consistency maintained
Phase 5: Performance Testing
5.1 Load Time Testing
-
Initial Page Load
- Measure time to interactive
- Check for performance bottlenecks
- Verify acceptable load times
-
Data Loading Performance
- Test with large datasets
- Check pagination effectiveness
- Memory usage monitoring
5.2 API Performance
- Response Times
- Measure API response times
- Check for slow queries
- Verify acceptable performance
Testing Results Documentation
Test Execution Log
## Test Session: [Date/Time]
### Phase 1: Careplan Creation
- [ ] Page Load: ✅ PASS / ❌ FAIL
- [ ] Tab Navigation: ✅ PASS / ❌ FAIL
- [ ] Data Entry: ✅ PASS / ❌ FAIL
- [ ] Form Validation: ✅ PASS / ❌ FAIL
### Phase 2: Careplan Finalization
- [ ] Finalization Process: ✅ PASS / ❌ FAIL
- [ ] Backend Verification: ✅ PASS / ❌ FAIL
- [ ] Document Generation: ✅ PASS / ❌ FAIL
### Phase 3: LHR View
- [ ] Page Load: ✅ PASS / ❌ FAIL
- [ ] Problems Tab: ✅ PASS / ❌ FAIL
- [ ] Medications Tab: ✅ PASS / ❌ FAIL
- [ ] Encounters Tab: ✅ PASS / ❌ FAIL
- [ ] Vitals Tab: ✅ PASS / ❌ FAIL
### Issues Found
1. [Issue Description]
- Severity: Critical/High/Medium/Low
- Steps to Reproduce: [Steps]
- Expected: [Expected behavior]
- Actual: [Actual behavior]
2. [Issue Description]
- ...Browser Console Log
- Document any JavaScript errors
- Note any warning messages
- Track API call failures
Performance Metrics
- Page load times
- API response times
- Memory usage observations
Testing Status: Ready to begin Prerequisites: Ensure all servers are running Next Step: Execute Phase 1 testing