Updated:Starting with Mobile SDK
v2.6.0+ on iOS SDK, you can attach structured medication orders to an ambient session’s context by passing SukiAmbientConstant.kOrdersInfo into setSessionContext(with:) after you create the session.Learn more in the Medication orders section.Quick summary
The
setSessionContext(with:) method in the mobile SDK allows you to provide optional clinical context to the ambient session for better note generation. This context helps Suki generate more accurate and relevant clinical notes.
Call setSessionContext(with:) multiple times. Each call updates or adds to the existing context. This allows you to provide information as it becomes available in your app.Overview
After creating a session, you can provide additional clinical information using thesetSessionContext(with:) method. This context helps Suki’s AI generate more accurate and relevant clinical notes.
All context parameters mentioned below are optional. Use one or more of these parameters to help Suki generate more accurate and relevant clinical notes. The absence of any parameter will not break existing functionality.
- Better note quality: More accurate sections and diagnoses
- Specialty-specific formatting: Notes match your medical specialty
- Structured organization: Notes organized by the sections you need
- Diagnosis accuracy: Better identification of conditions discussed
Set session context (optional but recommended)
After creating a session, you can provide additional clinical information using thesetSessionContext(with:) method. This context helps Suki’s AI generate more accurate and relevant clinical notes.
Call
setSessionContext(with:) multiple times. Each call updates or adds to the existing context. This allows you to provide information as it becomes available in your app.Additional context parameters
Patient info
Use this parameter to provide demographic information that helps personalize the note generation.
Provider context
Use this parameter to provide information about the healthcare provider to tailor note generation to your specialty and role.
Visit context
Use this parameter to provide visit-related metadata that provides context about the type and purpose of the encounter.
EMR info
Use this parameter to identify which EMR applies to an ambient session. Provide a string identifier that matches what your integration and Suki use for that EMR (for example a vendor code or environment-specific label).
An array of LOINC codes that specify which clinical note sections you want in the generated note. Each dictionary contains a LOINC code.Code example:
You only need to provide LOINC codes. The SDK automatically generates the appropriate clinical section titles based on the codes you provide.
Swift
Diagnosis info
Structured diagnosis information that helps the AI identify and code conditions discussed during the encounter. Each dictionary represents one diagnosis.
Orders info
Use this parameter to provide information about medications relevant to a patient visit, such as existing prescriptions or the patient’s current medication list.The data is structured as a single bundle. On the wire, the outer payload key is
orders. Inside this bundle, you must include a single list keyed by MedicationOrderKeys.kMedicationOrders (wire string medication_orders). Each entry in this list represents a single medication order and must be formatted as an individual dictionary.You can skip kOrdersInfo entirely if it is not required for your workflow. If you do send the MedicationOrderKeys.kMedicationOrders list, each order in that list must satisfy the following requirements.Payload keysYou must include the following payload (wire) keys for every order in the MedicationOrderKeys.kMedicationOrders array:-
medication_code: You must include bothcode_typeandcode. -
linked_diagnosis_codes: You must include at least one item containing bothcode_typeandcode. -
metadata.originandmetadata.encounter_relation: You must use only the approved values for these fields.
Swift
Best practices
Follow these practices to ensure reliable session management:FAQs
Why is session creation failing?
Why is session creation failing?
Session creation can fail for several reasons:Common causes:
- SDK not initialized: Make sure you’ve called
initialize()before creating a session - Invalid partner information: Check that your partner ID and provider information are correct
- Network connectivity issues: Ensure the device has an active internet connection
- Authentication token problems: Verify your token provider is returning valid tokens
- Missing microphone permissions: Ensure your app has microphone access permissions
.failure case. The error will indicate the specific reason for failure.Why isn't my session context updating?
Why isn't my session context updating?
The session context may not update if:
- Session not created: You must call
createSessionfirst and wait for it to succeed - Method not called: Ensure you’re actually calling
setSessionContextafter session creation - Invalid parameters: Check that specialty strings and codes match the expected formats. For medication orders, confirm every required field per order, valid
metadatavalues, and at least one linked diagnosis code object - Network error: The update request may have failed due to connectivity issues
.failure, examine the error to understand what went wrong.Can I start recording immediately after creating a session?
Can I start recording immediately after creating a session?
Yes, once
createSession succeeds and returns a sessionId, you can start recording. However, it’s recommended to call setSessionContext first if you have clinical context available, as this improves note quality.The typical flow is:- Create session → Get sessionId
- Set session context (optional but recommended)
- Start recording