# VoiceChart Widget An **embeddable** version of VoiceChart's dictation panel — built to drop into the odontOS "Quick Note" card (and any future odontOS tenant), with **zero changes to the host app**. The host embeds one ` ``` `mount(target, opts)` returns an API: `vc.start()`, `vc.stop()`, `vc.clear()`, `vc.config({...})`, `vc.getNote()`, `vc.on('note', cb)`, `vc.destroy()`. ### Options | opt | meaning | |-----|---------| | `patient`, `patNum`, `provider` | echoed back on every note payload | | `theme` | CSS-token overrides: `accent`, `accentInk`, `accent2`, `text`, `text2`, `text3`, `field`, `border`, `bg`, `font`, `radius` | | `engine` | `'whisper'` (default, on-device/private) or `'webspeech'` | | `model` | Whisper model id (default `Xenova/whisper-tiny.en` — fastest first-load) | | `height` | iframe height (default `340px`) | | `src` | override the widget app URL (defaults next to the loader script) | | `onNote`, `onReady` | callbacks | ### `onNote` payload ```js { type: 'voicechart:note', plainText: 'Tooth 5: mesial occlusal caries.\n\nPeriodontal: 4mm pocket distal.', sections: [ { label: 'Tooth 5', tooth: 5, text: 'mesial occlusal caries.' }, … ], patient: 'Isabella Moreau', patNum: '10428', durationSec: 41.2, ts: 1750000000000 } ``` ## Voice commands (same as the app) “start patient note” · “tooth 5” · “next tooth” · “section perio” · “scratch that” · “new line” / “new paragraph” · “period” / “comma” / “question mark” · “end patient note”. ## Integrating into the real odontOS demo (when ready) In a **copy** of `odontos.io/TetriSmile_Odontos.html`, the Quick Note card is built around the `note.innerHTML = …` block (search for `Quick Note`). Replace the ` note.innerHTML = `

${svg('note')} Quick Note

`; right.appendChild(note); // once, after the dashboard mounts: VoiceChart.mount('#vc-quicknote', { patient: currentPatient.name, patNum: currentPatient.num, theme: { accent:'var(--accent)', field:'var(--field)' }, onNote: ({ plainText }) => savePatientNote(currentPatient, plainText) }); ``` …and add `` once. ## Hosting Deployed on its own origin, isolated from the app: **`https://widget.voicechart.io/`** (loader at `/voicechart-widget.js`, iframe app at `/app/`, this demo at `/demo/`). Mic permission is granted to the iframe via `allow="microphone"` (the loader sets it). On-device dictation keeps all audio local — a clean privacy boundary for PHI; the cross-origin iframe is an extra isolation layer between the host (odontOS) and the engine.