The emergency measure will free up at least 30,000 beds to help the NHS to tackle coronavirus.