That doesn't always work out as well as you might think. A number of years back Medicare told hospitals they'd no longer pay for UTI treatment, unless the provider could prove that the patient had the UTI when they were admitted. This made sense, because hospital-acquired UTI is a big thing.
The thing is, what hospitals had to do to defend against this was to test everybody being admitted to prove that they already had the UTI. So from Medicare's point of view they were saving, but from a broader perspective they were pushing unnecessary costs (unnecessary tests) onto providers which increased the total amount being spent on healthcare.