Skip to main content

Overview

Encounter data contains patient and provider information. You pass it to the SukiAssistant component to pre-populate the SDK. Dynamic encounter means you can change the encounter prop after the component loads. When you pass new encounter data, the SDK automatically updates it for note generation.

Code Example

The example below shows how to change encounter data using React state:
import { SukiAssistant, SukiProvider, useSuki } from "@suki-sdk/react";

function DynamicEncounterComponent() {
  const [currentEncounter, setCurrentEncounter] = useState(initialEncounter); // Replace with your initial encounter data

  const switchToNewPatient = () => {
    const newEncounter = {
      identifier: "6ec3920f-b0b1-499d-a4e9-889bf788e5ab", // Sample identifier (Replace with your actual encounter identifier without any spaces).
      patient: {
        identifier: "905c2521-25eb-4324-9978-724636df3436", // Sample identifier (Replace with your actual patient identifier without any spaces).
        name: {
          use: "usual",
          family: "Wilson",
          given: ["Emma"],
          suffix: [],
        },
        birthDate: "1992-07-10",
        gender: "female",
      },
    };

    setCurrentEncounter(newEncounter);
  };

  return (
    <SukiProvider>
      <div>
        <button onClick={switchToNewPatient}>Switch to New Patient</button>

        <SukiAssistant
          encounter={currentEncounter}
          // rest of the props
        />
      </div>
    </SukiProvider>
  );
}

Next Steps

Refer to Ambient Events to learn more about how to track and manage ambient interactions in the web SDK.