By passing your DoDMERB physical examination you have shown that you are in good health and have no major physical limitations for military service. As long as nothing changes (injuries, illness, new medical problems) before you are commissioned, you should be able to meet the physical qualifications for commissioning.
All Naval Academy Midshipmen must meet the medical requirements for Unrestricted Line (it is the NAVAL Academy!). Each year there are a few Midshipmen who are found disqualified for Unrestricted Line, in which case they are usually granted a waiver for Restricted Line. Again, in my 3 years doing the commissioning physical exams at the USNA I can only remember one Midshipman who was allowed to graduate but was not commissioned and that was due to a cancer that was found during the course of the commissioning physical examination and was not in remission at the time of graduation. There are Midshipmen who are medically discharged from the USNA during the course of their 4 years, usually due to an injury that is severe enough to preclude them from service in the military. Most of these happen prior to the first class year.
Once you have been found medically qualified for Unrestricted Line, then if you are interested in Marine Ground, your examination will be reviewed for that as well (the same as Unrestricted Line except you can be color blind). As for being able to be commissioned in the USMC, that is all done during service selection, and was covered in another post.
Can I say with 100% certainty that once you have been found medically qualified for Unrestricted Line and Marine Ground that regardless of an illness or injury that may occur after that you will be allowed to serve? No. I can tell you that every effort will be made by the medical staff at USNA to get you medically qualified for commissioning in the field that you are most interested in. I probably spent 60% of my time on 15% of the Midshipmen trying to get them medically qualified for what they wanted (within reason), and I am sure that the staff that is there now, and that will be there when you graduate, will do the same if you need the assistance.