Depending on the medical condition you have you might still be able to dive. However there is some medical conditions that are incompatible with diving. The best is to first refer to a dive professional but ultimately the only person that can give clearance is a physician.
You can learn more about diving and health on the Diving and medical assessment page.