I thought Ryan was medically retired due to injuries sustained during his Helo crash while a MIDN.
It's been a while since I've read the book, but I thought he finished his time at the academy and was commissioned, but then left to do banking stuff (although I don't think that came out until later). But it's possible I'm remembering wrong.
The movie mentions that he finished his last year from a hospital bed, and I think Fred said he was a Marine when he was shutting down the CAG in the stateroom, but I'm not sure it went much farther than that in the movie. In Patriot Games, they show Ryan as a Marine when he kills the brother in the beginning, but again, that's the movie. I'm honestly not sure if I ever read Patriot Games.