Note Lifecycle Example | Canvas Medical

ruibatistacanvas/note-lifecycle-example

note-lifecycle-example

Plugin-driven, state-responsive action buttons for the note footer.

What it does

This plugin replaces the note footer's built-in state buttons (Sign, Lock, Unlock, Push charges, Check in, No show, Cancel, Delete, Restore, Discharge) with buttons owned by the plugin. Each button knows the single note state it moves the note into, and it only appears when that move is actually allowed from the note's current state. As the note changes state, the footer refreshes on its own, so a provider only ever sees the actions that make sense right now — no page reload required.

Problem it solves

The native note footer shows a fixed set of state buttons and there's no built-in way to tailor them. If you want to relabel an action, restyle it, or gate it behind an extra condition (for example, hide Sign until every staged command has been committed), your only options today are to fork the EHR UI or train staff to ignore buttons that don't apply. This plugin moves control of the note-lifecycle buttons into plugin code, where each button's label, color, and visibility can be customized — while still mirroring the native lifecycle by default.

Who it's for

How to install

canvas install note_lifecycle_example

No additional setup is required — the plugin starts hiding the native state buttons and showing its own as soon as it's installed.

Configuration options

None. The plugin has no secrets or settings. Customization is done in code: each button is a small NoteStateActionButton subclass in handlers/footer_buttons.py, so you change a label via BUTTON_TITLE, colors via BUTTON_TEXT_COLOR / BUTTON_BACKGROUND_COLOR, and visibility by overriding visible().

How it works

CANVAS_MANIFEST

The CANVAS_MANIFEST.json registers the footer buttons, both reload handlers (ReloadFooterOnNoteStateChange and ReloadFooterOnCommandChange), and the footer-configuration handler. Update it if you add, remove, or rename handler classes.