I’m a vet. I earned some money through university by coding, and am still doing some projects now I’m working (been a vet full-time since October 2013).
You can do both, but hopefully you’ll have an idea of which is the one you’re more passionate about. By the sounds of it that would be dentistry. Keep that in mind. When conflicts come up, dentistry is the priority, and you can’t take it to heart that this will inevitably mean you aren’t going to be the Best Coder in the World (TM). So long as you have reasonable expectations, I think it’s perfectly possible to do both.
A few things to bear in mind though. Contracts take longer to fulfill – you need to be selective about what you take on. You will also need to be clear with clients about what you can do – you’ll have less time available to research new technologies on the fly. Finally, it’s hard to be cutting-edge. You will need to target your learning towards the projects you want to do and accept that your toolkit will be more specific.
Maybe one day you’ll code your own online scheduling system
Heh… this is actually a project I have on the back-burner :-)