SMART on FHIR OAuth2 + PKCE
Standalone login and EHR launch both resolve Epic launch context, access tokens, patient ID, and encounter ID.
The iPhone app blueprint for background voice capture, on-device transcription, editable AI note templates, and FHIR-native Epic filing.
Built around Swift 6, NavigationStack, MVVM, async/await, Apple Speech, AVFoundation background audio, Keychain secrets, JSON template persistence, and Epic sandbox SMART on FHIR.
Platform
iOS 18+ / SwiftUI / Swift 6
Architecture
NavigationStack + MVVM + async/await
Epic Client ID
0b6e4915-d99b-4921-8a80-4ca43220fb4d
FHIR Base URL
fhir.epic.com/interconnect-amcurprd-oauth/api/FHIR/R4/
Core Features
Every major screen and service is represented: Epic launch, schedule, recording, transcription, templates, note editing, AI providers, and push-back into Epic.
Standalone login and EHR launch both resolve Epic launch context, access tokens, patient ID, and encounter ID.
Appointment.Search pulls the clinician’s appointments and presents today’s patients in a clean SwiftUI list.
AVFoundation background audio keeps visit dictation reliable while the app is backgrounded or the screen is off.
Apple Speech framework produces an editable transcript locally before any optional AI provider is called.
Unlimited templates with editable sections, per-section prompts, duplication, reordering, and a default template.
Every section is editable, AI-generateable, rebuildable, and switchable into another physician-owned template style.
Apple Foundation Models, Ollama, OpenAI, Grok, Gemini, and NVIDIA Build API Catalog can be selected in Settings.
Push individual SmartPhrase sections or file the complete clinical note with DocumentReference.Create.
How It Works
The app is designed around a physician’s real day: launch, schedule, patient context, recording, structured generation, review, and FHIR filing.
SMART on FHIR OAuth2 + PKCE supports standalone sign-in and Epic EHR launch with patient and encounter context.
Appointment.Search retrieves the daily schedule, then the physician taps a patient to enter the Note Builder.
AVAudioSession is configured for background recording so dictation continues when locked or backgrounded.
Apple Speech transforms the recording into an editable transcript with live waveform feedback.
Each section uses transcript, Epic context, and its own customizable AI prompt from the selected template.
SmartPhrase text can be pushed section-by-section, or the full note can be created as a Clinical Note.
Template Library
Physician Simple starts with New Visit, Repeat Visit, and Referral Visit templates, then lets the clinician build any specialty-specific structure they want.
Templates
Section Prompt Editor
History of Present Illness
AI PromptGenerate a concise HPI using OLDCARTS, preserving patient wording and clinically relevant negatives.
Laboratory & Imaging Data
AI PromptUse transcript plus Epic context to write only this section in the selected template style.
Assessment
AI PromptUse transcript plus Epic context to write only this section in the selected template style.
Plan
AI PromptUse transcript plus Epic context to write only this section in the selected template style.
Structured Note Builder
Selecting a patient opens the Note Builder with the Default Template. The physician can AI-generate any section, edit any text, rebuild the full note, or change templates and instantly rebuild.
Part 1
Part 2
Part 3
AI Generate
Regenerate one editable section with transcript, prompt, and Epic context.
Rebuild Entire Note
Regenerate all sections using the currently selected template.
Change Template
Switch to another library template and rebuild the note in that style.
AI Providers
Settings lets the physician choose a default provider and enter API keys. Each section prompt can run against the selected backend while preserving the same Note Builder interface.
Settings
Default AI Provider + Keychain API Keys
Epic Integration
The site now reflects the actual Epic implementation plan, including client ID, sandbox base URL, custom callback scheme, launch context handling, and R4 resource calls.
client_id=0b6e4915-d99b-4921-8a80-4ca43220fb4d
redirect_uri=physiciansimple://oauthcallback
base=https://fhir.epic.com/interconnect-amcurprd-oauth/api/FHIR/R4/
GET Appointment?date=today&practitioner={clinician}
GET DiagnosticReport?patient={patient}
GET DocumentReference?patient={patient}
POST DocumentReference // Clinical Notes (R4)Technical Architecture
The app design calls for clean separation between UI, view models, persistence, Keychain, audio recording, transcription, AI provider adapters, and Epic FHIR clients.
Login, schedule, patient detail, note builder, template library, and settings are composed with NavigationStack routes.
FHIR clients, auth services, audio services, transcription services, template stores, and AI providers sit behind view models.
Templates and non-secret settings persist through FileManager JSON stores and @AppStorage for lightweight defaults.
FHIR tokens and API keys stay in Keychain, never in JSON files or @AppStorage.
AVAudioSession category and background modes are configured for reliable recording while locked.
Swift 6 async/await drives OAuth, Appointment, DiagnosticReport, DocumentReference, and note creation calls.
Privacy & Security
Physician Simple is designed around local transcription, Keychain secrets, clinician review, and transparent provider selection.
Secure storage
Tokens and API keys live in Keychain.
Recording and Apple Speech transcription happen locally, with optional AI calls controlled by provider settings.
OAuth tokens, refresh tokens, and provider API keys are stored in Keychain with narrow access surfaces.
Every generated section remains editable before SmartPhrase push or DocumentReference.Create filing.
Implementation Snapshot
A compact view of the state that powers generation, template switching, and Epic filing.
Physician Response
The app design balances premium physician ergonomics with explicit technical details for Epic and security review.
“This is the first note app spec that respects how physicians actually work: launch from Epic, record in the room, edit the note, and file it back.”
Dr. Maya Chen
Internal Medicine
“The per-section prompt library is the killer feature. Every specialist can keep their own structure without waiting for a vendor update.”
Dr. Aaron Patel
Cardiology
“From an informatics standpoint, the OAuth, FHIR resources, Keychain storage, and explicit Epic sandbox details make this feel implementation-ready.”
Elena Rodriguez
Clinical Informatics Director
The page reflects the target SwiftUI implementation: Epic launch, daily schedule, locked-screen recording, on-device transcription, editable templates, pluggable AI, and FHIR note filing.