> ## Documentation Index
> Fetch the complete documentation index at: https://developer.suki.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Problem-Based Charting In Web SDK

> Enable PBC, set a PBN section, and pass existing patient diagnoses so notes merge with EMR problems

<Callout title="Updates" color="orange" icon="bell">
  **Updated**

  The `diagnoses` block in `ambientOptions` is supported in the Web SDK `v2.1.2`. Pass the patient's existing diagnoses (e.g. from the EMR) so the session merges them with what's discussed in the visit. Refer to the [Existing patient diagnoses](/web-sdk/guides/ambient-problem-based-charting#existing-patient-diagnoses) guide for more details.
</Callout>

Problem-Based Charting (PBC) organizes clinical notes by patient problems instead of traditional note sections. To enable it in the Web SDK, mark one section as the Problem-Based Note (PBN) by setting `isPBNSection: true` on that section in `ambientOptions` (using the section's [LOINC code](/documentation/note-sections)).

## Implementation

<View title="JavaScript" icon="js">
  ```js JavaScript theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
  sdkClient.mount({
    rootElement: document.getElementById("suki-root"),
    encounter: encounterDetails,
    ambientOptions: {
      sections: [
        { loinc: "51848-0", isPBNSection: true }, // Assessment and Plan as PBN
        { loinc: "11450-4" },
        { loinc: "29545-1" },
      ],
      diagnoses: { // [!code ++:14] New in v2.1.2
        values: [
          {
            codes: [
              {
                code: "I10",
                description: "Essential hypertension",
                type: "ICD10",
              },
            ],
            diagnosisNote: "Hypertension",
          },
        ],
      },
    },
  });
  ```
</View>

<View title="React" icon="react">
  ```jsx React theme={"theme":{"light":"github-dark","dark":"material-theme-darker"}}
  <SukiAssistant
    encounter={currentEncounter}
    ambientOptions={{
      sections: [
        { loinc: "51848-0", isPBNSection: true }, // Assessment and Plan as PBN
        { loinc: "11450-4" },
        { loinc: "29545-1" },
      ],
      diagnoses: { //  [!code ++:14] New in v2.1.2
        values: [
          {
            codes: [
              {
                code: "I10",
                description: "Essential hypertension",
                type: "ICD10",
              },
            ],
            diagnosisNote: "Hypertension",
          },
        ],
      },
    }}
  />
  ```
</View>

## Configuration rules

<Steps>
  <Step title="Single PBN section">
    Only one section can have `isPBNSection: true`. If multiple sections are marked as PBN, the ambient session will fail to start.
  </Step>

  <Step title="Explicit flag values">
    Explicitly pass `true` or `false` for the `isPBNSection` flag. The value provided will be respected as-is.
  </Step>

  <Step title="Default behavior">
    If no section includes the `isPBNSection` flag (i.e., left `undefined`) and the Assessment & Plan section (51847-2) is present, that section will automatically be treated as the PBN.
  </Step>

  <Step title="Override default">
    If you explicitly set `isPBNSection: false` on the Assessment & Plan section, the automatic default behavior will not apply.
  </Step>
</Steps>

<Warning>
  For a given ambient session, **only one section** can have `isPBNSection: true`. If more than one section is marked as PBN, the ambient session will fail to start.
</Warning>

## Existing patient diagnoses

Pass the patient's current diagnoses (e.g. from the EMR) into the session using the `diagnoses` block in the `ambientOptions` object. The SDK automatically merges them with what's discussed during the visit so the note has one problem list and no duplicates.

When you switch to a new patient or encounter, pass that encounter's diagnoses in `ambientOptions`; see [Update encounter and ambient options](/web-sdk/guides/ambient-implementation#update-encounter-and-ambient-options) for more details.

<Note>
  Diagnoses can be seeded **only at the start of the first session** in an encounter.
</Note>

In re-ambient (later sessions in the same encounter), you cannot seed diagnoses; rely on the note from the previous session for any updates.

A diagnosis you pass in is included in the note only if the provider or patient talks about it during the visit. If they don't mention it, it's left out.

### Requirements for passing diagnoses

* You must have **at least one PBC section** in your `ambientOptions.sections` (set `isPBNSection: true`).
* For each diagnosis you pass in:
  * Include exactly one code in the `codes` array.
  * Set the code `type` to `"ICD10"`.
  * Provide at least one of `code` or `description` (you can provide both).
  * `diagnosis_note` is optional.

<Note>
  **Things to keep in mind**

  * **Input:** Only **ICD10** is supported for the diagnoses you pass in. Output can include ICD10, IMO, and SNOMED.

  * **AutoCoding:** Off by default so your seeded data is used as is.
</Note>

<Note>
  **Response**

  The response is **unchanged** when you pass diagnoses. You receive the same object (`noteId`, `encounterId`, `contents`) via `onNoteSubmit` or `note-submission:success`.

  For the full response structure, refer to [Note management - Response structure](/web-sdk/guides/note-management#response-structure).
</Note>

## Next steps

<Icon icon="file-lines" iconType="solid" /> Track session state: [Ambient session status](/web-sdk/guides/ambient-session-status)

<Icon icon="file-lines" iconType="solid" /> Multilingual sessions: [Multilingual support](/web-sdk/guides/ambient-multilingual)

<Icon icon="file-lines" iconType="solid" /> Return to [Ambient session](/web-sdk/guides/ambient) overview
