Skip to Content

Encounter

The Encounter namespace provides commands, events, and errors for managing clinical encounters within the Aura Widget.

Event Flow

Click to expand

Commands

Commands you can send to control encounter behavior.

Encounter.Open

Opens an encounter with the provided encounter ID. If the encounter doesn’t exist, a new record will be created using the provided patient and provider details.

AuraWidget.command({ type: 'Encounter.Open', payload: { encounterId: '1234567890', patient: { id: '3572', firstName: 'John', lastName: 'Doe', birthDate: '1990-01-15', gender: 'Male', email: 'john.doe@example.com', phone: '+1234567890', address: { line1: '123 Main St', city: 'New York', state: 'NY', zip: '10001', country: 'USA', }, }, encounterDateTime: '2025-01-01T00:00:00Z', providerId: '971', description: 'Annual checkup', templates: { 'pre-chart': '<template-id-1>', 'in-visit': '<template-id-2>', }, }, });

Payload

PropertyTypeDescription
encounterId*
stringUnique identifier for the encounter in your system.
patient*
PatientThe patient object. See Patient properties below.
id*
stringUnique identifier for the patient in your system.
firstName
stringPatient's first name.
lastName
stringPatient's last name.
birthDate*
stringPatient's date of birth in YYYY-MM-DD format.
gender
'Male' | 'Female' | 'Other'Patient's gender.
email
stringPatient's email address.
phone
stringPatient's phone number.
address
AddressPatient's address. All fields are optional.
line1
stringStreet address line 1.
line2
stringStreet address line 2.
city
stringCity name.
state
stringState or province.
zip
stringZIP or postal code.
country
stringCountry name.
encounterDateTime*
stringEncounter start date and time in ISO 8601 format.
providerId*
stringUnique identifier for the provider in your system.
description
stringOptional description for the encounter.
templates
objectTemplate IDs to use for each encounter phase.
pre-chart
stringTemplate ID for the pre-chart phase.
in-visit
stringTemplate ID for the in-visit phase.
* Required field

If a patient with the same id already exists, their record will be updated with the provided details. Otherwise, a new patient record will be created.

Encounter.Update

Updates the encounter with the provided details.

AuraWidget.command({ type: 'Encounter.Update', payload: { description: 'Updated description', encounterDateTime: '2025-01-01T00:00:00Z', }, });

Payload

PropertyTypeDescription
description
stringUpdated description for the encounter.
encounterDateTime
stringUpdated encounter start date and time in ISO 8601 format.
* Required field

Encounter.RegenerateNote

Regenerates the note for the opened encounter.

AuraWidget.command({ type: 'Encounter.RegenerateNote', payload: { encounterId: '1234567890', encounterPhase: 'in-visit', templates: { 'in-visit': '<template-id-2>', }, }, });

Payload

PropertyTypeDescription
encounterId*
stringUnique identifier for the encounter in your system.
encounterPhase*
'pre-chart' | 'in-visit'The encounter phase to regenerate the note for.
templates
objectOptional template ID to use for regenerating the note.
pre-chart
stringTemplate ID for the pre-chart phase.
in-visit
stringTemplate ID for the in-visit phase.
* Required field

Encounter.UpdateHistory

Adds a prior note or history to the encounter pre-chart.

AuraWidget.command({ type: 'Encounter.UpdateHistory', payload: { encounterId: '1234567890', note: 'Patient has a history of hypertension and diabetes.', }, });

Payload

PropertyTypeDescription
encounterId*
stringUnique identifier for the encounter in your system.
note*
stringAny prior note or history content to add to the encounter pre-chart.
* Required field

Events

Events broadcast by the widget that you can subscribe to.

Encounter.Loaded

Fired when an encounter has been successfully loaded and is ready for interaction.

PropertyTypeDescription
encounterId*
stringUnique identifier for the encounter in your system. This links the widget's encounter to your application's encounter record.
* Required field

Encounter.NoteChanged

Fired with the latest note summary/note for the current encounter.

PropertyTypeDescription
noteJson*
objectThe latest note summary/note JSON.
encounterId*
stringUnique identifier for the encounter in your system. This links the widget's encounter to your application's encounter record.
encounterPhase*
stringThe phase of the encounter the note was generated for. e.g. pre-chart and in-visit.
templateId
stringThe template ID used to generate the note. This may be undefined if the note was created using a template unknown to the widget.
* Required field

Errors

The error events emitted during the course of an encounter. Each error event receives the common error properties as payload, in addition to the event-specific properties listed below.

Encounter.LoadFailed

Fired when an encounter fails to load. The event receives the common error properties as payload.

Encounter.HistoryUpdateFailed

Fired when an encounter history update fails.

PropertyTypeDescription
encounterId*
stringUnique identifier for the encounter in your system. This links the widget's encounter to your application's encounter record.
* Required field
Last updated on