You are a helpful, respectful, and honest assistant. Always answer as helpfully as possible, while being safe. Your answers should not include any harmful, unethical, racist, sexist, toxic, dangerous, or illegal content. Please ensure that your responses are socially unbiased and positive in nature. If a question does not make any sense or is not factually coherent, explain why instead of answering something not correct. If you don't know the answer to a question, please don't share false information.
What is Esophagitis and explain in detail?
Esophagitis, also spelled oesophagitis, is a disease characterized by inflammation of the esophagus. The esophagus is a tube composed of a mucosal lining, and longitudinal and circular smooth muscle fibers. It connects the pharynx to the stomach; swallowed food and liquids normally pass through it.Esophagitis can be asymptomatic; or can cause epigastric and/or substernal burning pain, especially when lying down or straining; and can make swallowing difficult (dysphagia). The most common cause of esophagitis is the reverse flow of acid from the stomach into the lower esophagus: gastroesophageal reflux disease (GERD).

Signs and symptoms
The symptoms of esophagitis include:
Heartburn – a burning sensation in the lower mid-chest
Nausea
Dysphagia – swallowing is painful, with difficulty passing or inability to pass food through the esophagus
Vomiting (emesis)
Abdominal pain
Cough

Complications
If the disease remains untreated, it can cause scarring and discomfort in the esophagus. If the irritation is not allowed to heal, esophagitis can result in esophageal ulcers. Esophagitis can develop into Barretts esophagus and can increase the risk of esophageal cancer.

Causes
Esophagitis cannot be spread. However, infections can be spread by those who have infectious esophagitis. Esophagitis can develop due to many causes. GERD is the most common cause of esophagitis because of the backflow of acid from the stomach, which can irritate the lining of the esophagus.
Other causes include:

Medicines – Can cause esophageal damage that can lead to esophageal ulcers
Nonsteroidal anti-inflammatory drugs (NSAIDS) – aspirin, naproxen sodium, and ibuprofen. Known to irritate the GI tract.
Antibiotics – doxycycline and tetracycline
Quinidine
Bisphosphonates – used to treat osteoporosis
Steroids
Potassium chloride

Chemical injury by alkaline or acid solutions
Physical injury resulting from nasogastric tubes.
Alcohol use disorder – Can wear down the lining of the esophagus.
Crohns disease – a type of IBD and an autoimmune disease that can cause esophagitis if it attacks the esophagus.
Stress – Can cause higher levels of acid reflux
Radiation therapy - Can affect the immune system.
Allergies (food, inhalants) – Allergies can stimulate eosinophilic esophagitis.
Infection - People with an immunodeficiencies have a higher chance of developing esophagitis.
Vitamins and supplements (iron, vitamin C, and potassium) – Supplements and minerals can be hard on the GI tract.
Vomiting – Acid can irritate esophagus.
Hernias – A hernia can poke through the diaphragm muscle and can inhibit the stomach acid and food from draining quickly.
Surgery
Eosinophilic esophagitis, a more chronic condition with a theorized autoimmune component

Mechanism
The esophagus is a muscular tube made of both voluntary and involuntary muscles. It is responsible for peristalsis of food. It is about 8 inches long and passes through the diaphragm before entering the stomach. The esophagus is made up of three layers:  from the inside out, they are the mucosa, submucosa, muscularis externa. The mucosa, the inner most layer and lining of the esophagus, is composed of stratified squamous epithelium, lamina propria, and muscularis mucosae. At the end of the esophagus is the lower esophageal sphincter, which normally prevents stomach acid from entering the esophagus.
If the sphincter is not sufficiently tight, it may allow acid to enter the esophagus, causing inflammation of one or more layers. Esophagitis may also occur if an infection is present, which may be due to bacteria, viruses, or fungi; or by diseases that affect the immune system.Irritation can be caused by GERD, vomiting, surgery, medications, hernias, and radiation injury. Inflammation can cause the esophagus to narrow, which makes swallowing food difficult and may result in food bolus impaction.

Diagnosis
Esophagitis can be diagnosed by upper endoscopy, biopsy, upper GI series (or barium swallow), and laboratory tests.An upper endoscopy is a procedure to look at the esophagus by using an endoscope. While looking at the esophagus, the doctor is able to take a small biopsy. The biopsy can be used to confirm inflammation of the esophagus.
An upper GI series uses a barium contrast, fluoroscopy, and an X-ray. During a barium X-ray, a solution with barium or pill is taken before getting an X-ray. The barium makes the organs more visible and can detect if there is any narrowing, inflammation, or other abnormalities that can be causing the disease. The upper GI series can be used to find the cause of GI symptoms. An esophagram is if only the throat and esophagus are looked at.Laboratory tests can be done on biopsies removed from the esophagus and can help determine the cause of the esophagitis. Laboratory tests can help diagnose a fungal, viral, or bacterial infection. Scanning for white blood cells can help diagnose eosinophil esophagitis.
Some lifestyle indicators for this disease include stress, unhealthy eating, smoking, drinking, family history, allergies, and immunodeficiency.

Types
Reflux esophagitis
Although it usually assumed that inflammation from acid reflux is caused by the irritant action on the mucosa by hydrochloric acid, one study suggests that the pathogenesis of reflux esophagitis may be cytokine-mediated.

Infectious esophagitis
Esophagitis happens due to a viral, fungal, parasitic or bacterial infection. More likely to happen to people who have an immunodeficiency. Types include:
Fungal

Candida (Esophageal candidiasis)Viral

Herpes simplex (Herpes esophagitis)
CytomegalovirusDrug-induced esophagitis
Damage to the esophagus due to medications. If the esophagus is not coated or if the medicine is not taken with enough liquid, it can damage the tissues.

Eosinophilic esophagitis
Eosinophilic esophagitis is caused by a high concentration of eosinophils in the esophagus. The presence of eosinophils in the esophagus may be due to an allergen and is often correlated with GERD. The direction of cause and effect between inflammation and acid reflux is poorly established, with recent studies (in 2016) hinting that reflux does not cause inflammation. This esophagitis can be triggered by allergies to food or to inhaled allergens. This type is still poorly understood.
Lymphocytic esophagitis
Lymphocytic esophagitis is a rare and poorly understood entity associated with an increased amount of lymphocytes in the lining of the esophagus. It was first described in 2006. Disease associations may include Crohns disease, gastroesophageal reflux disease and coeliac disease. It causes similar changes on endoscopy as eosinophilic esophagitis including esophageal rings, narrow-lumen esophagus, and linear furrows.
Caustic esophagitis
Caustic esophagitis is the damage of tissue via chemical origin. This occasionally occurs through occupational exposure (via breathing of fumes that mix into the saliva which is then swallowed) or through pica. It occurred in some teenagers during the fad of intentionally eating Tide pods.

By severity
The severity of reflux esophagitis is commonly classified into four grades according to the Los Angeles Classification:

Prevention
Since there can be many causes underlying esophagitis, it is important to try to find the cause to help to prevent esophagitis. To prevent reflux esophagitis, avoid acidic foods, caffeine, eating before going to bed, alcohol, fatty meals, and smoking. To prevent drug-induced esophagitis, drink plenty of liquids when taking medicines, take an alternative drug, and do not take medicines while lying down, before sleeping, or too many at one time