There are at least two ways to approach variable costs. One is to have a price to treat a condition, e.g. a hospital can charge $X for a pregnancy, regardless of whether it’s a C-section or a vaginal birth. The other is to allow the variable charge but to disclose it as it happens, just like auto shops do. If I see a doctor for $75, and the doctor determines that I need a $17 strep test, the doctor can tell me that the strep test is $17 before doing it.
This does impose an annoyance cost on every little charge, which I think is a good thing. If a medical practice really wants to charge for every piece of gauze they use, then this should annoy the patient up front so the practice has an incentive to stop doing it.