The possibility of not being able to pay your medical bill is one of the last things on your mind when you’re at a hospital emergency room.

And how that unpaid medical bill could affect your credit score is probably much less of a concern.

But even a hospital visit that isn’t an emergency but is still unexpected can result in a large medical bill months after your health insurance — if you have it — covers its share of the bill.

If you don’t pay the bill or pay it late, it can go to collections and hurt a credit score.

Many people can’t afford a $400 emergency expense, according to a 2015 Federal Reserve report.

Such an expense would leave 46 percent of people unable to pay it or they’d have to borrow or sell something to do so, the report found.

Among people who wouldn’t pay the bill in full with cash, 38 percent would use a credit card and pay it off over time, and 31 percent simply couldn’t cover the expense.

Emergency room visits can be much more expensive than $400. A survey by the Kaiser Family Foundation and the New York Times found that among the insured and uninsured with medical bill problems, 31 percent said the total amount of the bills they had problems paying reached at least $5,000.

Thirteen percent said their medical bills totaled at least $10,000, and 24 percent said it was less than $1,000.

Late payments account for 35% of score

An unpaid medical bill can end up on your credit report in a few ways. Your doctor’s office may report a late payment or unpaid bill to the three major credit bureaus.

A large hospital may report the outstanding bill, but a small doctor’s office may not. If it goes to a collection agency, then the debt will likely show up on your credit report.

The largest part of a credit score is payment history. It accounts for 35 percent of a credit score, and shows if you’ve paid past credit accounts on time or missed payments entirely.

A huge drop in your credit score can cause you to be denied for credit cards and other loans, or can cause lenders to charge you higher interest rates.

Medical debts weighed less

Medical debts have less of an impact in credit scores from the Fair Isaac Corporation, or FICO, which are the most widely used. Most lenders in the U.S. use an older version of the FICO credit scoring system that doesn’t pay much attention to the type or balance of a collection.

Under the old system, a small, unpaid medical bill could hurt a credit score just as much as a larger debt.

The newest version of the FICO credit score, the FICO 9, and the VantageScore 3.0 are changing that calculation. Medical bills in collections now are less of a factor than other unpaid accounts. But not all lenders use the new scoring models.

FICO also changed how it deals with unpaid bills that have been settled. Overdue or delinquent bills that have gone to collections — which include significant medical debt — no longer count as unpaid bills once they’ve been settled.

Previously, if you paid an old medical bill that was in collections, it could still be calculated in a credit score as unpaid.

The new scoring system protections, however, don’t apply if you paid the medical bill with a credit card. If the credit card bill is paid late, your credit score could still be dinged.

Solving old debt

Legally, collections can only stay on a credit report for up to seven years. If you can wait that long, then the medical debt will go away and your credit score should gradually improve.

If you want your credit score to improve during those seven years, some lenders may want to see that you’re paying off collections that are less than seven years old. Others may not care and may continue denying you credit during the full seven years.

The more recent a collection is, the more it will hurt your FICO score. That affects your credit score more than if the debt was paid off, which may persuade you to pay off more recent medical debts and let old ones fall off your credit report.

You could also negotiate a deb settlement with the debt collector. Get the payment plan in writing and be sure that it releases you from the entire debt.

Without such documentation, any payment could be treated as a partial payment and the clock will reset the statute of limitations on how long you can be sued for an old debt. Most states set it at three to six years.

Another option is to contest any inaccurate medical debt. Check your credit reports and call the medical provider if a bill is wrong.