That's exactly what derailed my pilot certificate. I was nearing my checkride when I had a major back/nerve problem flair up, had to get on several meds for a while, and basically concluded my choice was pilot license or treat my pain adequately. Since my husband had his and I could fly with him all I wanted, I really didn't NEED the certificate and, you really can't be a safe pilot when in severe chronic pain anyway, so it was a no brainer. Other than just being very disappointed that I hadn't achieved the piece of paper.
One of my meds was an antidepressant, did nothing at all for the pain, and I had bad side effects. I went through years trying to find the right treatments. The thing that seems to have really improved it was getting on B12 shots, as well as dietary changes (cutting way down on sugar which is pro-inflammatory) and now I have temporary bouts more than constant all the time pain. The only drug I take for it now is a mild muscle relaxer at bedtime occasionally.
Unfortunately I started getting arthritis real bad, especially the hip so was back on all the drugs for that until the hip replacement. And then the root canal infection, I mean if it's not one thing it's another. Getting old sucks.
I was trying to get on ketamine therapy. I think that would be my best option. But workers comp won't cover it and the closest pain clinic that does it is an hour away and would be an all day thing. I don't have anybody who can sit at a hospital for 8 hours once a month while I get the treatment. I'm looking into testosterone therapy replacement right now. If I could do both I think I would be a new man.
Some of the meds mess me up. I'm like a zombie. I don't register stuff. I've almost gotten into a car wreck because I saw the oncoming car but didn't realize it was coming at me and pulled out in front of it. Thank god at the last second he slammed on the brakes and I accelerated. And I don't know how many times I drove to the store and didn't realize I walked into it, or walked once walked into a women's restroom and had no idea where or why I was in there.