A palliative care physician who wrote a book about his own experience battling cancer has died at his home, surrounded by his family.