Grandma's doctor wrote her a prescription to hug her granddaughter