A patient in a hospital is still obligated to light Ĥanuka candles. However, if he is married, he fulfills his obligation through his spouse’s lighting at home. Likewise, if he is young and lives with his parents, he fulfills his obligation through his parents’ lighting at home. According to Ashkenazic custom, even though one has fulfilled his obligation through his family members’ lighting, if he wishes to beautify the mitzva he may light in his hospital room with the berakhot, as explained above (section 11). According to the custom of most Sephardim, he should not light candles (notes 19 and 22; above 12:3).
One who lights candles in a hospital should preferably light in his room, which is designated for him specifically. If he lights in the cafeteria, he fulfills his obligation, as it is considered his home to some degree while he is hospitalized.
A patient who is exempt from lighting because someone is lighting for them at home should still try to see Ĥanuka candles and hear the berakhot, because some maintain that even though someone is lighting for him at home, which allows him to fulfill the mitzva of lighting candles, nevertheless he has not fulfilled the mitzva of thanking God for the miracle (above 12:6 and n. 5). Therefore, he should find someone who is lighting with the berakhot (whether out of strict halakhic obligation or Ashkenazic custom) and listen to his berakhot with the intention of fulfilling the obligation to recite the berakha of She-asa Nisim. On the first night of Ĥanuka, he should have in mind to fulfill the obligation of She-heĥeyanu as well.