I don't think "by almost any measure" is right. I think in a very narrow sense they've become less productive (they see fewer patients), but by your own admission they're building databases of patient data, which you seem to suppose are only useful to the likes of Epic, but obviously Epic has customers--notably healthcare researchers use this data to improve patient care, develop new medicines, and to precisely identify which medicines are likely to help on a particular patient (and which medicines may even harm them!). This is stuff clearly benefits society, and doctors' role in this should be counted as "productive", although we can quibble about the relative value of facilitating healthcare research versus seeing more patients.
Note that this isn't meant to vouch for Epic--I work for a company that consumes their data and anyone who has to integrate with them has nothing good to say about the software, but the role it plays is still incredibly important.