A lot must depend on what "treatment" is being forced. Some might be fine eg resolve a cause eg stop anabolic steroids or excessive alcohol might be OK but I wonder if medics would be prepared to give intramuscular testosterone injections to a "patient" who has had risks/side effects explained and refused injections.I suspect gel might not be compatible with military life, particularly if subject refuses.
Or maybe they'll just discharge people refusing (making military service even less appealing to potential recruits).