Choosing the Correct Analysis - Comparing Categorical Independent Variables (STATA)

So I want to compare the rates of infection in patients who received drugs A, B, C, and D. Patients could have received one, two, three, or all four drugs, and they could have been given each at different days during their stay. Infection could have happened before the drug was administered, or even after one drug, but before another.

I want to see if any of the drugs have a higher chance of leading to infection than the other drugs. This means I need to some how exclude infections occurring before drug administration. However, this will be different for each drug. For each patient, I have what day they were administered which drugs and what days they had documented infection.

Which test/analysis should I use? I wanted to try and get an odds ratio, but logistic regression doesn't seem to fit. For example, if I used "Logistic Infection DrugA," where Infection is whether or not they had an infection during their stay and DrugA is whether or not they were given Drug A, that would include infections that had occurred previous to being given Drug A. However, if I were to only include infections that occurred after Drug A, Stata would just tell me it predicts success perfectly.

Thanks for the help.