Would it be okay to break patient confidentiality if you know that their illness can harm others?
Answer:
This is a difficult question, and it has not been discussed at length by halachic poskim.
In general, it appears that it will be correct to break confidentiality where it can save others from harm, because the moral and legal responsibility to save others from harm is a full obligation, and insofar as one can one is obliged to do it.
However, if a criminal offence is involved, and there is even a chance of prosecution, the degree of harm involved must be weighed up against the harm of committing a criminal offence that might lead to further complications.
Best wishes.