I spent over a decade working on technology solutions to prevent medication errors in hospitals but the bottom line problems that make it a hard problem to solve are:
1. There is a culture of individual blame and so (certainly most) errors go un-reported at all. Systematic identification and process solution is still not healthy, despite 16 years having passed since IOM did an admirable job shining light on the problem [1]
2. There isn't strong enough motivation to fix. It's easier to not report medication errors than to fix them. You or someone you know has probably been victim of a medication given in error one way or another. You just aren't likely aware of it. Many errors aren't very serious, or result in lengthened hospital stays (which guess what!? the responsible institution probably gets paid for). Even the consequences of serious errors aren't often (maybe even usually) attributed to the source mistake.
Like many things, money has driven the status quo (more money in ignoring than acknowledging) and it'll drive the solution. Accountability and solutions to this problem will come in the form of payers [your insurance company] finding ways to measure and not reimburse for consequences of errors. Once that motivation exists in a major way solutions will show up very quickly... it's a non-trivial, but also sub-ridiculously-hard problem to solve, from a process/technical perspective.
[Edit: I've been out of this problem space for 6-7 years now (because fuck selling things to hospitals [2]) so would love to hear from anyone who knows whether things have changed significantly and my take is now wrong/dated.]
[1] https://iom.nationalacademies.org/~/media/Files/Report%20Fil...
[2] Not that it isn't super profitable - particularly if you spend way more on steak-dinner-sales than making shit that actually solves problems! An ironically terrible/frustrating market for anyone who actually cares about clinicians or patients, though.