Can you pursue MS/MD after AFMC?

ik 7 years minimum serve karna hoga, will I have to go immediately after MBBS in afmc?