190 F.3d 1109 (9th Cir. 1999)
UNITED STATES OF AMERICA, Plaintiff-Appellee,v.OAKLAND CANNABIS BUYERS' COOPERATIVE; JEFFREY JONES, Defendant-Appellant.
Nos. 98-16950, 98-17044, and 98-17137
UNITED STATES COURT OF APPEALS FOR THE NINTH CIRCUIT
Argued and Submitted April 13, 1999Decided September 13, 1999

[Copyrighted Material Omitted]
Robert A. Raich, Oakland, California; Gerald F. Uelmen, Santa Clara University School of Law, Santa Clara, California; and Annette P. Carnegie, Morrison & Foerster, San Francisco, California, for the appellants-defendants.
Mark B. Stern, Assistant Attorney General, United States Department of Justice, Washington, D.C., for the plaintiff appellee.
Appeal from the United States District Court for the Northern California; Charles R. Breyer, District Judge, Presiding.  D.C. No. CV-98-00088-CRB.
Before: Mary M. Schroeder, Stephen Reinhardt, and Barry G. Silverman, Circuit Judges.
PER CURIAM:


1
This interlocutory appeal involves a preliminary injunction entered at the United States' request, to stop the distribution of cannabis in the wake of California's initiative supporting the medical use of marijuana. The district court held that the distribution of marijuana by certain cannabis clubs and their agents, including appellant, Oakland Cannabis Buyers' Cooperative and Jeffrey Jones (collectively "OCBC"), likely violates the Comprehensive Drug Abuse Prevention and Control Act of 1970 (the "Controlled Substances Act"), 21 U.S.C. S 841(a)(1). See United States v. Cannabis Cultivators Club, 5 F. Supp. 2d 1086, 1105 (N.D. Cal. 1998). The district court also indicated that it would consider in subsequent contempt proceedings a defense that a particular distribution was justified by a medical necessity. Id. at 1102. OCBC did not appeal the district court's order enjoining the distribution of marijuana by cannabis clubs. Instead, OCBC seeks to appeal three subsequent orders: (a) an order denying OCBC's motion to dismiss the complaint on the ground that an Oakland City ordinance makes it immune from liability under 21 U.S.C. S 885(d); (b) an order subsequently purged and vacated that found OCBC in contempt of the injunction; and (c) an order denying OCBC's motion to modify the injunction to permit cannabis distribution to persons having a doctor's certificate that marijuana is a medical necessity for them.


2
We lack jurisdiction over the appeal from the denial of the motion to dismiss and from the contempt order that has been purged. We have jurisdiction over the appeal from the denial of the motion to modify. We do not vacate the injunction, but remand for the district court to consider modifying the order.

Denial of the Motion to Dismiss

3
The district court denied the defendants' motion to dismiss that was grounded in the Oakland City Council's attempt to immunize OCBC under the Controlled Substances Act. The district court held that section 885(d) of the Controlled Substances Act is intended to protect state law enforcement officials when they engage in undercover drug operations, and these defendants do not engage in such activities.


4
We lack jurisdiction of the appeal because the denial of a motion to dismiss is generally not appealable. See 28 U.S.C. SS 1291 & 1292 (granting appellate jurisdiction over final orders and limited interlocutory orders). The denial of the motion to dismiss is not one of the interlocutory orders that can be appealed under S 1292, and it is not a final judgment under S 1291. See, e.g., Credit Suisse v. UnitedStates Dist. Ct., 130 F.3d 1342, 1345-46 (9th Cir. 1997).


5
OCBC contends we have jurisdiction under 28 U.S.C. S 1292(a)(1) authorizing, inter alia, appellate jurisdiction over an interlocutory order "continuing . . . or refusing to dissolve or modify injunctions." OCBC asks us to treat the district court's denial of the motion to dismiss as, in effect, a continuance of the injunction and a refusal to dissolve it. OCBC relies upon Jung Hyun Sook v. Great Pacific Shipping Co., 632 F.2d 100, 102 n.4 (9th Cir. 1980).


