SwiftUI implementation of the pediatric Clinical CLI using GPT‑5.1 as the reasoning engine.
CDSMDH.xcodeproj– iOS 17 SwiftUI project.CDSMDH/– Source files, assets, prompts, and Info.plist.CDSMDH/Resources/Prompts– JSON prompt exports generated viapython scripts/export_prompts.py.
- Run
python scripts/export_prompts.pyat the repo root whenever prompts change. - Open
ios/CDSMDH/CDSMDH.xcodeprojin Xcode 15+. - Provide an OpenAI key in-app using the Settings gear (stored in the Keychain).
- Run on iOS 17 simulator or device.
| File | Purpose |
|---|---|
CDSMDHApp.swift |
Entry point with tab navigation + Settings controls |
GPTService.swift |
GPT‑5.1 streaming client using /v1/chat/completions |
SecureSettings.swift |
Keychain-backed API key + model management |
StreamingCommandViewModel.swift |
Shared streaming/state machine for every command |
DrugLookupViewModel.swift |
Recreates CLI drug workflow with weight parsing |
CDSViewModel.swift |
Clinical decision support reasoning + red-flag framing |
CDSView.swift |
SwiftUI form for CDS intakes (presentation, concerns, format) |
ChatDesign.swift |
ChatGPT-style glassmorphism components + gradients |
PromptTemplate.swift |
Loads JSON prompts into memory for reuse |
- Add DDx, Notes, and Parse tabs by subclassing
StreamingCommandViewModel. - Expand UI with tabs for CDS, notes, and document parsing.
- Wire up attachment support for images/PDF once GPT endpoints accept files.
- Inspired by the ChatGPT mobile app: layered gradients, glass cards, pill chips, and streaming response panels.
- Uses
GlassCard,PrimaryActionButtonStyle, andStreamingOutputSection(seeChatDesign.swift) to keep a consistent look across commands. - Background gradient + blurred materials require iOS 17+; previews target iPhone 15/16 to enable the “iOS 26” design stack.
- Ensure a prompt JSON exists via
python scripts/export_prompts.py(command key becomes the filename). - Subclass
StreamingCommandViewModelwith any intake fields you need and build theuserMessage. - Create a SwiftUI view that binds to the new view model and surfaces
error,isStreaming, andoutput. - Register the tab or screen in
CDSMDHAppso it shows up beside Drug Lookup and CDS.