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.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:
-
SukiAmbientConstant.kPatientInfo: A dictionary containing the patient’s name, birthdate, and gender. -
SukiAmbientConstant.kSections: An array of dictionaries that define the clinical sections for note generation. If you omit this, default sections are used. -
SukiAmbientConstant.kSessionId: An optional unique identifier for the session. If you do not provide one, the SDK generates it for you. -
SukiAmbientConstant.kMultilingual: A boolean that enables multilingual processing for the session. The default 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.
You can only call
setSessionContext(with:) after a session has been successfully created. You must provide valid speciality strings and codes.Context Detail Parameters
Thewith dictionary can contain the following keys:
-
SukiAmbientConstant.kPatientInfo: A dictionary for updating patient birthdate and gender. -
SukiAmbientConstant.kProviderContext: A dictionary containing the provider’s speciality. -
SukiAmbientConstant.kSections: 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.
-
SukiAmbientConstant.kDiagnosisInfo: An array of dictionaries for passing structured diagnosis context. Each dictionary can contain:-
kDiagnosisNote: An optional string with notes about the diagnosis. -
kCodes: An array of one or more dictionaries for the diagnosis codes. Each code dictionary must contain:-
kCodeType: (Required) The type of code (e.g., “ICD-10”, “IMO”, “SNOMED”). -
kCode: (Required) The diagnosis code. -
kCodeDescription: An optional but recommended description of the code.
-
-
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.