EkaScribe iOS SDK
A Swift package for voice-to-prescription functionality with audio recording and real-time transcription capabilities for medical consultation applications.Overview
EkaScribe empowers healthcare applications with advanced voice recording and transcription capabilities. It provides a seamless integration for medical consultation workflows, enabling doctors to record patient interactions and automatically generate prescriptions through AI-powered voice analysis.Getting Started
- Install the package via Swift Package Manager
- Configure authentication and doctor information at app launch
- Initialize
VoiceToRxViewModelin your view - Start recording with your desired templates and languages
- Handle results when processing completes
Key Features
- 🎙️ Voice Activity Detection (VAD) - Intelligent audio recording with automatic speech detection
- 🔄 Real-time Transcription - Live audio-to-text conversion during consultations
- 🏥 Medical Context Aware - Specialized for healthcare terminology and prescription generation
- 📊 Session Management - Complete recording session lifecycle management
- ☁️ Cloud Integration - Automatic audio upload and processing
- 📝 Template Support - Customizable output formats (SOAP notes, prescriptions, etc.)
Table of Contents
- Requirements
- Installation
- Integration Guide
- Core Components
- Configuration
- Recording Management
- Template Management
- Session History
- Result Management
- Error Handling
- API Reference
Requirements
⚠️ Important: This SDK requires iOS 17.0 or later.
- iOS: 17.0+
- Swift: 5.9+
- Xcode: 15.0+
- Sdk Version: 1.3.3+
System Permissions
Add the following permissions to your app’sInfo.plist:
Installation
Swift Package Manager
Add EkaScribe to your project using Swift Package Manager:- In Xcode, select File → Add Package Dependencies
- Enter the repository URL:
Or use SSH:
- Choose the version or branch
- Add to your target
Package.swift
Import Statement
After adding the package, import it in your Swift files:Integration Guide
Follow these steps to integrate the SDK into your app:Step 1: Configure Authentication and Doctor Information
Set up authentication tokens and doctor information when your app launches. This should be done once at app startup:Step 2: Initialize the View Model
Create aVoiceToRxViewModel instance in your SwiftUI view or UIKit view controller:
SwiftUI:
Step 3: Start Recording
Start a recording session with your desired configuration:Parameters
ThestartRecording() method accepts the following parameters:
-
conversationType (
VoiceConversationType): The type of conversation (see Conversation Types) -
inputLanguage (
[InputLanguageType]): Array of supported languages (see Input Languages) -
templates (
[OutputFormatTemplate]): Array of output format templates (see Template Management) -
modelType (
ModelType): The AI model to use for processing (see Model Types)
getTemplates() API first to fetch available templates before creating the OutputFormatTemplate array. See the Template Management section for details.
Core Components
VoiceToRxViewModel
The central view model that manages the entire voice recording and processing workflow.Recording States
ThescreenState property tracks the current state of the recording session:
Conversation Types
Model Types
Input Languages
Configuration
App-Level Setup
Configure the SDK when your app launches. This should be done once at app startup:Session-Specific Configuration
Before starting a recording session, configure patient-specific information. This should be done each time you start a new recording:Configuration Properties
Authentication
Set authentication tokens before making any SDK calls:Recording Management
Starting Recording
Parameters
ThestartRecording() method accepts the following parameters:
-
conversationType (
VoiceConversationType): The type of conversation (see Conversation Types) -
inputLanguage (
[InputLanguageType]): Array of supported languages (see Input Languages) -
templates (
[OutputFormatTemplate]): Array of output format templates (see Template Management) -
modelType (
ModelType): The AI model to use for processing (see Model Types)
getTemplates() API first to fetch available templates before creating the OutputFormatTemplate array. See the Template Management section for details.
Pausing and Resuming
Stopping Recording
Handling Results
Monitor thescreenState for result availability. Results are automatically provided when processing completes:
value parameter contains base64-encoded formatted output based on your selected template. You need to decode it before displaying to users. For more detailed results including multiple template outputs, use VoiceToRxRepo.shared.fetchResultStatusResponse().
Template Management
Fetching Available Templates
UseVoiceToRxRepo to fetch available templates:
Updating Favorite Templates
Update user’s favorite templates configuration:Using Templates in Recording
Pass templates when starting a recording:Session History
Fetching Session History
Retrieve past recording sessions:Result Management
Fetching Full Result Response
Get the complete result response with selected template outputs:value parameter returned by fetchResultStatus is base64 encoded and must be decoded before displaying to users.
Switching Templates
Switch the output format for an existing session:Updating Results
Update edited content back to the server:Error Handling
Common Errors
The SDK provides specific error types:Error Handling Example
Here’s a complete example of handling errors when starting a recording:API Reference
VoiceToRxViewModel
Properties
Methods
VoiceToRxRepo
Template Management
Session History
Result Management
Configuration Classes
V2RxInitConfigurations
AuthTokenHolder
Data Models
OutputFormatTemplate
VoiceToRxStatusResponse
Best Practices
Memory Management
State Management
Always observescreenState changes to keep your UI in sync:
Error Handling
Always handle errors from async operations using try-catch:Troubleshooting
Microphone Permission Issues
If microphone permission is denied:- Check
Info.plisthasNSMicrophoneUsageDescription - Request permission programmatically if needed
- Guide users to Settings if permission was previously denied
Session Creation Failures
If sessions fail to create:- Verify
ownerOIDis set inV2RxInitConfigurations.shared - Check
AuthTokenHolder.shared.authTokenis valid - Ensure network connectivity
- Check for free session limit if applicable
Result Not Available
If results are not available after processing:- Check
screenStatetransitions to.resultDisplay - Verify session ID is available:
viewModel.sessionID - Use
VoiceToRxRepo.shared.fetchResultStatusResponseto get full response - Check network connectivity for result retrieval

