Coding error blamed for NHS data sharing mistake affecting 150,000 patients