I think you might want to read an article I wrote called
Develop Your Own EMR - Are You Crazy?
I understand your desire to have it just the way you want, but if you understood how many things you want then you'll quickly realize that developing your own EMR will mean that only part of your wants will be fulfilled since you'll have so many of them.