Overview
The Suki Mobile SDK provides methods to manage the entire lifecycle of an ambient session. This guide covers how to create a session and enrich it with detailed clinical context.What Will You Learn?
In this guide, you will learn how to:-
Initialize an ambient session by calling the
createSession(withSessionInfo:)method and storing the resulting sessionId. - Provide crucial context for the note generation, including provider specialty, LOINC codes, and structured diagnosis information, using the recommended setSessionContext(with:) method.
-
Understand and utilize session parameters, such as
SukiAmbientConstant.kSessionIdandSukiAmbientConstant.kMultilingual. -
Adhere to best practices for robust integration, including initializing the SDK before recording, handling
SukiAmbientCoreError, and managing session IDs for future operations. - Troubleshoot common issues, such as why session creation might fail or why the session context may not update.
Create An Ambient Session
Before you can start a recording, you must create a session. Call thecreateSession(withSessionInfo:) method to initialize the session. Upon success, this method returns a sessionId that you must store to reference this session in future calls.
Session Info Parameters
ThewithSessionInfo dictionary can contain the following keys:
An optional unique identifier for the session. If not provided, the SDK generates one automatically.
Optional, enables multilingual processing for the session. The default value is
false (English only). This setting applies to the entire session and cannot be changed mid-session.Set Additional Context (Optional but Recommended)
After creating a session, you can add more detailed information by calling thesetSessionContext(with:) method. This is the recommended way to provide context like provider specialty, LOINC codes, and structured diagnosis information.
This method uses an API that supports partial updates. You can call it multiple times to update or add different pieces of context after the session has been created.
Context Detail Parameters
Thewith dictionary can contain the following keys:
A dictionary for updating patient birthdate and gender.
A dictionary containing the provider’s specialty.
An array of dictionaries for mapping sections to specific LOINC codes.
You no longer need to provide section titles. The SDK will automatically generate the appropriate clinical sections based on the LOINC codes you provide.
An array of dictionaries for passing structured diagnosis context. Each dictionary can contain:
Best Practices And Error Handling
To ensure a robust integration, follow these best practices:- Always ensure the SDK is initialized and a session is created before you call recording methods.
-
Handle
SukiAmbientCoreErrorin all operations to provide robust error feedback, especially for background and foreground transitions. - Be aware of iOS limitations for background recording. A recording cannot be started while the app is in the background, and execution time is limited. Use local notifications to inform users if errors occur while the app is backgrounded.
- Store the unique recording or session ID for future operations, such as handling status changes or retrieving content.
FAQs
Why is the session creation failing?
Why is the session creation failing?
The session creation can fail for several reasons:Common causes:
- Invalid partner information
- Network connectivity issues
- Authentication token problems
- Missing microphone permissions
Why is the session context not being updated?
Why is the session context not being updated?
The session context is not being updated because the
setSessionContext method is not being called. You must ensure that you are calling the setSessionContext method after the session has been created.Session created but user is not able to start recording?
Session created but user is not able to start recording?
The session is created but the user is not able to start recording because the session is not in a valid state. You must ensure that the session is in a valid state before the user can start recording. To start recording, you must call the
start method.