Medical necessity is a United States legal doctrine, related to activities which may be justified as reasonable, necessary, and/or appropriate, based on evidence-based clinical standards of care. Other countries may have medical doctrines or legal rules covering broadly similar grounds. The term clinical medical necessity is also used. In contrast, unnecessary health care lacks such justification.
Implementations of the 'medical necessity' doctrines
Medicare pays for medical items and services that are "reasonable and necessary" for a variety of purposes. By statute, Medicare may only pay for items and services that are "reasonable and necessary"for the diagnosis or treatment of illness or injury or to improve the functioning of a malformed body member", unless there is another statutory authorization for payment.
Medicare has a number of policies, including National coverage determinations (NCDs) and Local Coverage Determinations (LCDs), formerly known as Local Medical Review Policies (LMRP), that describe coverage criteria.
In a small number of cases, Medicare may determine if a method of treating a patient should be covered on a case-by-case basis. Even if a service is medically determined to be "reasonable and necessary," coverage may be limited if the service is provided more frequently than allowed under Medicare coverage policies.
Medical use of marijuana
The use of cannabis (also known as marijuana) for medical purposes is a notable 'medical necessity' case. Cannabis is a plant whose active ingredients are widely reported by sufferers to be effective in pain control for various conditions, usually neuropathic in nature, where common painkillers have not had great benefit; however as a Schedule I drug under the Controlled Substance Act, it is illegal and is targeted by government, police, and anti-drug campaigners: in some states, possession is decriminalized for even non-medical purposes, wherein other states possession is a felony offense. In this case the doctrine of medical necessity would be used by a patient who believed marijuana was beneficial to them if charged with use or growing/production of illegal controlled substance relating to marijuana.
In several medical marijuana cases, the patients' physician has been willing to state to the court that the patient's condition requires this medicine and thus that the Court should not interfere. However, the Supreme Court of United States has outrightly rejected this defense in the landmark case United States v. Oakland Cannabis Buyers' Cooperative, in which the Court ruled that there was no medical necessity exception to drug laws, and federal government is free to raid, arrest, prosecute, and imprison patients who are using medical marijuana no matter if the medicine is crucially necessary to them. On the other hand, in Gonzales v. Raich, the Ninth Circuit Court of Appeals told a sufferer in extreme pain that they could not rely on state law allowing medical use, but if arrested they could seek to use medical necessity as a defence.
In the state of Maryland, a bill signed by former governor Robert Ehrlich, became law in 2003 permitting patients to use medical necessity defense to marijuana possession in the state. The maximum penalty for these users cannot exceed $100. However, this law does not prevent federal prosecution of patients, as the federal law does not recognize medical necessity. 
- Your Medicare Coverage from medicare.gov
- Medicare Coverage Database which includes NCDs, LMRP/LCDs, as well as NCAs & CALs, from cms.hhs.gov
- Physician Fee Schedule lookup at cms.hhs.gov
- What is medical necessity? by Nancy W. Miller, as found in the Physician's News Digest
- Defining Medical Necessity Under the Patient Protection and Affordable Care Act at academia.edu., by Daniel R. Skinner, published in the journal Public Administration Review (2013).
- Charles Martin, "Medical Use of Cannabis in Australia: 'Medical necessity' defences under current Australian law and avenues for reform" (2014) 21(4) Journal of Law and Medicine 875.
- Florida's Medical Necessity Defense, Reconsidered by Miami attorney Jared H. Beck