Better URL paths in O3
Hi, all!
It’s about time we spoke about URL paths in O3. Currently, because of the way URL paths are set up in O3, we’ve ended up with a situation where URL encoded characters appear in the URL path. This is not ideal, and we should fix it. Examples of URL paths in O3 that don’t conform to best practice are:
Vitals%20%26%20Biometricsfor the vitals and biometrics pagePatient%20Summaryfor the summary pageAllergies,Medications,Programs, and so on
Best practice dictates that URL paths should be as clean as possible. They should not contain URL encoded characters, spaces, or ampersands. Using lowercase words separated by hyphens allows for consistency and readability.
The new paths will be:
| Before | After |
|---|---|
| Patient Summary | patient-summary |
| Vitals & Biometrics | vitals-and-biometrics |
| Billing history | billing-history |
| Appointments | appointments |
| Visits | visits |
| Results | results |
| Medications | medications |
| Allergies | allergies |
| Conditions | conditions |
| Programs | programs |
| Orders | orders |
| Immunizations | immunizations |
| Attachments | attachments |
| Encounters | encounters |
What needs to change
- The
pathproperty indashboard.meta.tsfiles and matchingroutes.jsonmeta definitions for each dashboard package - Hard-coded
/chart/...URLs in component files (e.g. “See all” links in overview widgets) - E2E test page objects and unit tests that reference the old paths
- A legacy alias map in
chart-review.component.tsxto ensure old URLs continue to resolve correctly
Backward compatibility
A legacyPathAliases map in ChartReview ensures that existing bookmarks, shared links, and external references using the old paths still resolve to the correct dashboard. Old URLs will not break.
How will this affect you?
If you maintain code outside of our key repositories that builds URLs to patient chart dashboards (e.g. /patient/{uuid}/chart/Allergies), those URLs will still work via the alias map, but you should update them to use the new lowercase paths when convenient.
Implementer frontend configs that define custom dashboards with their own path values are not affected, since the config overrides the default.
I will also communicate about the change in the #openmrs3 channel on Slack.
Happy coding!