Skip to main content

VisitNoteEditor

ComplexClinical<co-visit-note-editor>

VisitNoteEditor is the section-by-section visit note with AI Scribe drafts and ICD-10 and CPT search, from Draft to Signed.

import { VisitNoteEditor } from 'health-components';

Examples​

Signed​

Storybook

Read Only​

Storybook

Usage​

<VisitNoteEditor meta="10/09/2026 10:30 AM . Primary Care SOAP" icdOptions={ICD10} cptOptions={CPT}
sections={[{ id: "s", title: "Subjective", required: true }, { id: "a", title: "Assessment and Plan", ai: draftText }]}
onSign={signNote} onAiDraft={runScribe} />

When to use​

  • Writing and signing a visit note.

When not to use​

  • Viewing an old signed note in a list: the Encounters table.

Variants and states​

VariantWhat it is
draftEditable sections, Save Draft, Sign Note.
ai sectionAI Scribe draft with Accept and Edit.
required / errorBadge and field error per section.
signedLocked, addendum note.
readOnlyLock banner for roles without Edit clinical chart.

Accessibility​

  • Each section textarea is named by its title.
  • AI text is never saved without Accept.

Do and don't​

  • Do: Show the visit date, place and template in meta.
  • Don't: Let a template switch drop typed text.

Props​

PropTypeDefaultDescription
sections *VisitNoteSection[]—Array<{id, title, text?, ai?, required?, error?, rows?}>; required
diagnosesVisitNoteCode[]uncontrolledDiagnoses on the note (controlled)
defaultDiagnosesVisitNoteCode[][]Initial diagnoses (uncontrolled)
onDiagnosesChange(codes: VisitNoteCode[]) => voidnoneCalled when a diagnosis is added or removed
proceduresVisitNoteCode[]uncontrolledProcedures on the note (controlled)
defaultProceduresVisitNoteCode[][]Initial procedures (uncontrolled)
onProceduresChange(codes: VisitNoteCode[]) => voidnoneCalled when a procedure is added or removed
icdOptionsVisitNoteCode[][]ICD-10 search options: Array<{code, label}>
cptOptionsVisitNoteCode[][]CPT search options: Array<{code, label}>
titlestring"Visit Note"Heading
metastringnoneDate, place and template line ("10/09/2026 10:30 AM . Main Street Clinic . Primary Care SOAP")
signedbooleanuncontrolledSigned and locked (controlled)
defaultSignedbooleanfalseInitially signed (uncontrolled)
readOnlybooleanfalseLock banner for roles without Edit clinical chart
lockTextstring"Your role can view this note but not edit it."Lock banner text when readOnly
onSign() => voidnoneSign Note
onAiDraft() => voidnoneShows Draft with AI Scribe, which calls this
onSaveDraft() => voidnoneSave Draft
onSectionChange(id: string, text: string) => voidnoneCalled with the section id and its new text as the user types or accepts an AI draft

Also accepts native attributes, including defaultChecked, defaultValue, autoFocus, plus className and event handlers on the root element.

Angular, Vue and HTML​

Register the elements once (Angular guide), then use <co-visit-note-editor>. Attributes take strings; arrays and objects are set as properties (Angular [prop], Vue :prop) or as JSON attributes. Callbacks are DOM events with the value in event.detail.

Angular template
<co-visit-note-editor title="…" meta="…" [sections]="sections" (co-diagnoses-change)="onDiagnosesChange($event.detail)"></co-visit-note-editor>
KindNameDescription
property / JSON attributesectionsArray<{id, title, text?, ai?, required?, error?, rows?}>; required
property / JSON attributediagnosesDiagnoses on the note (controlled); default uncontrolled
property / JSON attributedefault-diagnoses / defaultDiagnosesInitial diagnoses (uncontrolled); default []
property / JSON attributeproceduresProcedures on the note (controlled); default uncontrolled
property / JSON attributedefault-procedures / defaultProceduresInitial procedures (uncontrolled); default []
property / JSON attributeicd-options / icdOptionsICD-10 search options: Array<{code, label}>; default []
property / JSON attributecpt-options / cptOptionsCPT search options: Array<{code, label}>; default []
attributetitleHeading; default "Visit Note"
attributemetaDate, place and template line ("10/09/2026 10:30 AM . Main Street Clinic . Primary Care SOAP"); default none
attributesignedSigned and locked (controlled); default uncontrolled
attributedefault-signed / defaultSignedInitially signed (uncontrolled); default false
attributeread-only / readOnlyLock banner for roles without Edit clinical chart; default false
attributelock-text / lockTextLock banner text when readOnly; default "Your role can view this note but not edit it."
attributedefault-checked / defaultChecked
property / JSON attributedefault-value / defaultValue
attributeauto-focus / autoFocus
eventco-diagnoses-changeCalled when a diagnosis is added or removed; default none (React: onDiagnosesChange)
eventco-procedures-changeCalled when a procedure is added or removed; default none (React: onProceduresChange)
eventco-signSign Note; default none (React: onSign)
eventco-ai-draftShows Draft with AI Scribe, which calls this; default none (React: onAiDraft)
eventco-save-draftSave Draft; default none (React: onSaveDraft)
eventco-section-changeCalled with the section id and its new text as the user types or accepts an AI draft; default none (React: onSectionChange)