The U.S. government claimed that turning American medical charts into electronic records would make health care better, safer, and cheaper. Ten years and $36 billion later, the system is an unholy mess. A joint investigation by Kaiser Health News and Fortune found that instead of streamlining medicine, the government’s EHR initiative has created a host of largely unacknowledged patient safety risks. We found alarming reports of patient deaths, serious injuries and near misses — thousands of them — tied to software glitches, user errors or other flaws have piled up, largely unseen, in various government-funded and private repositories.