Feat: Add oma uninsured service fees to private billing form#114
Merged
lacarmen merged 3 commits intoMagentaHealth:release/2026-03-17from Apr 8, 2026
Conversation
…and initial test data to be replaced with the new data added into ctl_billingservice, archived if using migration file to avoid removing anything that uses the same values that are not test data
Reviewer's GuideSeeds Ontario OMA uninsured service fee codes into the billingservice table and maps them to the PRIVATE billing form, including an update script for existing installations and inline seed data for new ones, while deactivating legacy placeholder PRIVATE mappings. ER diagram for OMA uninsured service fee tableserDiagram
billingservice {
varchar service_code
varchar service_compositecode
varchar description
decimal value
decimal percentage
date billingservice_date
varchar specialty
varchar region
varchar anaesthesia
date termination_date
varchar displaystyle
boolean sliFlag
boolean gstFlag
}
ctl_billingservice {
int id
varchar servicetype_name
varchar servicetype
varchar service_code
varchar service_group_name
varchar service_group
char status
int service_order
}
billingservice ||--o{ ctl_billingservice : maps_to
billingservice {
varchar service_code_OMA "_OMA_* uninsured service codes added"
}
ctl_billingservice {
varchar service_code_PRIVATE "PRIVATE form mappings for _OMA_* codes"
}
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The update script comments mention safe re-runs, but the
INSERT INTO billingservice/ctl_billingservicestatements don’t useINSERT IGNOREor an equivalent conflict strategy, so a re-run on a DB where some codes already exist will likely fail with duplicate key errors; consider addingINSERT IGNOREorON DUPLICATE KEYhandling for idempotency. - The OMA uninsured fee definitions and mappings are duplicated verbatim between
oscardata_on.sqlandupdate-2026-03-24-oma-uninsured-service-fees.sql; it might be worth centralizing these values (or at least adding a clear comment/link between them) to reduce the risk of the seed script and update script drifting out of sync when fees or descriptions change.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The update script comments mention safe re-runs, but the `INSERT INTO billingservice`/`ctl_billingservice` statements don’t use `INSERT IGNORE` or an equivalent conflict strategy, so a re-run on a DB where some codes already exist will likely fail with duplicate key errors; consider adding `INSERT IGNORE` or `ON DUPLICATE KEY` handling for idempotency.
- The OMA uninsured fee definitions and mappings are duplicated verbatim between `oscardata_on.sql` and `update-2026-03-24-oma-uninsured-service-fees.sql`; it might be worth centralizing these values (or at least adding a clear comment/link between them) to reduce the risk of the seed script and update script drifting out of sync when fees or descriptions change.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
924eee3
into
MagentaHealth:release/2026-03-17
2 of 4 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add OMA (Ontario Medical Association) uninsured services fees to the Ontario private billing form to satisfy OMD conformance requirement PC13.19.
Original PR: openo-beta#2383
Problem
The EMR must provide access to OMA uninsured service fees per OMD conformance requirement PC13.19. Currently, Ontario clinics have no pre-populated private billing codes and must manually enter each one through the billing admin UI.
Solution
Add 34 OMA fee codes as seed data in both the migration script (for existing installations) and the Ontario init script (for new installations):
Summary by Sourcery
Seed Ontario private billing with OMA uninsured service fees and map them to the PRIVATE billing form for OMD conformance.
New Features:
Enhancements: