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.setSessionContext(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.
How to decide what to send
All context parameters are optional, so the session still works if you send none of them. Send the parameters that match data you already have in your app or EHR, including partial context when that is all you can provide, and leave out any parameter you cannot fill yet.When to call setSessionContext
- Create the ambient session and wait for success.
- Call
setSessionContext(with:)with whatever context you have. - Start recording.
- Call
setSessionContext(with:)again later if more context becomes available. Each call updates or adds to the existing context.
Match what you have to a context type
Use this table to pick which guide to open. If your app already has the data in the left column, pass that context type insetSessionContext(with:) and follow the linked guide for keys and examples.
You can send one parameter or several in the same
setSessionContext(with:) call, and mix only the keys you need.Things to keep in mind:
- Do not block session creation or recording because context is incomplete.
- Map fields from your EHR or scheduling system into the matching keys when those values exist.
- Omit keys you cannot populate, and do not invent placeholder values for required nested fields unless the field docs say they are optional.
- For orders info, Medication orders is not enabled by default, so contact Suki support if you need access. Incomplete order metadata can fail validation.
Set session context (optional but recommended)
After the session is created, callsetSessionContext(with:) and pass a dictionary of optional parameters. In one call you can mix patient info, provider context, visit context, EMR info, note sections, diagnosis info, and medication orders, or send just one of them. For each parameter, see the keys and types in Additional context parameters. If you do not have data for a parameter yet, leave it out of the dictionary; call setSessionContext(with:) again when you want to add or change values.
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.Code example
All context parameters
Choose a context type for keys, types, and examples. Pass any combination of these parameters insetSessionContext(with:).
Patient Info
Demographics, partner or EMR patient id, and structured patient name for personalized note generation.
Provider Context
Specialty and provider role so notes match your specialty conventions and encounter role.
Visit Context
Visit type, encounter setting, reason for visit, and chief complaint for the encounter.
EMR Info
Target EMR identifier for the ambient session so Suki routes context to the right system.
Note Sections
LOINC section codes that define which clinical note sections you want in the generated note.
Diagnosis Info
Structured diagnosis notes and codes that help identify conditions discussed in the encounter.
Orders Info
Medication orders context, including drug details, linked diagnoses, and order metadata.
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
partnerIdand 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 required fields 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.