Heparin is generally used for anticoagulation for the following conditions:

Acute coronary syndrome, e.g., NSTEMI
Atrial fibrillation
Deep-vein thrombosis and pulmonary embolism
Cardiopulmonary bypass for heart surgery
ECMO circuit for extracorporeal life support
Hemofiltration
Indwelling central or peripheral venous cathetersHeparin and its low-molecular-weight derivatives (e.g., enoxaparin, dalteparin, tinzaparin) are effective in preventing deep vein thromboses and pulmonary emboli in people at risk, but no evidence indicates any one is more effective than the other in preventing mortality.In angiography, 2 to 5 units/mL of unfractionated heparin saline flush is used to prevent the clotting of blood in guidewires, sheaths, and catheters, thus preventing thrombus from dislodging from these devices into the circulatory system .Unfractionated heparin is used in hemodialysis. Comparing to low-molecular-weight heparin, unfractionated heparin does not have prolonged anticoagulation action after dialysis, and low cost. However, the short duration of action for heparin would require it to maintain continuous infusion to maintain its action. Meanwhile, unfractionated heparin has higher risk of heparin-induced thrombocytopenia. Adverse effects
A serious side-effect of heparin is heparin-induced thrombocytopenia (HIT), caused by an immunological reaction that makes platelets a target of immunological response, resulting in the degradation of platelets, which causes thrombocytopenia. This condition is usually reversed on discontinuation, and in general can be avoided with the use of synthetic heparins. Also, a benign form of thrombocytopenia is associated with early heparin use, which resolves without stopping heparin. Two non-hemorrhagic side-effects of heparin treatment are known. The first is elevation of serum aminotransferase levels, which has been reported in as many as 80% of patients receiving heparin.
Danaparoid, a mixture of heparan sulfate, dermatan sulfate, and chondroitin sulfate can be used as an anticoagulant in patients having developed HIT. Because danaparoid does not contain heparin or heparin fragments, cross-reactivity of danaparoid with heparin-induced antibodies is reported as less than 10%.The effects of heparin are measured in the lab by the partial thromboplastin time (aPTT), one of the measures of the time it takes the blood plasma to clot. Partial thromboplastin time should not be confused with prothrombin time, or PT, which measures blood clotting time through a different pathway of the coagulation cascade. Administration
Heparin is given parenterally because it is not absorbed from the gut, due to its high negative charge and large size. It can be injected intravenously or subcutaneously (under the skin); intramuscular injections (into muscle) are avoided because of the potential for forming hematomas. Because of its short biologic half-life of about one hour, heparin must be given frequently or as a continuous infusion. Unfractionated heparin has a half-life of about one to two hours after infusion, whereas LMWH has a half-life of four to five hours. The use of LMWH has allowed once-daily dosing, thus not requiring a continuous infusion of the drug. If long-term anticoagulation is required, heparin is often used only to commence anticoagulation therapy until an oral anticoagulant e.g. warfarin takes effect. The American College of Chest Physicians publishes clinical guidelines on heparin dosing.