The following seem to be true:
- It is never permissible for the state to force on a non-consenting innocent patient medical procedures very likely to cause death.
- It is sometimes permissible for the state to force a non-consenting drafted soldier to go to near certain death in a just war.
Here is a suggestive hint. We can imagine circumstances where a war against a vicious enemy could only be won by an attack by non-consenting draftees even though it was morally certain that most of the draftees would be captured and horrendous medical experiments would be done on them by the enemy. Such an attack could well be permissible, even though much less extreme medical experiments could not be intentionally imposed on non-consenting patients even for an equal good (say, to defeat some awful disease). This suggests a difference between directly imposing harms and acting in a way that is morally certain to lead to the self-same harms. This is exactly the sort of difference that the Principle of Double Effect is sensitive to. Someone who thinks that foreseeing/intending differences do not matter is probably not going to be able to make the distinction between enforced medical procedures and the draft.
At the same time, the Principle of Double Effect does not seem sufficient to remove the puzzle concerning (1) and (2), since it doesn't really get at what it is that is so special about medical procedures likely to cause death as opposed to military operations likely to cause death. Probably another part of the puzzle has to do with the integrity of the body. But it's tricky: the importance of bodily integrity is not enough to make all enforced medicine wrong. It seems that the state can legitimately require procedures that are minimally invasive and minimally risky, but cannot legitimately require procedures that are minimally invasive but highly risky (think of injecting someone with a vaccine versus injecting someone with a fully functional virus).
Maybe it's like this: the fact that an intentional procedure directly transgresses bodily integrity typically calls for consent. But in at least some cases where someone's lack of consent is strongly irrational, that lack of consent can be overridden for a sufficiently good cause. But where the lack of consent is at least somewhat rational, the lack of consent cannot be overridden. When the risks are minimal, the lack of consent is strongly irrational, barring conscientious objection. But when the risks are high, lack of consent is at least somewhat rational. Medical procedures always transgress bodily integrity, so we get (1). On the other hand, commanding an attack likely to lead to death (or torture or being the victim of vicious medical experiments) does not transgress bodily integrity, and so a completely different set of standards for consent and authorization is in place. This is a mere sketch. I am not sure the details can be worked out.
Notice, also, that the account in the preceding paragraph does not apply to sexual cases. Even if someone's lack of consent to sex is strongly irrational (imagine a contrived case where a married person for completely irrational or even malicious reasons refuses to have sex with a spouse, despite the fact that great benefits would come to society from their having sex--perhaps a killer robot has been programmed by a mad scientist to stop its rampage only if they have sex), it is wrong for the state to force the person to have sex. Once again, sex is morally exceptional.