Niles is in the hospital, and everybody is there for him, Frasier even goes to the trouble, in detailing Niles surgery, and the doctors who are working, even going as far as to telling them how to do their job.
As Niles leaves for surgery he says he mentions memories how the hospital halls must be filled with them, which got everybody thinking, and throughout the episode you seen scenes from the past, in the form of hospital rooms, which I thought was a very nice touch.
Daphne is so terrified that she even breaks a vending machine when Martin and Frasier are arguing because Martin's candy bar got stuck.
Once she finds out Niles is ok, she calms down and begins thinking about the future.
The flashback showing in the hospital rooms was a great way to show events that happened in the past.