You had a patella dislocation, resulting in some ligament damage around patella.
Next Steps
Ideally to be seen by ortho surgeon. I would recommend patella bearing brace for 3-4 weeks, ice application and physiotherapy. If it happens again you require surgery for repair of ligaments around patella