In medicine, dialysis is a process for removing waste and excess water from the blood, and is used primarily to provide an artificial replacement for lost kidney function in people with renal failure. Dialysis may be used for those with an acute disturbance in kidney function (acute kidney injury, previously acute renal failure), or progressive but chronically worsening kidney function–a state known as chronic kidney disease stage 5 (previously chronic renal failure or end-stage renal disease). The latter form may develop over months or years, but in contrast to acute kidney injury is not usually reversible, and dialysis is regarded as a "holding measure" until a renal transplant can be performed, or sometimes as the only supportive measure in those for whom a transplant would be inappropriate.
The kidneys have important roles in maintaining health. When healthy, the kidneys maintain the body's internal equilibrium of water and minerals (sodium, potassium, chloride, calcium, phosphorus, magnesium, sulfate). Those acidic metabolism end-products that the body cannot get rid of via respiration are also excreted through the kidneys. The kidneys also function as a part of the endocrine system, producing erythropoietin and calcitriol. Erythropoietin is involved in the production of red blood cells and calcitriol plays a role in bone formation. Dialysis is an imperfect treatment to replace kidney function because it does not correct the endocrine functions of the kidney. Dialysis treatments replace some of these functions through diffusion (waste removal) and ultrafiltration (fluid removal).