Dude - you absolutely should go to the doctor, and do everything the doctor tells you. Yes, doctors (like people of any other profession) are capable of making mistakes on rare occasions, but, probabilistically, that's your best bet. Also, make sure to tell the doctor about your NoFap journey.
The main purpose of the 90-day streak is to demonstrate to yourself that you have the willpower necessary to control yourself sexually. The main real benefit of doing 90 days of no PMO (apart from helping resensitize you sexually) is that it gives your self-esteem a boost because you successfully did something healthy and difficult. If you need to O for medical reasons (because your doctor told you) then this doesn't apply. It's not a failure of your willpower, it's literally necessary for your health. Don't wait for the 90 days to be up before going to a doctor, and don't reset your streak if your doctor tells you to O.