Now on to your question. A lot of the EHR systems have grown organically and in the end they are made by people with software experience but not per se medical experience.
Disclaimer first: I work on a competitor for Epic (Well, they only run in 3-4 hospitals in my country and we run in 30, so they're not really a threat). And I'm not saying we are doing it better than Epic, but these are a few of my thoughts (loosely collected).
1) Most of us don't have medical training. Our campus is shared by a university / hospital, so we do have access to a lot of doctors and when they work with us, their sides of the program tend to run quite well. But, not all doctors want to spend time on this (understandable) so one system might be well tailored for doctor A, but not to Doctor B.
2) The systems are _old_. They grow organically, but Epic is a few decades old and our system started in 1992, so it's by no means 'young' either. The Medical field evolves and so does the software field - we are playing catchup on both most of the time.
3) We can't afford downtime. We can't just decide "upgrade tonight and go offline for a bit". So we have to engineer around this. We release a new system of our software every week (one week testing by a dedicated team with medical knowledge, then production). But since we can't do a bulk update and force people to restart, we need to deal with different versions which impacts the code quality.
4) We run on multiple hospitals. Hospitals have their own way of working, but to tailor to each hospital directly becomes impossible at some point. In the end you get a system that doctor Y from hospital A really likes, but doctor B from hospital A doesn't. Here, sadly, money will factor in. If you want the software more tailored you will have to pay more. And this is not just to the doctors to decide.
5) These systems are _huge_. (SVN reports a linecount of just over 37 million at the moment). Because they do a lot, to give an idea: * Patient scheduling (find optimal time for a patient to get X therapies) * Decision support for doctors (suggested medication, ..) * AI System to monitor patients in the hospital * Scheduling for the devices (MRI, CT, ..) * Communication system between specialists (GDPR compliant nowadays, yay) * Import/Export to share with all other hospitals * Billing system * Social insurance integration * Government integration * Medication system * ER System * ....
This is a pretty loose collection of some things that come to mind. :)