If you want ambient interoperability across Ambient APIs, Mobile SDK, Headless Web SDK, and Web SDK, you must pass
SukiAmbientConstant.kEmrEncounterId on createSession. Without it, the session is created, but the clinical note is not shared across products. For the full workflow, refer to Ambient interoperability and Use ambient across modalities.To run Form filling instead of an Ambient note session, pass
sessionType: .formFilling on createSession. Omit sessionType to keep Ambient behavior (default .ambient). Refer to Create Form filling session.- Create an ambient session using
createSession(with:onCompletion:). - Pass
kEmrEncounterIdfor interoperable notes andkSessionId(Ambient APIencounter_id) for re-ambient workflows. - Store
sessionIdandnoteIdfrom the success response. - Handle create errors that do not fall back to offline.
Create an Ambient session
To start capturing audio and generating notes, you must first create a session. The session holds the audio and context for a single patient encounter. CallcreateSession(with:onCompletion:). When successful, store the returned identifiers for recording and later retrieval.
Swift
Session info parameters
ThewithSessionInfo dictionary accepts these parameters:
string
Your EMR or EHR encounter id for the patient visit (UUID or non-UUID, at most 36 characters). String key:
"emrEncounterId". Maps to Ambient API emr_encounter_id. Pass this value to make the session interoperable across Ambient APIs, Mobile SDK, and Web SDK.string
Ambient API
encounter_id for re-ambient workflows. String key: "sessionId".This field is required for re-ambient workflows. Reuse the same value for every session on that note when you set it on the first create. If the first create omitted encounter_id, pass the returned noteId as this value.This value is not the create response
sessionId, which identifies the current ambient session.boolean
default:"false"
Enables multilingual processing for the session. Set this to
true if the conversation will be in languages other than English. The default value is false (English only). Once set, this cannot be changed for the session.Create session success response
A successfulcreateSession call returns the following identifiers. Store these values if you need to continue the session, access the recording, or retrieve the generated clinical note later.
On Ambient APIs, the equivalent create response fields are
ambient_session_id and note_id.
- Always store
sessionIdfor recording and session content. It maps to Ambient APIambient_session_id. - Store
noteIdwhen present for note-level reads. It maps to Ambient APInote_id. - Store
kSessionId/ Ambient APIencounter_idfor re-ambient sessions when you set it on create. If the first create omitted it, pass the returnednoteIdas thekSessionIdvalue on later creates. The create responsesessionIdis not that value.noteIdis also the path id for note-level APIs.
Create session errors
SomecreateSession failures do not fall back to an offline session. Handle these errors before retrying createSession.
Other
createSession failures can still follow the existing offline workflow. For more information, see Offline mode and Error messages.