The first electrocardiograph was invented in 1895. That device looked a lot different from today’s machines, and there are some other contenders for the title of “first.”
Research:

Behind the Scenes Minis: Piece of Work
17:48

E. Virgil Neal: Hypnotist, Fraudster, Tycoon, Part 2
41:22

E. Virgil Neal: Hypnotist, Fraudster, Tycoon - Part 1
35:28