In a non-emergency situation, you can certainly try to read up on your own, but the medical literature is not always easy to interpret. A friend of mine asked for advice after he was diagnosed with Parkinson's Disease. Despite having a PhD in neuroscience and working as a researcher in a PD Center of Excellence, I had a really hard time making a recommendation. (Neuro conditions are particularly hard, but this is also possibly the best-case match with my experience).
He readily admitted that the hospital has a very poor grasp on their own costs. At a high-level, they just charge as much as they can - sometimes they lose money, sometimes they make a 90% profit. They pool it all together (usually by line of business) and hope it all works out as a profit.
That’s why specialized, stand alone clinics (e.g. MRI clinic) have some of the best prices. They know exactly what things cost and can make sure prices reflect it.
Even then though, making prices transparent wouldn’t address the primary scenario that results in personal bankruptcy, which is emergency care. You can’t exactly shop around for the cheapest ER facility if you’re bleeding from a gunshot wound.