6
The motion to dismiss in Jung Hyun Sook, however, was not a motion to dismiss the action in its entirety, but a motion intended specifically to dissolve an injunction. There the district court had enjoined the further prosecution of a Jones Act suit pending the determination of a petition to limit liability. Id. at 102. The district court's denial of the motion to dismiss the limitation of liability petition was appealable because its denial continued in effect the injunction against further prosecution of the Jones Act suit. The purpose of the motion to dismiss in that case was not to decide the merits of the litigation, but only to dissolve the injunction. See 16 Wright & Miller, Federal Practice and Procedure , S 3924.2, at 198-99 n.6 (2d ed. 1996). The motion to dismiss in this case was intended to resolve the entire dispute on the merits. While one effect of granting OCBC's motion to dismiss in this case would have been to dissolve the preliminary injunction, the broader purpose was to resolve the case in defendants' favor. The general rule barring appeals from the denial of motions to dismiss, therefore, must apply. See Credit Suisse, 130 F.3d at 1345-46 ("The district court's denial of [defendants'] motion to dismiss is not a `final decision' within the meaning of 28 U.S.C. S 1291, and it is therefore not immediately reviewable.").


7
Nor did the district court's denial of the motion to dismiss constitute an order "continuing" the injunction within the meaning of 28 U.S.C. S 1292(a)(1). An order that "continues" an injunction under that statute is an order that extends the duration of the injunction that would otherwise have dissolved by its own terms. See 16 Wright & Miller, supra, at 196; see also Public Serv. Co. of Colorado v. Batt, 67 F.3d 234, 23637 (9th Cir. 1995); In re Fugazy Express, Inc. , 982 F.2d 769, 777 (2d Cir. 1992).


8
OCBC also argues that the denial of the motion to dismiss is appealable as a "collateral order" under the theory of the Supreme Court's decision in Mitchell v. Forsyth, 472 U.S. 511 (1985). Mitchell permits appeal from orders denying immunity from suit to government officials on damage claims for violations of federal rights. Such orders are immediately reviewable because the immunity at stake is not merely an immunity from liability but an "immunity from suit" that is effectively lost if a case goes to trial. See id. at 526. Section 885(d) is not such an immunity from suit, but is on its face simply an immunity from liability. It provides that "no civil or criminal liability will be imposed" upon law enforcement officers who engage in drug activity as part of their duties. 21 U.S.C. S 885(d). Thus, OCBC can obtain effective review of its liability (or immunity) under the Controlled Substances Act after the district court has rendered a final judgment.


9
In addition, the order being appealed is not a "collateral order" involving an important issue separate from the merits of the lawsuit. See Cohen v. Beneficial Indus. Loan Corp., 337 U.S. 541, 546 (1949). The merits of the government's suit depend squarely upon whether or not OCBC is immune from liability under S 885(d).

The Contempt Order

10
OCBC appeals the district court's order finding it in contempt and modifying the preliminary injunction so as to empower the U.S. Marshal to seize OCBC's offices. The court neither fined nor jailedmembers of OCBC as a result of the contempt. The district court subsequently vacated this modification to the injunction on October 30, 1998 after OCBC told the court that it would comply with the injunction. Consequently, OCBC was permitted to re-enter its offices.


11
The government argues that this appeal is moot because the modification order was vacated and the contempt purged. "A long line of precedent holds that once a civil contempt order is purged, no live case or controversy remains for adjudication." Thomassen v. United States, 835 F.2d 727, 731 (9th Cir. 1987); accord In re Campbell, 628 F.2d 1260, 1261 (9th Cir. 1980). However, a party asserting that an issue is moot must demonstrate that there is no reasonable expectation that the violation will recur. See County of Los Angeles v. Davis, 440 U.S. 625, 631 (1979); Campbell , 628 F.2d at 1261.


12
This court has held that a purged contempt order is moot unless there is "near certainty" that the violation will recur. Campbell, 628 F.2d at 1262. That is not the case here. In its reply brief, OCBC reiterates that it has promised the district court that it will comply with the injunction. The only way for the violation to recur is if OCBC breaks its promise. Clearly, it is not a "near certainty" that OCBC will do so. Moreover, although the purged contempt order at issue in Campbell was not moot, the court explicitly limited its result to the facts of that case: "We emphasize that were it not for the statement of the grand jury foreman [informing the witness that he would be required to testify again in the future], we would be inclined to find that the purging of the contempt orders mooted the present appeals." Id. at 1261.


13
OCBC also contends that the appeal of the contempt order is not moot because it is "capable of repetition, yet evading review." An issue may evade review because of aninherent limit in the duration of a challenged action that prevents full litigation before it ends. See Phoenix Newspapers, Inc. v. United States Dist. Ct., 156 F.3d 940, 945 (9th Cir. 1998). However, nothing inherently limited the duration of OCBC's contempt other than its own decision to purge. The appeal is now moot because OCBC voluntarily purged the contempt by declaring that it would comply with the injunction. Had OCBC chosen to remain in contempt to this day, the appeal would not be moot because this court could have provided a remedy.


14
OCBC argues that even if the denial of the motion to dismiss and the modification order are not in and of themselves appealable, the court should assert pendent appellate jurisdiction because they are "inextricably intertwined" with the denial of the motion to modify the injunction, which is appealable. See Swint v. Chambers County Comm'n , 514 U.S. 35, 51 (1995). We have held that the "inextricably intertwined" doctrine should be narrowly construed; more is required than that separate issues rest on common facts. See California v. Campbell, 138 F.3d 772, 778 (9th Cir.), cert. denied, 119 S. Ct. 64 (1998). The legal theories on which the motion to dismiss, the contempt order, and the motion to modify are independent of each other. Each required application of different legal principles. They are not therefore so "intertwined" as to necessitate simultaneous review.

Denial of the Motion to Modify

15
OCBC contends that the district court abused its discretion by refusing to modify its injunction to permit cannabis distribution to patients for whom it is a medical necessity. A few days after the district court issued its contempt citation instructing the Marshals to padlock its premises, OCBC asked the district judge to modify the injunction to allow continuing cannabis distribution to patients whose physicians certify that (1) the patient suffers from a serious medical condition; (2) if the patientdoes not have access to cannabis, the patient will suffer imminent harm; (3) cannabis is necessary for the treatment of the patient's medical condition or cannabis will alleviate the medical condition or symptoms associated with it; (4) there is no legal alternative to cannabis for the effective treatment of the patient's medical condition because the patient has tried other legal alternatives to cannabis and has found them ineffective in treating his or her condition or has found that such alternatives result in intolerable side effects.  These factors were modeled on this court's recognition of a necessity defense to violations of federal law in United States v. Aguilar, 883 F.2d 662, 692 (9th Cir. 1989).


16
The denial of a motion to modify an injunction is independently appealable under S 1292(a)(1) as one of the appealable interlocutory orders denominated in that section. Therefore, we have jurisdiction to review the order denying OCBC's motion for modification.


17
The district court summarily denied OCBC's motion, saying that it lacked the power to make the requested modification because "its equitable powers do not permit it to ignore federal law." In doing so, the district court misapprehended the issue. The court was not being asked to ignore the law. It was being asked to take into account a legally cognizable defense that likely would pertain in the circumstances.


18
The government did not need to get an injunction to enforce the federal marijuana laws. If it wanted to, it could have proceeded in the usual way, by arresting and prosecuting those it believed had committed a crime. Had the government proceeded in that fashion, the defendants would have been able to litigate their necessity defense under Aguilar in due course. However, since the government chose to deal with potential violations on an anticipatory basis instead of prosecuting them afterward, the government invited an inquiry into whether the injunction should also anticipate likely exceptions. This gives rise to a drafting issue -crafting an injunction that is broad enough to prohibit illegal conduct, but narrow enough to exclude conduct that likely would be legally privileged or justified.


19
In Northern Cheyenne Tribe v. Hodel, we held that courts retain broad equitable discretion when it comes to injunctions against violations of federal statutes unless Congress has clearly and explicitly demonstrated that it has balanced the equities and mandated an injunction. 851 F.2d 1152, 1156 (9th Cir. 1988). Here, although the government may be entitled to its requested injunction, there is no evidence that Congress intended to divest the district court of its broad equitable discretion to formulate appropriate relief when and if injunctions are sought. Further, there is no indication that the "underlying substantive policy" of the Act mandates a limitation on the district court's equitable powers. Id. at 1156.


20
The district court erred in another respect as well. In deciding whether to issue an injunction in which the public interest would be affected, or whether to modify such an injunction once issued, a district court must expressly consider the public interest on the record. The failure to do so constitutes an abuse of discretion. Northern Cheyenne Tribe, 851 F.2d at 1156; American Motorcycle Association v. Watt, 714 F.2d 962, 965 (9th Cir. 1983); Carribean Marine Serv. Co. v. Baldridge, 844 F.2d 668, 678 (9th Cir. 1988). OCBC has identified a strong public interest in the availability of a doctor-prescribed treatment that would help ameliorate the condition and relieve the pain and suffering of a large group of persons with serious or fatal illnesses. Indeed, the City of Oakland has declared a public health emergency in response to the district court's refusal to grant the modification under appeal here. Materials submitted in support of OCBC's motion to modify the injunction show that the proposed amendment to the injunction clearly related to a matter affecting the public interest. Because the district court believed that it hadno discretion to issue an injunction that was more limited in scope than the Controlled Substances Act itself, it summarily denied the requested modification without weighing or considering the public interest.


21
We have no doubt that the district court could have modified its injunction, had it determined to do so in the exercise of its equitable discretion. The evidence in the record is sufficient to justify the requested modification. OCBC submitted the declarations of many seriously ill individuals and their doctors who, despite their very real fears of criminal prosecution, came forward and attested to the need for cannabis in order to treat the debilitating and life threatening conditions.


22
In short, OCBC presented evidence that there is a class of people with serious medical conditions for whom the use of cannabis is necessary in order to treat or alleviate those conditions or their symptoms; who will suffer serious harm if they are denied cannabis; and for whom there is no legal alternative to cannabis for the effective treatment of their medical conditions because they have tried other alternatives and have found that they are ineffective, or that they result in intolerable side effects.


23
The government, by contrast, has yet to identify any interest it may have in blocking the distribution of cannabis to those with medical needs, relying exclusively on its general interest in enforcing its statutes. It has offered no evidence to rebut OCBC's evidence that cannabis is the only effective treatment for a large group of seriously ill individuals, and it confirmed at oral argument that it sees no need to offer any. It simply rests on the erroneous argument that the district judge was compelled as a matter of law to issue an injunction that is coextensive with the facial scope of the statute.


24
The district court, accepting the government's argument that it lacked the authority to grant the requested modification, failed to undertake the required analysis and summarily denied OCBC's request. Accordingly, we reverse the order denying the modification and remand. On remand, the district court is instructed to reconsider the appellants' request for a modification that would exempt from the injunction distribution to seriously ill individuals who need cannabis for medical purposes. In particular, the district court is instructed to consider, in light of our decision in United States v. Aguilar, 883 F.2d 662, 692 (9th Cir. 1989), the criteria for a medical necessity exemption, and, should it modify the injunction, to set forth those criteria in the modification order.


25
The panel will retain jurisdiction over any further appeals in this case.


26
The case is REMANDED for further proceedings consistent with this opinion.

