It would be a good idea to consult a doctor.I've never heard of someone breaking a bone while playing the piano, so you may be in the clear. However, if your finger is twisted as a result, that may result in some stress on the finger, which might eventuality result in some sort of repetitive stress injury. I feel like you'll realise on your own whether or not you need to change anything (undergo surgery etc) while you progress in terms of the piano. You typically do not strain the finger a lot while playing -- you should maintain a natural arched structure and not push down or attack a key from the side. I personally feel a medical procedure may not be necessary at this point. However, do not take my word for it. Your best bet is to consult a doctor.