Immunodeficiency (or immune deficiency) is a state in which the immune system's ability to fight infectious disease and cancer is compromised or entirely absent. Most cases of immunodeficiency are acquired ("secondary") due to extrinsic factors that affect the patient's immune system. Examples of these extrinsic factors include HIV infection, extremes of age, and environmental factors, such as nutrition. In the clinical setting, the immunosuppression by some drugs, such as steroids, can be either an adverse effect or the intended purpose of the treatment. Examples of such use is in organ transplant surgery as an anti-rejection measure and in patients suffering from an overactive immune system, as in autoimmune diseases. Some people are born with intrinsic defects in their immune system, or primary immunodeficiency. A person who has an immunodeficiency of any kind is said to be immunocompromised. An immunocompromised person may be particularly vulnerable to opportunistic infections, in addition to normal infections that could affect everyone. Immunodeficiency also decreases cancer immunosurveillance, in which the immune system scans the body's cells and kills neoplastic ones.
In reality, immunodeficiency often affects multiple components, with notable examples including severe combined immunodeficiency (which is primary) and acquired immune deficiency syndrome (which is secondary).
|Affected components||Main causes||Main pathogens of resultant infections|
|Humoral immune deficiency||B cells, plasma cells or antibodies|
|T cell deficiency||T cells||Intracellular pathogens, including Herpes simplex virus, Mycobacterium, Listeria, and intracellular fungal infections.|
|Complement deficiency||Complement system||
Distinction between primary versus secondary immunodeficiencies are based on, respectively, whether the cause originates in the immune system itself or is, in turn, due to insufficiency of a supporting component of it or an external decreasing factor of it.
A number of rare diseases feature a heightened susceptibility to infections from childhood onward. Primary Immunodeficiency is also known as congenital immunodeficiencies. Many of these disorders are hereditary and are autosomal recessive or X-linked. There are over 80 recognised primary immunodeficiency syndromes; they are generally grouped by the part of the immune system that is malfunctioning, such as lymphocytes or granulocytes.
The treatment of primary immunodeficiencies depends on the nature of the defect, and may involve antibody infusions, long-term antibiotics and (in some cases) stem cell transplantation.The characteristics of lacking and/or impaired antibody functions can be related to illnesses such as X-Linked Agammaglobulinemia and Common Variable Immune Deficiency 
Secondary immunodeficiencies, also known as acquired immunodeficiencies, can result from various immunosuppressive agents, for example, malnutrition, aging, particular medications (e.g., chemotherapy, disease-modifying antirheumatic drugs, immunosuppressive drugs after organ transplants, glucocorticoids) and environmental toxins like mercury and other heavy metals, pesticides and petrochemicals like styrene, dichlorobenzene, xylene, and ethylphenol. For medications, the term immunosuppression generally refers to both beneficial and potential adverse effects of decreasing the function of the immune system, while the term immunodeficiency generally refers solely to the adverse effect of increased risk for infection.
Many specific diseases directly or indirectly cause immunosuppression. This includes many types of cancer, particularly those of the bone marrow and blood cells (leukemia, lymphoma, multiple myeloma), and certain chronic infections. Immunodeficiency is also the hallmark of acquired immunodeficiency syndrome (AIDS), caused by the human immunodeficiency virus (HIV). HIV directly infects a small number of T helper cells, and also impairs other immune system responses indirectly.
Various hormonal and metabolic disorders can also result in immune deficiency including anemia, hypothyroidism, diabetes and hypoglycemia.
Smoking, alcoholism and drug abuse also depress immune response.
This section needs additional citations for verification. (November 2016) (Learn how and when to remove this template message)
There are a large number of immunodeficiency syndromes that present clinical and laboratory characteristics of autoimmunity. The decreased ability of the immune system to clear infections in these patients may be responsible for causing autoimmunity through perpetual immune system activation.
This section may be too technical for most readers to understand. Please help improve it to make it understandable to non-experts, without removing the technical details. (November 2016) (Learn how and when to remove this template message)
One example is common variable immunodeficiency (CVID) where multiple autoimmune diseases are seen, e.g., inflammatory bowel disease, autoimmune thrombocytopenia and autoimmune thyroid disease. Familial hemophagocytic lymphohistiocytosis, an autosomal recessive primary immunodeficiency, is another example. Pancytopenia, rashes, lymphadenopathy and hepatosplenomegaly are commonly seen in these patients. Presence of multiple uncleared viral infections due to lack of perforin are thought to be responsible. In addition to chronic and/or recurrent infections many autoimmune diseases including arthritis, autoimmune hemolytic anemia, scleroderma and type 1 diabetes are also seen in X-linked agammaglobulinemia (XLA). Recurrent bacterial and fungal infections and chronic inflammation of the gut and lungs are seen in chronic granulomatous disease (CGD) as well. CGD is caused by a decreased production of nicotinamide adenine dinucleotide phosphate (NADPH) oxidase by neutrophils. Hypomorphic RAG mutations are seen in patients with midline granulomatous disease; an autoimmune disorder that is commonly seen in patients with granulomatosis with polyangiitis (Wegner’s disease) and NK/T cell lymphomas. Wiskott-Aldrich syndrome (WAS) patients also present with eczema, autoimmune manifestations, recurrent bacterial infections and lymphoma. In autoimmune polyendocrinopathy-candidiasis-ectodermal dystrophy (APECED) also autoimmunity and infections coexist: organ-specific autoimmune manifestations (e.g., hypoparathyroidism and adrenocortical failure) and chronic mucocutaneous candidiasis. Finally, IgA deficiency is also sometimes associated with the development of autoimmune and atopic phenomena.
The cause of immunodeficiency varies depending on the nature of the disorder. The cause can be either genetic or acquired by malnutrition and poor sanitary conditions. Only for some genetic causes, the exact genes are known. Although there is no true discrimination to who this disease affects, the genes are passed from mother to child, and on occasion from father to child. Women tend not to show symptoms due to their second X chromosome not having the mutation while men are symptomatic, due to having one X chromosome.
Available treatment falls into two modalities: treating infections and boosting the immune system.
Prevention of Pneumocystis pneumonia using trimethoprim/sulfamethoxazole is useful in those who are immunocompromised. In the early 1950s Immunoglobulin(Ig) was used by doctors to treat patients with primary immunodeficiency through intramuscular injection. Ig replacement therapy are infusions that can be either subcutaneous or intravenously administrated, resulting in higher Ig levels for about three to four weeks, although this varies with each patient.
Prognosis depends greatly on the nature and severity of the condition. Some deficiencies cause early mortality (before age one), others with or even without treatment are lifelong conditions that cause little mortality or morbidity. Newer stem cell transplant technologies may lead to gene based treatments of debilitating and fatal genetic immune deficiencies. Prognosis of acquired immune deficiencies depends on avoiding or treating the causative agent or condition (like AIDS).