Authorize (EHR Consent)
File: memberportal/src/pages/AuthorizePage.tsx
The Authorize page is the EHR OAuth consent screen. It appears during the EHR connection flow when a patient is about to connect an EHR provider (Epic, Healow, or MEDITECH) to their ChartChat account.
It is not accessible via the main sidebar — it is shown automatically as part of the EHR OAuth redirect flow initiated from the Settings page.
What it does​
Before ChartChat connects to an EHR, the patient is shown a clear list of exactly what data will be accessed. They can review each scope and uncheck any they do not want to share.
Data scopes shown​
| Scope | What it covers |
|---|---|
| Patient Demographics | Name, date of birth, contact information |
| Conditions & Problems | Active conditions and medical history |
| Medications | Current and past prescriptions |
| Lab Results & Observations | Laboratory results, vitals, and reference ranges |
| Diagnostic Reports | Lab panels, radiology and imaging reports |
| Encounters & Visits | Visit history, providers, and summaries |
| Allergies | Documented allergies and intolerances |
| Procedures & Clinical Notes | Procedure history and clinical documentation |
All scopes are checked by default. The patient can uncheck individual scopes before approving.
What happens after approval​
- The patient clicks Authorize.
- The selected EHR provider is added to
EhrContextviaaddProvider(). - The patient is redirected back to the Settings page to complete the OAuth flow with the EHR.
What happens if the patient cancels​
Clicking Back or declining returns the patient to the Settings page without connecting the provider.
How the provider is passed to this page​
The EHR provider object is passed via React Router's location.state:
navigate('/authorize', { state: { provider: selectedProvider } });
If no provider is passed in state, it defaults to the first provider in EHR_PROVIDERS (Epic).