Yes.......you were discharged heavier than you weight on admission because in that week you were given more calories than you used, being inactive for a week.
The operation that you described would involve the intravenous (drip) administration of dextrose saline and it was that which increased your calorie intake and increase in weight.
I do know they weren't giving me any intraveniois nutrients though because they said they might if I didn't start eating but I suppose there is some in the saline drip?