President Barack Obama signed a memorandum Thursday requiring hospitals to allow gays and lesbians to have nonfamily visitors and allowing their partners medical power of attorney.

The memorandum orders the Department of Health and Human Services to prohibit discrimination in hospital visitation. The memo was posted on the White House website Thursday afternoon.

Reads the memorandum: “Often, a widow or widower with no children is denied the support and comfort of a good friend. Members of religious orders are sometimes unable to choose someone other than an immediate family member to visit them and make medical decisions on their behalf. Also uniquely affected are gay and lesbian Americans who are often barred from the bedsides of the partners with whom they may have spent decades of their lives — unable to be there for the person they love, and unable to act as a legal surrogate if their partner is incapacitated.”

A White House official told The Washington Post the memorandum will affect any hospital that receives Medicare or Medicaid funding.Read the memorandum here.