HIV is diagnosed through a blood test called a Western Blot. AIDS is advanced HIV, and is diagnosed by another blood test, called a CD4 count as well as the presentation of what are called opportunistic diseases that people with a healthy immune system do not get.
Sometimes dr can tell by listening to your present and past medical history. Or what your chief complaint is. You may have to ask dr for HIV test. But hospitals do require a signed consent form to even do the test.