Assuming you're in the USA and in a state with typical IP laws, anything you make for them as an employee is their property.
So here's what you do:
1) Develop something rudimentary. A prototype, a framework, the basics. Just enough to showcase to the boss. It should look rough around the edges, be enough to get the job done (what's what they paid you for after all) and, this is important, not look valuable so he doesn't feel anything is being taken from him.
2) Showcase it. Tell the boss you have a prototype that you can start rolling out and it'll work even though it's not pretty. Given more time you'd like to do a lot more with it. Rattle off a laundry list of features. But that would take time and money.
3) Throw out this wild idea that you could release this an open software and get others to develop the code FOR THE HOSPITAL. There's a large and eager community of geeks out there that work for free and would be willing to help. Even for domain specific applications such as this. I mean, Linux works pretty well. Other similar hospitals could contribute if they wished, and it'd be nice if everyone got on the same standard. And YOUR HOSPITAL could be minor celebrities for being the founders of a widespread tool used by everyone. And MR BOSS would still be able to steer the boat.
All of that is true, or at least potentially true predictions of the future. It's largely up to how good you make the product. I mean, I doubt you'll be pushing out Sharepoint or Salesforce of their marketshare anytime soon, but there's potential for a domain specific solution.
If they agree to release it as open source, say as GPLv3, you and anyone else can take that software ANYWHERE, FOREVER. And while that might mean you won't be able to make a buck selling it as a product, you can make money servicing it, installing it, developing it, and maintaining it.
If you want to own it and sell it, you'll have to sweet-talk the boss into signing the rights over to you. You could pay them for it, or promise them a free-ride after you develop it further and start selling it to other hospitals, but make sure you get everything in writing.