As Frederick has mentioned, you could build this using a Call Flow Designer (CFD) application. You would route after-hours calls to the CFD and it would perform the following actions:
1. Look up in a database who is on call
2. Get the physician's phone number
3. Transfer the caller to the physician's cell phone.
I am surprised, however, that you are proposing sending patients directly to the physicians. My brother and sister are both physicians and I can't imagine they would want a patient's call going directly to their cell phone at 3:00 a.m. More likely they would prefer to listen to a voicemail, perhaps perform a little research, then call the patient back.
There are some flaws to this simplistic approach. Besides the question of sending patients directly to the physician's cell phone, what happens if the physician's phone has died in the night? That call would go directly to the cell voicemail box. Yikes.
What we did was build a service (Windows or Linux). When a caller selects "after-hours support", we can either send them to a monitored voicemail box, or to a queue. We use a calendar with recurring schedules to determine who is on-call, and can notify the physician by phone, email, and SMS text.
When using "live answer" (queues), we first check (based on the schedule) who is on call, log them into the queue, then transfer the caller to the queue. As we all know, you must have people logged into the queue BEFORE transferring callers to the queue or it will immediately route to the alternate destination. Once the caller is in the queue, then the default 3CX behavior takes over (that's a longer conversation).
If for some reason the physician doesn't answer the call, we then fail the call to a monitored voicemail box where we have a prompt similar to "If this is an emergency, please hang up and dial 911. Currently, all physicians are assisting other patients, please leave your name, number and a brief description of your issue, and the physician on call will get back to you shortly." At this point, we start poking the physicians via phone, email, and SMS. If the first physician doesn't respond, we can escalate up to 30 levels with multiple physicians in each level.
In the case of a medical practice, I would imagine that they have multiple specialties, for example: pediatrics, internal medicine, etc. We also support an unlimited number of groups -- meaning different physicians with different schedules.
You could build something fairly basic using a CFD, but in my opinion a more robust solution is going to be needed. We have a solution for you if you don't want to try and build something yourself.