Hi everyone,
We wanted to quickly share our current thinking on a few implementation aspects and would really appreciate your feedback on the approach we’ve taken:
- Single Record & Unique Constraint: Planning a single record per user per orderable (
UNIQUE(user_id, orderable_uuid)) to handle both manual favoriting and future auto-population (usage-based) in the same row. - Handling Retired Drugs: Retired drugs would be filtered out at display time but kept in the database for audit/history, and would automatically reappear if un-retired. Still exploring the best UX (separate section vs optional view).
- Caching Strategy: Using
useSWRImmutablewith long-lived cache for favorites, since they only change on explicit user action, and invalidating viamutate()after star/unstar. - Module Delivery: Considering an
esm-favorites-appfor the frontend (within patient chart) and backend support in core, but open to better placement suggestions.
We’d love to hear your thoughts on whether these approaches align well with OpenMRS patterns, and if there are any pitfalls or preferred alternatives we should consider.
Thanks a lot! ![]()
@ibacher @dennis @veronica @nethmi @jayasanka @dkayiwa @grace @beryl