I would also agree that you could consult a professional doctor..
My guess would be that somehow you have probably missed some of the basics "rules" of not getting injuries from your play. One of them is proper warmup, some stretches, frequent brakes etc.. could you spot a possible don't do of these that may caused your problem, to may help us/you also ?
Finally, as I have also been trying for a long time to get good advice on good warm-up, practices, exercises etc, asking teachers asking around, asking the forum too, I believe I have found the best practices all-together in the video-series of this g-r-e-a-t guy about learing the cello !
I believe it worths to watch them all and mind all his warm-up / practice directions - good habits (yes they all apply to the guitar too! ) in order to be in a good progress-path and avoid possible future-injuries