Skip to main content

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​

ScopeWhat it covers
Patient DemographicsName, date of birth, contact information
Conditions & ProblemsActive conditions and medical history
MedicationsCurrent and past prescriptions
Lab Results & ObservationsLaboratory results, vitals, and reference ranges
Diagnostic ReportsLab panels, radiology and imaging reports
Encounters & VisitsVisit history, providers, and summaries
AllergiesDocumented allergies and intolerances
Procedures & Clinical NotesProcedure history and clinical documentation

All scopes are checked by default. The patient can uncheck individual scopes before approving.

What happens after approval​

  1. The patient clicks Authorize.
  2. The selected EHR provider is added to EhrContext via addProvider().
  3. 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).