Skip to content

Add rx-history plugin - #396

Open
milosdjakovic-vicert wants to merge 1 commit into
Medical-Software-Foundation:mainfrom
vicert-healthcare:vicert/rx-history
Open

Add rx-history plugin#396
milosdjakovic-vicert wants to merge 1 commit into
Medical-Software-Foundation:mainfrom
vicert-healthcare:vicert/rx-history

Conversation

@milosdjakovic-vicert

Copy link
Copy Markdown
Contributor

What it does

rx-history automates Surescripts medication history for upcoming appointments and surfaces it in the chart. Two daily cron tasks send Surescripts eligibility and medication history requests for patients with appointments 1 and 7 days out. A chart action button in the medications section opens a side panel that groups the returned history by drug, flags each row as matched or unmatched against the active medication list, and lets the provider add a missing medication to the open note or dismiss a row. A provider menu application opens a bulk requests page where staff trigger eligibility and medication history requests for any patient set inside a date range.

Problem it solves

At the point of care a provider often lacks a complete picture of what a patient is actually filling at the pharmacy. Surescripts holds that dispensed history, but pulling it by hand for each upcoming visit is slow and easy to forget. The plugin sends the requests automatically ahead of the appointment and lays the returned history next to the active medication list, so reconciliation gaps surface before the patient is in the room.

How it works

The two cron tasks run daily and fan out one request per eligible patient. The chart action button renders the comparison panel server side on click, so the panel does not wait on a fetch. The bulk page and the panel actions are backed by SimpleAPI endpoints under staff session auth. Adding a medication from the panel originates a MedicationStatementCommand on the open note. Each Surescripts row is matched against the active medication list by drug code rather than name, checking RxNorm CUI, then NDC on the digits only form, then an NDC to RxNorm cross reference through the FDB ontologies service. Matching flags a row but never suppresses it.

Configuration

The plugin owns the vicert__rx_history custom data namespace for its dismissal store. Set the namespace_read_write_access_key secret to the read and write key that Canvas generates when the plugin first installs. Manual and bulk requests are blocked unless the patient has a non cancelled appointment within a 7 day care event window.

Testing

The plugin ships a pytest suite covering the cron tasks, the action button and modal, the modal and bulk SimpleAPI endpoints, the dismissal store, and the static asset endpoint. All 109 tests pass and mypy is clean across 15 source files.

Automates Surescripts medication history requests for upcoming appointments
and surfaces the returned history in the patient chart. Two daily cron tasks
send eligibility and medication history requests for patients with
appointments 1 and 7 days out. A chart action button opens a side panel that
groups the history by drug and flags each row as matched or unmatched against
the active medication list, with add to note and dismiss actions. A provider
menu application batches eligibility and medication history requests for a set
of appointments inside a date range.
@milosdjakovic-vicert
milosdjakovic-vicert marked this pull request as ready for review July 2, 2026 23:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant