Analysis of NHS data found a change in the law in March has achieved its aim of prioritising medics trained in the NHS over those who trained overseas