The EHR itself is the black hole of suck. It almost always ends up being like an ERP package, with either an off the shelf package (e.g. SAP) where the workflow is changed to accomodate the package, or a semi-custom consulting product built around specific workflow.
Luckily, the more specialized stuff is actually vastly simpler.
Once you have to handle anything workflow-ish or manage any sort of business process, or any time you have to handle integration to arbitrary external systems, it's very difficult to make anything that doesn't suck. The "right" thing becomes very fuzzy, and there's no one purpose or problem you can use as your rightness criterion, so it all becomes very fuzzy. Things then get worse when some standards committee tries to please everyone, or when business users insist that they want everything to work exactly the way it used to just, you know, with a computer know. And since there's no easy criterion against which to judge the solution, it's an easy slope down towards even more suck.