Thousands of patients will be affected by the government's attempts to"free up tens of thousands of spaces" in Wales.