Shocking/Tasering prisoners to force them submit to medical tests - Is this moral?

Per this article from the Washington Post . I didn’t know the law could do this to force compliance. Even if the prisoner is a really bad guy is tasering (or the equivalent) them to force them to submit to medical tests an ethical or moral thing to do?

Sniper Case Fuels Sheriff’s Race
Va. Rivals Clash Over Use of Stun Belt on Muhammad