NHS loses millions of pounds annually due to obsolete law