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
Read Only
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
| Variant | What it is |
|---|---|
| draft | Editable sections, Save Draft, Sign Note. |
| ai section | AI Scribe draft with Accept and Edit. |
| required / error | Badge and field error per section. |
| signed | Locked, addendum note. |
| readOnly | Lock 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
| Prop | Type | Default | Description |
|---|---|---|---|
sections * | VisitNoteSection[] | — | Array<{id, title, text?, ai?, required?, error?, rows?}>; required |
diagnoses | VisitNoteCode[] | uncontrolled | Diagnoses on the note (controlled) |
defaultDiagnoses | VisitNoteCode[] | [] | Initial diagnoses (uncontrolled) |
onDiagnosesChange | (codes: VisitNoteCode[]) => void | none | Called when a diagnosis is added or removed |
procedures | VisitNoteCode[] | uncontrolled | Procedures on the note (controlled) |
defaultProcedures | VisitNoteCode[] | [] | Initial procedures (uncontrolled) |
onProceduresChange | (codes: VisitNoteCode[]) => void | none | Called when a procedure is added or removed |
icdOptions | VisitNoteCode[] | [] | ICD-10 search options: Array<{code, label}> |
cptOptions | VisitNoteCode[] | [] | CPT search options: Array<{code, label}> |
title | string | "Visit Note" | Heading |
meta | string | none | Date, place and template line ("10/09/2026 10:30 AM . Main Street Clinic . Primary Care SOAP") |
signed | boolean | uncontrolled | Signed and locked (controlled) |
defaultSigned | boolean | false | Initially signed (uncontrolled) |
readOnly | boolean | false | Lock banner for roles without Edit clinical chart |
lockText | string | "Your role can view this note but not edit it." | Lock banner text when readOnly |
onSign | () => void | none | Sign Note |
onAiDraft | () => void | none | Shows Draft with AI Scribe, which calls this |
onSaveDraft | () => void | none | Save Draft |
onSectionChange | (id: string, text: string) => void | none | Called 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>
| Kind | Name | Description |
|---|---|---|
| property / JSON attribute | sections | Array<{id, title, text?, ai?, required?, error?, rows?}>; required |
| property / JSON attribute | diagnoses | Diagnoses on the note (controlled); default uncontrolled |
| property / JSON attribute | default-diagnoses / defaultDiagnoses | Initial diagnoses (uncontrolled); default [] |
| property / JSON attribute | procedures | Procedures on the note (controlled); default uncontrolled |
| property / JSON attribute | default-procedures / defaultProcedures | Initial procedures (uncontrolled); default [] |
| property / JSON attribute | icd-options / icdOptions | ICD-10 search options: Array<{code, label}>; default [] |
| property / JSON attribute | cpt-options / cptOptions | CPT search options: Array<{code, label}>; default [] |
| attribute | title | Heading; default "Visit Note" |
| attribute | meta | Date, place and template line ("10/09/2026 10:30 AM . Main Street Clinic . Primary Care SOAP"); default none |
| attribute | signed | Signed and locked (controlled); default uncontrolled |
| attribute | default-signed / defaultSigned | Initially signed (uncontrolled); default false |
| attribute | read-only / readOnly | Lock banner for roles without Edit clinical chart; default false |
| attribute | lock-text / lockText | Lock banner text when readOnly; default "Your role can view this note but not edit it." |
| attribute | default-checked / defaultChecked | |
| property / JSON attribute | default-value / defaultValue | |
| attribute | auto-focus / autoFocus | |
| event | co-diagnoses-change | Called when a diagnosis is added or removed; default none (React: onDiagnosesChange) |
| event | co-procedures-change | Called when a procedure is added or removed; default none (React: onProceduresChange) |
| event | co-sign | Sign Note; default none (React: onSign) |
| event | co-ai-draft | Shows Draft with AI Scribe, which calls this; default none (React: onAiDraft) |
| event | co-save-draft | Save Draft; default none (React: onSaveDraft) |
| event | co-section-change | Called with the section id and its new text as the user types or accepts an AI draft; default none (React: onSectionChange) |