In the Agents of SHIELD episode The Magical Place, it is shown that
Coulson's brain is being operated by a giant robot. Though his heart is not being operated on, the region where he was impaled. Therefore the brain was being operated upon to alter his memory to "make him the man he once was."
But why wasn't his heart being operated upon?