# Next Steps After Patient Import

Now that 23 patients have been imported into the remote monitoring system, here's what to do next.

## Current Status

✅ **Completed**:
- Patient user accounts created (IDs 1778-1800)
- Insurance records created
- Patients assigned "patient" role
- All patients set to "active" status

⏳ **Pending**:
- Patient intake records
- Doctor orders
- Insurance verification
- Doctor approval
- Patient enrollment

## Step 1: Create Patient Intake Records (Optional but Recommended)

Patient intake records capture initial health screening and determine the appropriate service path (RPM, RTM, or CCM).

### Option A: Bulk Create via Command

```bash
# First, find a staff member ID
php artisan tinker
>>> User::where('role', 'staff')->first()

# Then run the import with --create-intake flag
php artisan patients:import-remote-monitoring app/Console/for-import.csv --staff-id=2 --create-intake
```

This will:
- Parse medical conditions from the CSV
- Automatically determine service paths
- Create intake records assigned to the specified staff member

### Option B: Manual Creation via Web Interface

1. Log in as a staff member
2. Navigate to each patient's profile
3. Click "Remote Monitoring" button
4. Complete the Patient Intake Form with:
   - Condition screening (Hypertension, Diabetes, Heart Failure, etc.)
   - Medication reconciliation
   - Tech qualification (smartphone, devices, caregiver support)

## Step 2: Doctor Creates Physician Orders

Once intake records exist, doctors can create orders.

### Via Web Interface

1. Log in as a doctor
2. Navigate to "Pending Orders" view
3. Select a patient with completed intake
4. Click "Create Physician Order"
5. Complete the form with:
   - Clinical indications
   - Service selection (RPM, RTM, CCM)
   - Medical necessity & plan of care
   - Patient consents
   - Provider authorization

### Bulk Creation (if needed)

Create a command to bulk-create doctor orders:

```bash
php artisan doctors:create-orders --staff-id=1 --auto-approve
```

(This command would need to be created if bulk creation is needed)

## Step 3: Staff Verifies Insurance

After doctor orders are created, staff verifies insurance coverage.

### Via Web Interface

1. Log in as a staff member
2. Navigate to "Insurance Verification" pending list
3. For each patient:
   - Click "Verify Insurance" (if insurance exists)
   - Or click "Add Insurance" (if missing)
4. Complete verification form with:
   - Member ID and DOB
   - Plan information
   - Benefit details
   - CPT code verification

### Insurance Already Exists

Since we imported insurance data, staff only needs to verify:
- Coverage status
- CPT code coverage
- Prior authorization requirements
- Telehealth restrictions

## Step 4: Doctor Approves Orders

After insurance verification, doctors review and approve.

### Via Web Interface

1. Log in as a doctor
2. Navigate to "Insurance Verification Results"
3. Review CPT code coverage
4. Click "Approve Order"
5. Patient enrollment is activated

## Step 5: Patient Begins Monitoring

Once approved, patients can start the remote monitoring program.

### Patient Actions

1. Log in to patient portal
2. Complete "Monthly Wellness Check-In" form
3. Submit vital readings and health updates
4. Receive care team follow-up if needed

## Recommended Timeline

| Phase | Timeline | Owner | Action |
|-------|----------|-------|--------|
| 1 | Day 1 | Staff | Create patient intake records |
| 2 | Day 2-3 | Doctor | Create physician orders |
| 3 | Day 3-4 | Staff | Verify insurance coverage |
| 4 | Day 4-5 | Doctor | Approve orders |
| 5 | Day 5+ | Patient | Begin daily monitoring |

## Quick Reference Commands

### Check Patient Status

```bash
php artisan tinker

# Count patients
>>> User::where('id', '>=', 1778)->count()

# View patient with insurance
>>> User::find(1778)->load('insurances')

# Check intake records
>>> PatientIntake::where('patient_id', '>=', 1778)->count()

# Check doctor orders
>>> DoctorOrder::whereIn('patient_id', range(1778, 1800))->count()
```

### Find Staff Member ID

```bash
php artisan tinker
>>> User::where('role', 'staff')->get(['id', 'name', 'email'])
```

### Find Doctor ID

```bash
php artisan tinker
>>> User::where('role', 'doctor')->get(['id', 'name', 'email'])
```

## Troubleshooting

### Patients Not Showing in Pending Orders
- Ensure patient intake records have been created
- Check that intake records have `service_path` set (rpm, rtm, or ccm)

### Insurance Verification Failing
- Verify insurance records exist: `Insurance::where('user_id', 1778)->first()`
- Check that policy numbers are valid
- Ensure plan type is recognized (HMO, PPO, POS, EPO)

### Doctor Orders Not Appearing
- Confirm doctor is assigned to patients
- Check doctor order status: `DoctorOrder::where('patient_id', 1778)->first()`

## Support & Documentation

- **Workflow Details**: See `REMOTE_MONITORING_WORKFLOW.md`
- **Import Guide**: See `PATIENT_IMPORT_GUIDE.md`
- **Import Summary**: See `IMPORT_SUMMARY.md`
- **Technical Details**: See `docs/RTM-integration.md`

## Questions?

For detailed information about each workflow stage, refer to the REMOTE_MONITORING_WORKFLOW.md file which includes:
- Detailed form requirements
- Data models and relationships
- Status flow diagrams
- Route information
- Validation rules

