Introducing the 4-Month AI FrameworkRead the guide
Case StudiesFintech · Legacy Modernization

Legacy System Modernization a Lien Funder

A 15-year-old PHP platform rebuilt on .NET 8 and Angular in 4 months

Client

Medical lien funder (name withheld)

Headquarters

United States

Timeline

4 months

Technology

LEGACY MODERNIZATION

Legacy System Modernization for a Lien Funder case study by EdgeFirm

15

years of production data migrated with no schema changes

99

calculation differences found and fixed against the legacy system

134 to 2

seconds on the slowest financial report

22

of 25 calculation areas now match the legacy system exactly

At a glance

The challenge

An aging PHP platform holding 15 years of lien, settlement and patient records, with money calculations that had to stay exact to the cent

The solution

A full rebuild on .NET 8 and Angular, proven against the legacy system line by line, then secured for patient privacy and deployed on AWS

The results

  • 15 years of production data migrated with no schema changes
  • 99 calculation differences found and fixed against the legacy system
  • 134 to 2 seconds on the slowest financial report
  • 22 of 25 calculation areas now match the legacy system exactly
The problem

A Platform Too Important to Rewrite Carelessly

This legacy system modernization moved a medical lien funder's 15-year-old platform from PHP to .NET 8 and Angular in 4 months.

The client funds medical treatment for people injured in accidents. When a patient cannot pay for surgery or therapy up front, the client buys the medical provider's bill as a lien and is repaid when the patient's legal case settles. Every lien passes through underwriting, partner funding, broker commissions, tranche accounting and, finally, settlement, where the proceeds are split between funders, providers and brokers.

For 15 years all of this ran on a PHP application built on the Yii 1.1 framework. It worked, but it had become hard to change. The framework was long out of support, some of its encryption depended on a PHP extension removed years ago, and every new feature risked disturbing calculations the business relied on to pay real money to real partners.

The database was the most valuable asset. It held close to 200,000 liens, more than 650,000 stored documents and millions of financial transactions, used daily by staff, partners, law firms, medical providers and patients. Any replacement had to read that data exactly as it was, with no changes to its structure, because the old system would keep running against the same database during the transition.

The hard part was the arithmetic. Settlement splits, hurdle thresholds, cost basis and partner payouts had been refined over a decade, often in ways nobody had written down. A rewrite that was almost right would be worse than no rewrite. In lending, a one-cent rounding difference repeated across thousands of liens becomes a reconciliation problem, and a wrong split pays the wrong party.

The client asked EdgeFirm to complete the migration, prove that the new system matched the old one, and take it to production on AWS.

Scope of work

4 capabilities carried the build

We rebuilt the back end as a C# and .NET 8 API and the front end as an Angular single-page application. Four workstreams carried the project.

01

Platform rebuild on .NET 8 and Angular

lien management, case and patient records, underwriting, partner and broker payments, settlements, document generation and more than a hundred reporting grids. The new platform works directly on the existing MySQL database with no schema changes, applies role-based access for administrators, partners, brokers, law firms, medical providers, signers and patients, and adds sorting, filtering and whole-result totals to every financial grid. PDFs for purchase agreements, notices and reports were rebuilt on an open-source rendering stack, and bulk tools now cover the weekly close, including settlement imports from spreadsheets, check assignment and partner payments.

02

Financial calculation parity

instead of trusting unit tests alone, we built a comparison tool that runs the original PHP code against the same database and compares its output with the new system, column by column. We audited 25 calculation areas, found 95 differences and 16 more while fixing them, and resolved all 99. Exact matches went from 3 areas to 22. The checks cover settlement scenarios, medical tranche hurdle splits, cost basis, partner and broker payouts, cross-collateral allocation, XIRR and every major report. One regression command now compares more than 53,000 values before each release.

03

Patient data privacy and security

