If you discharge your medical expenses by bankruptcy, that will put a negative mark on your credit report for seven years that will have way more downside impact on your score than the upside of getting a small credit card or two.
You have to decide what’s more important. If you want to be free of this debt so you can start saving cash for the future, then take the bankruptcy. You won’t qualify for a mortgage for 5-7 years, and that will give you plenty of time to save a down payment. If you want a good credit score so that you can borrow more money in the near future at lower interest rates, then you should work as hard as you can to pay off your medical debts. If you get a small credit card account in the meantime for regular purchases, that will help you in the long run as long as you pay the balance in full every month.