API Endpoints
All /api/** endpoints return JSON and require an active SMART session. The Bearer token is managed automatically by the session — callers do not need to set Authorization headers from the browser.
Base URL: http://localhost:8080
GET /api/session
Returns the current session metadata.
No scopes required.
Response:
{
"patientId": "ePatient-8675309",
"encounterId": "eEncounter-001",
"needPatientBanner": true,
"fhirBaseUrl": "https://fhir.epic.com/interconnect-fhir-oauth/api/FHIR/R4",
"scopes": ["launch", "openid", "patient/Patient.rs", "patient/Condition.rs"],
"expiresAt": "2025-06-01T15:30:00Z",
"secondsRemaining": 3420
}
GET /api/me
Returns the authenticated clinician's profile from the OIDC id_token and FHIR Practitioner resource.
Requires: openid fhirUser
Response:
{
"subject": "epic-user-001",
"fhirUser": "Practitioner/dr-smith",
"name": "Dr. Jane Smith",
"practitionerId": "dr-smith"
}
GET /api/patient
Returns the current patient's demographics.
Requires: patient/Patient.rs
Response: FHIR R4 Patient resource (JSON)
{
"resourceType": "Patient",
"id": "ePatient-8675309",
"name": [{ "family": "Kumar", "given": ["Priya"] }],
"birthDate": "1985-03-15",
"gender": "female"
}
GET /api/conditions
Returns the patient's active conditions, sorted by recorded date descending.
Requires: patient/Condition.rs
Query parameters:
| Param | Default | Description |
|---|---|---|
status | active | FHIR Condition clinical status |
_count | 50 | Max results |
Response:
{
"resourceType": "Bundle",
"total": 3,
"entry": [{
"resource": {
"resourceType": "Condition",
"code": { "coding": [{ "system": "http://hl7.org/fhir/sid/icd-10", "code": "I20.9", "display": "Angina pectoris, unspecified" }] },
"recordedDate": "2025-01-15",
"clinicalStatus": { "coding": [{ "code": "active" }] }
}
}]
}
GET /api/medications
Returns the patient's active medication requests.
Requires: patient/MedicationRequest.rs
Response: FHIR R4 Bundle of MedicationRequest resources.
GET /api/summary
Returns a clinical summary combining patient demographics, conditions, and medications in a single call.
Requires: patient/Patient.rs patient/Condition.rs patient/MedicationRequest.rs
Response:
{
"patient": { ... },
"conditions": [{ ... }],
"medications": [{ ... }]
}
Next: Error Codes →