There are several diseases that are notifiable. A doctor or medical laboratory is required to inform a public health agency if any of these are found. Some of these are transmitted sexually as well as nonsexually.
The list of notifiable diseases is set by state law, with some variation among states.
Gunshot wounds are often notifiable. This information might go to law enforcement instead of the health department.
One oddity in this class was when the Governor of Oklahoma declared the bombing of the Federal Building in Oklahoma to be a reportable disease. He did this so that the state health department could necessary obtain information about the extent of injuries and deaths due to the bombing. Both natural and man-made disasters are investigated by health agencies as well as police and other agencies.
Notifiable diseases and gunshot wounds are sometimes followed up with the patient and their contacts. This is the process of contact tracing, which traces chains of contacts and tests them for the disease. This is done according to state statute, which varies by state and by disease. Tuberculosis might be followed up among close contacts, since it is transmissible and can require lengthy or complex treatment.
Followup procedures vary and are sensitive to privacy, but this is not always possible. For example, sexual contacts of a person with an STD are told only that they have a contact with the disease, not their name. If they have only one sex partner they can guess who it is.
These procedures are a matter of immediate public safety and they are governed by state law. HIPAA is not universal, it allows information to be transmitted to several agencies, including others who are treating you and your insurance company. HIPAA does not prevent courts from getting the information they need for criminal proceedings or lawsuits. I do not know if there is explicit mention of public health agencies and requirements of state laws in HIPAA. Agencies might be exempted explicitly or by an implicit mechanism.
Public health agencies are often covered by their own confidentiality laws and they take them seriously. One group in the New York State Health Department required that a senior staff member be present while the janitor came in to clean their offices.
It seems extraordinarily unlikely that a challenge to state reportable disease laws, especially serious diseases that are difficult to treat, could be successfully made based on HIPAA.