Audit Trail · O301

GSoC 2026 · OpenMRS · End-term evaluation

Native O3 Frontend
for the Audit Trail

Seeing who changed what, and when — natively in OpenMRS 3, for administrators and at the bedside.

Raj· GSoC 2026 Contributor · mentors Oliver & Manoj
scroll

One module, two views of the truth

A single OpenMRS 3 microfrontend surfaces the audit trail in the two places it's needed — system-wide for admins, and per-patient in the chart.

For administrators

Audit Log Dashboard

A system-wide view of every recorded change.

  • Filter by entity type, user, and date range
  • Colour-coded Created / Updated / Deleted events
  • Field-level diffs and one-click CSV export

In the patient chart

Patient Audit History

The same history, focused on one patient.

  • A new "Audit History" tab in the chart
  • Every revision that touched the patient, newest first
  • Field-level diffs plus related records changed in the same save
Part 1

The Audit Log Dashboard

A system-wide window into every change — built for administrators.

Part 1 · Where it lives

One click from System Administration

The dashboard registers itself as an "Audit Logs" card on the System Administration page.

  • Plugs in purely through routes.json
  • No changes to the admin-tools app required
localhost:8082/openmrs/spa/home/administration
System Administration page with the Audit Logs card

Part 1 · The dashboard

Search-first by design

The audit log can hold millions of revisions, so it never dumps everything at once. You start by filtering — and results appear only then.

  • Filter by entity type, username, or date range
  • Filters live in the URL — every view is shareable and survives a refresh
localhost:8082/openmrs/spa/audit-logs
Audit Log Dashboard search-first empty state

Part 1 · Results

Who changed what, at a glance

Every matching revision in a clean table — the entity, the event, who made the change, and exactly when.

  • Events colour-coded: Created, Updated, Deleted
  • Server-side pagination keeps large logs fast
localhost:8082/openmrs/spa/audit-logs?entityType=Patient
Audit Log Dashboard filtered results with colour-coded event tags

Part 1 · Field-level detail

Down to the exact field

Expand any row to see the field-level diff — every changed field with its value before and after.

  • Old value → new value, side by side
  • No more guessing what actually changed in a save
localhost:8082/openmrs/spa/audit-logs?entityType=Patient
Expanded audit log row showing field-level before and after diff

Part 1 · Export

Export the whole filtered set

One click streams a CSV of every matching revision — not just the page on screen — generated server-side.

  • Long format: one row per changed field, ready for audit
  • Formula-injection guarded — safe to open in Excel
New since mid-term
localhost:8082/openmrs/spa/audit-logs?entityType=Patient
Audit Log Dashboard with the Export to CSV button and success toast
Part 2

Patient Audit History

The same trail, focused on one patient — right inside the chart.

Part 2 · The tab

History, per patient

A new "Audit History" tab in the patient chart shows every audited change that touched this patient, newest first.

  • Same colour-coded events as the dashboard
  • A per-revision count of what changed
  • Loads safely even if the backend module is absent
localhost:8082/openmrs/spa/patient/…/chart/audit-history
Patient chart Audit History tab with the revision list

Part 2 · Field-level detail

The same diffs, in the chart

Expand a revision to see exactly what changed on the patient record — old → new — without leaving the chart.

  • Field-by-field before and after
  • Clear tags for new records and deletions
localhost:8082/openmrs/spa/patient/…/chart/audit-history
Expanded patient revision showing field-level diff

Minimal footprint, full coverage

Two features, one lightweight module — and nothing else in OpenMRS 3 had to change to make room for it.

2
Places you see the trail — system-wide & per patient
1
Microfrontend module carrying both features
0
Changes to the admin-tools or patient-chart apps
3
Event types, colour-coded — Created, Updated, Deleted

How it works

Built the OpenMRS 3 way

React + TypeScript OpenMRS ESM framework Carbon Design System SWR data fetching i18n / translatable auditlogweb · Hibernate Envers REST · /ws/rest/v1/auditlogs

One microfrontend, two features. Both live in a single module and plug in purely through routes.json — the admin card into the System Administration slot, the patient tab into the chart — so neither the admin-tools nor patient-chart apps need to change.

What's next

Roadmap

A strong v1 is in place — here's where it goes next.

Column sorting on the dashboard table
Fuller localisation across the UI
Backend date & user filters on the patient endpoint
Richer before → after detail for related records
Merged into one standalone app · iterating with mentor feedback

Thank you

To the OpenMRS community, and to my mentors Oliver & Manoj — thank you for the guidance.

— Raj