the platform holds medical and personal information, so the code and the AWS setup were built to meet HIPAA safeguards and we treated every place data could leave the database as something to control. Logs are scrubbed of patient details and credentials, with automated checks that fail the build if a new log line could expose them. Session tokens are stored only as one-way hashes, every record has a patient-level access check, and an audit trail records who changed what with sensitive values redacted. Search terms and filters stay out of browser addresses, history and server logs, and production runs on HTTPS with automatically renewed certificates. EdgeFirm did the work under a signed business associate agreement and carries cyber insurance.

04

Cloud deployment and support tooling

we moved the platform from a single developer server to separate development and production environments on AWS. It deploys as containers to Elastic Beanstalk, with versioned database migrations run as a controlled deploy step. GitHub Actions pipelines sign in to AWS with short-lived credentials instead of stored keys. Application logs are searchable in OpenSearch with a correlation ID on every request, and an in-app Report an issue button opens a pre-filled Jira Service Management ticket that support can trace to the logs without exposing patient data.

Technology

The stack behind it

C#, .NET 8, Angular, MySQL, AWS Elastic Beanstalk, GitHub Actions

AWSAWS

Back end

C#, .NET 8, ASP.NET Core, Entity Framework Core, Dapper and Serilog

Front end

Angular, TypeScript and TanStack Table

Data

MySQL 8 with DbUp versioned migrations

Cloud and infrastructure

AWS Elastic Beanstalk, Amazon RDS, S3, EC2, CloudWatch and OpenSearch, plus Docker and Caddy with Let's Encrypt

Delivery and quality

GitHub Actions with OIDC, xUnit, a PHP comparison tool and automated code checks

Integrations

Jira Service Management, DocuSign, Twilio and headless Chrome PDF rendering

How we built it

Our development process

Month 1

discovery and parity audit

we mapped the old system screen by screen and traced every calculation back to its source. A full static audit compared each formula in the PHP code with its C# counterpart and produced a ranked list of differences, ordered by how much money each could move.

Month 2

calculation fixes

we worked through the findings in ten phases, highest risk first, starting with settlement transactions, lien reporting, partner reports, medical tranche splits and underwriting. Each fix had to pass unit tests, a real call to the running API and a column-by-column comparison with the PHP output. Where the old system was itself inconsistent, we documented the behavior and asked the client to decide instead of guessing.

Month 3

performance, usability and privacy

with the numbers proven, we restored sorting and totals on every grid, fixed date handling across time zones, removed bottlenecks that made key screens slow, and reviewed logs, audit records, browser storage and web addresses for patient data.

Month 4

cloud rollout and production

we deployed to the development and production environments on AWS, turned on HTTPS, connected log search and support ticketing, and ran a final check of every environment before handover.

Transparency

Every finding was written up in plain language with the evidence behind it before any change was made. The client compared results on real data and approved each business decision, and a project log recorded every decision so nothing depended on memory.

After launch

After launch we kept supporting the business team through user acceptance testing, built realistic test data from their spreadsheets, answered reconciliation questions and shipped refinements requested by the people who run the weekly close.

Next steps

Planned work includes retiring the old PHP system once all users have moved over, wider self-service reporting for funding partners, and more automation of the weekly settlement and payment workflow.

After launch

What changed after launch

Calculations that can be checked

22 of 25 audited calculation areas match the legacy system exactly, up from 3 at the start. The comparison tool reruns more than 53,000 value comparisons before each release.

Faster daily work

The Journal Entry report dropped from over two minutes to about two seconds. Bulk check assignment runs twice as fast, and a configuration fault that added more than four seconds to every request was found and removed. These timings were measured by EdgeFirm.

Patient data protected by design

Patient information stays inside the database. Logs, error reports and support tickets carry references instead of personal details.

A platform the team can change safely

More than 1,400 automated tests, a one-command regression suite and automated pipelines let new features ship without putting historical data or calculations at risk.

The client now runs on a supportable platform that keeps 15 years of financial history intact and reproduces the business rules its partners depend on. The team has the speed and the safety net to keep improving it.

Talk to the founders

Get AI live in months, not years.

Book a 30-minute strategy call with the founders who will write your code.