Either they're doing medicine, or they're building medical equipment.
The former case is unlikely, since, unlike writing software (but like many forms of actual engineering), there are actually formally defined standards for what you have to know before you're allowed to practice medicine. If they are doing medicine, then the word "engineer" is being abused. Medicine is not engineering. Programming isn't engineering either. Programming isn't even much like engineering.
In the latter case, they are of course acting as engineers and the name makes sense. It's not clear what the software counterpart to, say, an artificial heart would be, though, so software engineers in that sense can't exist. I suppose there are software counterparts to medical tools, like stethoscopes and X-ray machines. We usually call the people who design them "electrical engineers" or "computer engineers".
Oh, and other things I might have considered for the analogy were things like "If a philosopher writes software, does that make it software philosophy?" I picked medicine as a random vaguely technically credential.