One who touches a corpse is required to wash his hands one time [immediately] afterwards. [The custom is to wash the hands three times inconsecutively as explained regarding a cemetery.]
Being in a room with a corpse:
One who is in the presence of a corpse [but did not touch the corpse] is not required to wash his hands afterwards. Nevertheless the custom is to wash the hands after entering the same room as a corpse. [This applies even if one was not within four Amos of the body].
Must one wash his hands after leaving a hospital?
Although hospitals contain people who passed away nevertheless it is not necessary to wash hands after exiting the hospital.
To Purchase this Sefer click here.
 Kama 4/18
 Kama 4/18; Ketzos Hashulchan 2/11; also brought in Chayeh Adam 2/5; Kitzur SH”A 2/9
 The Peri Megadim 4 A”A 21 writes on the M”A 4/20 that one must be within four Amos of the corpse to require washing. It is however unclear as to whether the P”M refers even to a case that one is within the same room as the corpse. Practically many record that one is to wash his hands when being in the same room as a corps even if one is not within 4 Amos. [See Piskeiy Teshuvos 4/25; Nitei Gavriel 70/1]
 Vayaan Yosef 3