Skip to content

Feat: Add oma uninsured service fees to private billing form#114

Merged
lacarmen merged 3 commits intoMagentaHealth:release/2026-03-17from
openo-beta:feat/add-oma-uninsured-service-fees-private-billing-base-release
Apr 8, 2026
Merged

Feat: Add oma uninsured service fees to private billing form#114
lacarmen merged 3 commits intoMagentaHealth:release/2026-03-17from
openo-beta:feat/add-oma-uninsured-service-fees-private-billing-base-release

Conversation

@LiamStanziani
Copy link
Copy Markdown
Collaborator

@LiamStanziani LiamStanziani commented Apr 8, 2026

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):

  • 34 billing service codes added to billingservice table with OMA-recommended fees ($7.65–$350.00)
  • 33 form mappings added to ctl_billingservice table, organized into three groups on the PRIVATE billing form:
    • Forms (Group1) — sick notes, insurance forms, driver's exams, records transfer
    • Assessments (Group2) — general/intermediate assessments, medical reports, disability evaluations
    • Procedures (Group3) — urinalysis, dispensing fee
  • Migration script uses INSERT IGNORE for safe re-runs on existing databases
  • Service codes use OMA prefix following the private billing underscore convention
image image

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:

  • Pre-populate 34 OMA uninsured service billing codes in the Ontario billingservice seed data with recommended fees.
  • Expose OMA uninsured service codes on the PRIVATE billing form, organized into forms, assessments, and procedures groups.

Enhancements:

  • Introduce a database update script that adds the OMA uninsured service codes, maps them to PRIVATE billing form groups, and deactivates legacy placeholder PRIVATE mappings.

…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
@LiamStanziani LiamStanziani self-assigned this Apr 8, 2026
@LiamStanziani LiamStanziani marked this pull request as ready for review April 8, 2026 15:22
@sourcery-ai
Copy link
Copy Markdown

sourcery-ai bot commented Apr 8, 2026

Reviewer's Guide

Seeds 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 tables

erDiagram
  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"
  }
Loading

File-Level Changes

Change Details Files
Seed OMA uninsured service fee billing codes and map them onto the Ontario PRIVATE billing form for both new and existing installations.
  • Add 34 OMA prefixed uninsured service fee entries with OMA-recommended pricing into the Ontario oscardata_on.sql billingservice seed data, using future-effective billing dates and non-terminated ranges.
  • Replace legacy placeholder PRIVATE ctl_billingservice mappings with explicit mappings from OMA codes into three logical groups (Forms, Assessments, Procedures) with defined ordering for Ontario.
  • Introduce a database update script (update-2026-03-24-oma-uninsured-service-fees.sql) that deactivates existing placeholder PRIVATE entries, inserts the same 34 OMA billingservice rows with region=NULL, and creates the corresponding PRIVATE form mappings for in-place upgrades.
database/mysql/oscardata_on.sql
database/mysql/updates/update-2026-03-24-oma-uninsured-service-fees.sql

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

Copy link
Copy Markdown

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@LiamStanziani LiamStanziani requested a review from lacarmen April 8, 2026 15:26
@lacarmen lacarmen merged commit 924eee3 into MagentaHealth:release/2026-03-17 Apr 8, 2026
2 of 4 checks passed
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.

2 participants