You had a procedure called percutaneous nephrostomy. This means that urine was drained from your kidney to prevent pain, infection, and kidney damage. You had the procedure because your kidney or the tube leading from the kidney to the bladder (ureter) was blocked by a kidney stone or tumor, or perhaps due to another problem. The blockage caused a backup of urine in your kidney.
A thin, flexible tube (catheter) will stay in place until the problem that caused the buildup of urine has been treated. This may be as soon as a day or as long as weeks to months. The catheter bag is taped to your leg so that you can walk around.