What Virgil said, I work in OH and refusing is a red flag to the employer, has to be said not me, as often like you, the employee doesn't really understand our role, so I say almost word for word what Virgil wrote to the employee. I would add we are not a get out if jail free card, but we can really help in most cases.,
Unfortunately, even if you are genuinely ill your employer doesn't have to continue to employ you indefinitely if your not around enough to do your job properly. If your condition amounts to a disability they may have to make reasonable adjustments to your role one of which might be ignoring some of your absences when operating their absence management policy.
If you refuse access to your medical records and refuse to see occupational health they will make a decision in the absence of medical Information and in your situation this will not be helpful to you. Depression is a disability and so if this is flagged then even if your UTIs are night e result of an underlying disability, other adjustments may be offered if relevant.
I would allow the access, you simply make it easier for them to dismiss you if you don't and you make any claim you might have more difficult to win.
My employer has referred me to Occupational Health as I have a history of being off with urinary tract infections. These tend to be quite hard hitting - high temperatures, flu like symptoms etc so when I've been off I've been genuinely quite ill and have the 'fit notes' to prove it. However I've now hit the trigger point of 4 absences.
I also take medication for long standing depression and do not particularly want my employer to know about this.
Do I have to give them access to my medical records? Is it a big red flag if I refuse?
I'm not sure what the point of the whole thing is - there's nothing my employer can do to stop it happening again, no workplace adjustments could possibly be made and there's no doubt in anyone's mind that I was genuinely ill. I have struggled in and they've seen how ill I am.