Description
Implement the complete 4-step Add Patient flow for adding new patients with comprehensive information collection and document upload.
Design Reference
Figma Frames: Add Patient 1, Add Patient 2, Add Patient 3, Add Patient 4 (576:3113, 576:3143, 576:3170, 576:3217)
Overview
A multi-step form wizard that guides doctors through adding a new patient with:
Basic Information
Medical History
Insurance & Emergency Contact
Document Upload
Step 1: Basic Information
Requirements
Validation
Name: min 2 chars, letters/spaces only
DOB: not future, age 0-120
Phone: valid format (10 digits)
Email: valid format if provided
Address: min 10 chars
Step 2: Medical History
Requirements
Progress indicator (2/4)
Back button preserves step 1 data
Form fields:
Current Medications (text area, important)
Known Allergies (text input, important)
Past Medical History (text area, optional)
Family Medical History (text area, optional)
Blood Group (dropdown: A+, A-, B+, B-, O+, O-, AB+, AB-, required)
Additional Notes (text area, optional)
Warning banner if medications/allergies empty
"Next" button
Step 3: Insurance & Emergency Contact
Requirements
Insurance Providers
Blue Cross Blue Shield, UnitedHealthcare, Aetna, Cigna, Humana, Medicare, Medicaid, Other
Step 4: Document Upload
Requirements
File Validation
Formats: PDF, JPG, JPEG, PNG
Max size: 10MB per file
Max total: 50MB
Image compression before upload
Global Features
API Integration
Technical Implementation
Files to Create
lib/features/patients/presentation/pages/
├── add_patient_step1_page.dart
├── add_patient_step2_page.dart
├── add_patient_step3_page.dart
├── add_patient_step4_page.dart
└── add_patient_wrapper.dart (manages flow)
lib/features/patients/presentation/bloc/
└── add_patient_bloc.dart (manages state)
lib/features/patients/presentation/widgets/
├── step_progress_indicator.dart
├── warning_banner.dart
└── file_upload_card.dart
lib/features/patients/domain/entities/
└── patient_form_data.dart
lib/features/patients/data/
├── datasources/document_upload_service.dart
└── repositories/patients_repository_impl.dart
lib/core/utils/
└── image_compressor.dart
State Management
Use BLoC pattern for form state
Each step emits events to BLoC
BLoC maintains complete form data
Persist state to local storage
Clear state on success/cancel
Dependencies
Priority
Medium
Acceptance Criteria
Testing Checklist
Description
Implement the complete 4-step Add Patient flow for adding new patients with comprehensive information collection and document upload.
Design Reference
Figma Frames:
Add Patient 1,Add Patient 2,Add Patient 3,Add Patient 4(576:3113, 576:3143, 576:3170, 576:3217)Overview
A multi-step form wizard that guides doctors through adding a new patient with:
Step 1: Basic Information
Requirements
Validation
Step 2: Medical History
Requirements
Step 3: Insurance & Emergency Contact
Requirements
Insurance Providers
Blue Cross Blue Shield, UnitedHealthcare, Aetna, Cigna, Humana, Medicare, Medicaid, Other
Step 4: Document Upload
Requirements
File Validation
Global Features
API Integration
Technical Implementation
Files to Create
State Management
Dependencies
Priority
Medium
Acceptance Criteria
Testing Checklist