client.on(event, callback), which returns an unsubscribe function.
Events
Consultation events
Consultation events
Meeting events
Meeting events
consultation(ormeeting): all the metadata, includingreference,mode,patient,customFields, andintegration.result: the generated artifacts only.
Completing a consultation
When a consultation completes you must callfinish() to acknowledge receipt. Optionally pass a status to report whether your processing succeeded.
Calling
finish() with no arguments is equivalent to finish({ status: 'success' }):
Reading artifacts
result.artifacts holds the structured medical output. Each artifact type is an array, so always filter by contentType rather than relying on array order.
Structured notes
structuredNotes is the medical note in section-shaped form, so you can map sections into your own system by id instead of parsing the rendered note. Each structured note carries the templateId it was generated from and its sections in note order.
- Key on
id. Section ids are stable for a given template, so a mapping you build against a template keeps working across consultations. Treat ids as opaque strings. headingis always present, including for sections the rendered note shows without a visible heading.- When present, the content matches
medicalNotes. The sections are the same clinician-approved note, not a separate output. - The field can be absent for any consultation, by design — for example, when the clinician edited the note as free text or the feature is not enabled for your organisation. Always handle absence; fall back to
medicalNotes, which is present in every completed consultation.
Medical codes
medicalCodes includes diagnoses and observations. Observational codes carry a measurement, and every code carries an evidence array (which may be empty).
Other lifecycle events
Putting it together
A complete integration that loads the client, subscribes, then starts a consultation on demand:Cleanup
Unsubscribe from individual listeners, close a specific consultation, or destroy the whole client.destroy() cleans up all resources but won’t remove historical data saved in the browser.