Congestive heart failure can also be detected fairly reliably based on a sudden increase in weight. It causes fluid retention. There are several programs underway to give Internet connected scales to high risk patients and those report weight every day.
It could also be kidney failure. My weight ballooned by 30 lbs when I was progressing towards it. Even the doctor was saying the usual "you need to exercise and eat healthy" until he got my blood test results.