# Mobile App Migration: Provider System Removal

**Date**: 2026-02-20
**Impact**: Low (no breaking changes for existing calls)

## What Changed

The legacy provider system (`providers` table, `users.provider_id`, `patients.provider_id`, `provider_filter.php`) has been fully removed. The multi-practice system (`practices` table, `user_practices`, `practice_filter.php`) is now the sole isolation mechanism.

## Removed

| Item | Details |
|------|---------|
| `providers` table | Dropped entirely |
| `users.provider_id` column | Dropped |
| `patients.provider_id` column | Dropped |
| `provider_filter.php` | Deleted |
| `backAddProvider.php` | Deleted |
| `backGetProviders.php` | Deleted |
| `test/back_providers.php` | Deleted |
| `list_providers` action in `back_users.php` | Removed |

## What the Mobile App Should Do

### Patient Creation
- **Before**: Could send `provider_id` in patient add requests (silently ignored or stored).
- **After**: `provider_id` field is no longer accepted. Patients are assigned to the user's active practice via `practice_id`.
- **Action needed**: Remove any `provider_id` param from patient creation calls. No functional change — `practice_id` was already the primary isolation key.

### User Data
- **Before**: User objects returned `provider_id` field.
- **After**: `provider_id` is no longer in user data.
- **Action needed**: Stop reading `provider_id` from user objects if you were. Use `practices[]` array from login response instead.

### Superadmin Logic
- **Before**: Superadmin = `is_admin=true` AND `provider_id IS NULL`.
- **After**: Superadmin = `is_admin=true` (simpler).
- **Action needed**: If your app checks superadmin status, simplify to just checking `is_admin`.

### Practice Isolation
- **No change**. Continue using `practice_id` from the login response `practices[]` array for data isolation.

### Login Response
- **No change**. The `practices[]` array in the login response is unchanged and remains the source of truth for practice membership.

## Timeline
- All changes are live as of 2026-02-20.
- The `provider_id` field in API responses is simply absent (not null) — existing code that reads it will get `undefined`/`null` depending on language, which is safe.
