In America, the often-criticized criminal justice and health care systems are deeply intertwined.

And in Multnomah County, taxpayers are now on the hook for nearly $1 million more than budgeted this year to pay for jail inmates’ trips to the hospital for care beyond what the in-house staff can provide.

“A handful of people can make a big difference,” says Joanne Fuller, director of the Multnomah County Health Department (MCHD), which oversees inmate healthcare. “Hospitals are expensive!”

Last week, the Multnomah County Board of Commissioners voted unanimously to tack $900,000 of general fund money on to MCHD’s “corrections health” budget—a necessity in order to keep the department from closing out the fiscal year in the red.

The department expects to spend about $19.3 million this year for inmate healthcare-related expenses, including $2 million to compensate local hospitals that care for its inmates. That’s roughly double the amount budgeted for so-called “outsourced” care—and the reasons have reverberations in the ongoing national healthcare debate.

“This year we’ve seen an increase in inmates going to the hospital, and inmates who don’t have Medicaid coverage or are ineligible for Medicaid requiring hospitalization,” Wendy Lear, business services director for the health department, told the county board last week. “So we’ve spent more than we anticipated in outside medical costs.”

Funding for inmate healthcare can be complicated, but the crux of the county’s million-dollar issue is this: If after a health screening in jail, a person requires more medical attention than what on-site nurses can provide, they’re taken to a hospital. And somebody’s got to pay for it.

Under the Affordable Care Act (ACA), also known as Obamacare, if the inmate stays at the hospital for less than 24 hours, the county is on the hook for the medical bills. If the stay is longer than 24 hours, Medicaid, via the Oregon Health Plan (OHP), picks up the tab for those who are eligible.

That doesn’t always work out in the county’s favor. This year’s ballooned costs were partly the result of a handful of tough cases, and an increase in people being released before the 24-hour threshold, officials say.

“One we diagnosed with cancer while he was incarcerated and he required ongoing chemotherapy,” Dr. Michael Seale, the county’s interim director of corrections health, told commissioners at last Thursday’s meeting. The incarcerated cancer patient wasn’t Medicaid-eligible, he said.

A second inmate had gunshot wounds when he was arrested. “His care was $70,000 in and of itself and he was not eligible for Medicaid,” Seale said.

Despite these outliers, the county’s outsourced medical costs were higher before the ACA’s Medicaid expansion kicked in a few years ago, when the county was responsible for all hospital costs, Fuller says.

That system could return soon, officials fear, as senate Republicans work behind closed doors to gut Obamacare with a bill that has yet to see the light of day.

“If the ACA gets dumped around with, then we’re back on the hook for all the costs of care, whether it’s less or more than 24 hours,” Fuller says.

Even with Medicaid assistance, this fiscal year will be uniquely costly in terms of inmate healthcare, according to budget and expenditure figures from the last 12 years.

Though the figures don’t differentiate between in-house and out-of-jail medical costs, MCHD spent between $13.4 million and $14.12 million a year on corrections health from 2006 to 2011. Between 2012 and 2015, the department spent between $15.2 million and $15.8 million. Last year—after the Medicaid expansion—it spent $17.1 million. And this year, it’s expected the department will spend $19.3 million. (In years prior to the ACA, a bigger slice of the budget went to out-of-jail medical costs, Fuller says.)

When entering a county jail—either the Multnomah County Detention Center downtown, or the Inverness Jail in Northeast Portland—inmates are screened for physical and mental health problems. The jails have dental and X-ray equipment, lab tests are sent to national labs, and there are on-site services for orthopedics and gynecology at both jails, Seale says.

The jails do another physical and mental health screening after an inmate has been locked up for 14 days.

According to a 2016 Multnomah County grand jury report, clinics at the two jails are only open five hours per day, and inmates have to pay $10 for a “medical request form” for care beyond the screenings—a cost intended to cut down on frivolous health complaints, but which has generated concern about inmates not seeking needed care.

There are plenty of services the jail can’t provide, of course. Fuller runs down a partial list that includes broken bones, heart attacks, serious head injuries and kidney dialysis.

If a person entering the jail was injured during arrest, Lear explained, then the arresting department is on the hook for the cost. The Portland Police Bureau sometimes wrongly sends the county a bill for healthcare, she said, but the county sends those back.

Only a “very small” portion of those jailed in Multnomah County have private health insurance, Seale said Thursday. Lear adds that many policies have clauses prohibiting use while policyholders are incarcerated.

Next year, with the hopes of keeping inmate healthcare costs down—or at least predictable—the county plans to contract with a company called Correctional Health Partners (CHP), “a third-party claims administrator who gets preferential rates from hospitals and healthcare providers,” Lear told commissioners last week.

The county will pay CHP a flat fee and then receive reduced rates when inmates need outside care, which will limit the “outlier” cases. That means an incarcerated cancer patient or gunshot victim shouldn’t send the county scrambling in the future.