How to build a medical billing system
How a medical billing system turns care into paid claims, the payer rules it must follow, and an order to build it in.
What a medical billing system does
A medical billing system captures the charges for care, codes them, checks them against payer rules, sends claims, posts payments and works the denials. In many countries it also bills patients for their share.
Every market has its own codes, claim formats and payer schemes, so the core idea is the same but the rules are local: X12 claims in the US, case rates in the Philippines, national schemes elsewhere.
The modules you need
Most teams need all of these in the end. The phased plan below sets the order.
Charge capture
Charges from the clinical record, with nothing done but not billed.
Coding
Diagnosis and procedure codes suggested from the chart and confirmed by a coder.
Eligibility and authorisation
Checks that the patient is covered and the service is approved before it happens.
Claim scrubbing
Payer rules checked before submission, so errors are fixed before a denial.
Claims submission
Claims sent in each payer's format, with status tracked.
Remittance and posting
Payments and adjustments posted against each claim line.
Denials and appeals
Denials sorted by reason, worked in queues and appealed with evidence.
Patient billing
Statements, payment plans and online payment for the patient's share.
How the parts fit together
- 01
Claim lines as the core record
Each charge line carries its codes, payer, status and history from capture to payment.
- 02
Payer rules as configuration
Edits, fee schedules and scheme rules kept as versioned data per payer.
- 03
Clearinghouse adapters
One adapter per clearinghouse or payer gateway.
- 04
Work queues
Coding, scrubbing failures and denials routed to the right team.
- 05
Finance reporting
Ageing, collections and denial rates from a reporting copy.
Data model sketch
- 01
Encounter and charge line
What was done, by whom, when, and the codes for it.
- 02
Coverage
The patient's payers, plans, eligibility and authorisations.
- 03
Claim
Lines grouped into a claim for one payer, with submission history.
- 04
Remittance and adjustment
What the payer paid, adjusted or denied, line by line, with reason codes.
- 05
Patient account
The patient's balance, statements and payments.
Systems it has to talk to
- 01
EHR or practice system
Encounters, charges and documentation for coding.
- 02
Clearinghouses and payer portals
Eligibility, claims, status and remittance, such as X12 transactions in the US.
- 03
National schemes
Government insurance schemes with their own claim systems.
- 04
Payments
Card and bank payments for patient balances.
Rules to design for
Which rules apply depends on your market and product.
- 01
Standard transactions
In the US, HIPAA sets standard electronic transactions for claims and eligibility. Other countries have their own.
- 02
Coding rules
Code sets such as ICD-10 and local procedure codes, and the rules for using them.
- 03
Health data protection
Billing data is health data under HIPAA, the GDPR and national laws.
- 04
Patient billing rules
Rules on what patients may be charged, discounts that must be applied and how disputes are handled.
From prototype to production
Build in this order so something real is in users' hands early.
- 01
Clickable prototype
Charge review, coding and the denial queue, tried by billing staff.
- 02
First payer live
Charge capture, coding, claims and posting for the largest payer.
- 03
Scrubbing and denials
Payer rules before submission and denial management after.
- 04
More payers and patient billing
Remaining payers, patient statements and payments, and finance reporting.
What drives the cost
These decide most of the budget. For a number based on your own scope, use the cost tool. OceanLab bills $30-50/hr or per milestone.
- 01
Number of payers
Each payer or scheme has its own rules and formats.
- 02
Coding support
Assisted coding from the chart, and the review step around it.
- 03
Clearinghouse setup
Enrolment and testing with each clearinghouse or gateway.
- 04
Migration of open claims
Moving claims in flight without losing history.
- 05
Patient billing
Statements, payment plans and the support behind them.
Product builds that match this guide

Singil - Hospital Billing and Claims Platform for PhilHealth and HMOs
Designed and built a clickable billing and claims platform for a private hospital group in Quezon City, Cebu and Davao: patient accounts from first charge to zero balance, a bill that applies PhilHealth, senior and PWD discounts and HMO coverage in the right order, a discharge clearance board, and PhilHealth claims tracked against the filing deadline.

Qistas - Health Claims Adjudication with an Explanation on Every Line
Designed and built a clickable claims adjudication platform for a Saudi cooperative health insurer: claims arrive through NPHIES, from member reimbursements or on paper, a rules engine decides each line with a trace and a provider explanation in Arabic and English, and only uncertain lines reach a medical reviewer.
Two ways to work with OceanLab
Project build
We design and build the system as one project. It starts with a clickable prototype your team tries before any production code is written. Pay per milestone (outcome-based) or hourly at $30-50/hr, depending on role and seniority.
Embedded engineers
Our engineers join your team on a flexible monthly retainer. Part-time is fine and it runs month to month, with hours that overlap the US, UK and Europe, the Middle East, and Australia and Asia. Outcome-based or $30-50/hr.
Questions
Can AI do medical coding?
It can suggest codes from the chart and explain why. A certified coder confirms, especially for complex cases, and the system keeps who confirmed what.
How do you reduce denials?
By checking eligibility and payer rules before a claim goes out, and by sorting denials by reason so the root cause gets fixed, not just the claim.
Does the billing system replace our EHR?
No. It takes encounters and charges from the EHR or practice system and handles everything from coding to payment.