They informed Rav Yehudah: There is a deadly plague affecting the pigs. He decreed a fast. Do we say that Rav Yehudah holds that a plague which affects one [animal] species is likely to affect all species (and therefore, kosher farm animals were threatened also)? No. Pigs are different since their digestive tracts are similar to those of humans. Babylonian Talmud, Taanis 21b
Since both pigs and humans lack a certain abdominal organ, there is reason to fear that epidemics that affect pigs may also particularly affect humans.
Meiri, Taanis 21b
Swine flu is only the most recent contagious epidemic to surface. History is replete with epidemics that swept the world, at times killing or seriously sickening significant portions of the population, and causing social and political upheaval. While there have been multiple world-wide pandemics in the last century (including the polio pandemic of the 1950s), several were not particularly severe. But in 1918, a world-wide influenza pandemic, known as "Spanish flu," killed between 20 and 40 million people, more than the number of people killed in World War One. In fact, more people died in one year of the Spanish flu than in the four years of the Black Plague (Bubonic Plague) pandemic that swept the world from 1347-1351.
It is not clear how severe the current Swine Flu outbreak will be. Sometimes the specter of widespread epidemic does not pan out, such as the frightening SARS outbreak in 2003 and the recent Avian Flu scare. Nevertheless, society must take precautions to protect itself from potential disaster. It is the protective measures which society utilizes that raise ethical questions. Many of these issues boil down to the conflict between individual autonomy and communal protection.
Judaism encourages policies which improve public health. While the Jewish approach to illness and healing requires us to recognize the paramount role of God in healing, we are obligated to guard our health by avoiding harmful activities and seeking appropriate medical care.  One is not even permitted to live in a city that does not have a doctor! 
What if someone does not agree to be quarantined?
Further, there is a Biblical obligation to return someone's health and a prohibition to "stand idly by" and allow one's neighbor to become harmed. In fact, Maimonides, in his commentary on the Mishna,  teaches that the obligation of a physician to heal is derived from the Torah obligation to return a lost object. Maimonides explains that if one must return a lost object, he must surely return his friend's lost health! As a result, a physician is required to treat contagious patients after taking reasonable precautions to protect his health.
Even without a religious obligation, most people would probably want to cooperate with any governmental policies that would decrease the risk of spreading disease. But what if someone does not wish to cooperate? Does society have the right to limit their autonomy and coerce desirable action by mandating screening and treatment for serious contagious illnesses and breaching confidentiality to further public health goals?
For example, historically, when tuberculosis has posed a significant health risk, patients who did not voluntarily seek out treatment were forcibly institutionalized to receive treatment. Even today, there are places in the United States that allow involuntary incarceration for tuberculosis treatment. The justification is that the untreated patient poses an unacceptable risk to others which justifies limiting his freedom.  Does Judaism accept this approach?
Autonomy versus Coercion
While there is a degree of patient autonomy in Jewish law, it is based on the idea that the patient is the final arbiter of what treatment is most prudent for his particular illness, based on his particular circumstances. Nevertheless, the patient is required to seek appropriate medical care and he may not refuse a standard and safe therapy that is documented to be effective, unless there is some other effective treatment. If the patient refuses an effective treatment for a dangerous condition, he may be coerced  to accept treatment unless the procedure or the stress of coercion poses an even greater risk to his health. 
It would follow that if the patient himself needs the treatment, particularly if the disease is life-threatening, then he is obligated to accept it and therefore society is justified in requiring it. But what if the threat to him is small, but the risk to others is great? Beyond the obligation to guard one's own health and to treat his neighbor's illness, there is an additional area of Jewish law that comes into play when it comes to public health.
The area of Jewish law called Choshen Mishpat, which deals with contracts and business, also spells out Torah based and rabbinic obligations that one has towards his fellow man to avoid causing damage. For instance, the Torah discusses the damages one must pay for digging a pit in a public place that may cause injury. The Talmud fleshes out this concept, with Jewish legal texts explaining that any action that creates a public safety threat is forbidden and creates liability on the part of the perpetrator.  This concept plays out in several ways in our current issue of epidemic and pandemic.
A person who carries a dangerous disease, even if he himself is not affected, is forbidden to act in a way that might spread the disease and must minimize danger to others.  Therefore, while confidentiality is a sacrosanct concept in Judaism and there is a strict prohibition against lashon hara (gossip) which prohibits revealing confidential information, a physician is obligated to inform the spouse of a patient with AIDS if the spouse will not give over the information himself. Similarly, if confidentiality will threaten public health, then public health must take precedence and information must be appropriately revealed.
Regarding quarantine, the issue is more complex. If a person has symptoms of the serious illness, it is easy to justify quarantine to protect the public. But, if a patient has only possibly been exposed to a serious contagious illness, are we justified in curtailing an individual's autonomy and freedom for a theoretical threat to public health?
The answer revolves around what represents pikuach nefesh (a threat to life). Jewish law requires pushing off all but three Torah prohibitions to save a life. Even for a questionable threat to life, Biblical prohibitions may be set aside. Rabbi Shlomo Zalman Aurbach, a leading Israeli posek of the 20th century, dealt with the question of how far this concept extends. He discussed immunization for a serious illness of which the general population is afraid.  If the vaccination is only offered on the Sabbath or one would have to wait several years to be immunized, foregoing the vaccination is considered a possible threat to life and justifies transgressing the Sabbath.  We see from this ruling that preventative health for an individual falls under the rubric of questionable threat to life.
Even those who do not display signs of flu are urged to remain in voluntary isolation for seven days.
A practical application of this concept is occurring with the current health crisis. The Israeli Health Ministry has ordered the quarantine of several people who have returned from Mexico and show signs of possible Swine Flu. Even those arriving from Mexico who do not display signs of flu are being urged to remain home in voluntary isolation for seven days, the incubation period of Swine Flu, until they are sure that no signs of the illness develop.
Two prominent poskim, Rabbi Yosef Sholom Elyashiv and Rabbi Shmuel Wosner, added halachic credence to the government's approach by ruling this week that yeshiva students who had recently returned from Mexico must be segregated from the other students until it is confirmed whether they have contracted Swine Flu. Rabbi Yosef Sholom Elyashiv, a leading rabbinic legal expert in Israel justified the quarantine, saying that "it could be a question of pikuach nefesh and until it is certain the students returning from Mexico are not infected, they should remain separate from the others."
Rabbi Wosner ruled that the students' school "must adhere to Health Ministry directives to keep the students separate."  Both of these rulings support quarantine in situations of public health concern, despite the inconvenience to the asymptomatic individuals.
It becomes clear that in times of epidemic, when weighing private rights versus societal obligations, society has a right to limit the autonomy of individuals if such limitations are reasonable and necessary for public health. Of course, such actions must be done in a way that limits inconvenience to the individual. Let us pray for a speedy and safe ending to the current medical crisis.
 Maimonides, Mishneh Torah, Hilchos Deos, Chapt. 4. The Biblical sources themselves are found in Deuteronomy 4:9 and Deuteronomy 4:15 which are Biblical sources for the obligation to guard one's health and Deuteronomy 22:8 which commands construction of a roof parapet to prevent injury. See also Maimonides, Mishneh Torah, Hilchos Rotzeach, Chapters, 11, 12, and 14, as well as Shulchan Aruch, Yoreh Deah Chapter 116:5 which discuss the details of guarding health.
 Maimonides, Mishneh Torah, Hilchos Deos, Chapt. 4:23
 Leviticus 19:16
 Maimonides, Pirush Hamishnayos, Nedarim, 4:4, derived from Deuteronomy 22:1-2.
Saks, Elyn, Refusing care: forced treatment and the rights of the mentally ill, University of Chicago Press, 2002, p. 69.
 Coker, Richard, From chaos to coercion: detention and the control of tuberculosis, Palgrave Macmillan, 2000 pp. 126-131
Mor U'Ketziah, Orach Chaim 328
Igros Moshe, Choshen Mishpat II, 73:5. See also article of Rabbi Dr. Mordechai Halperin in Piskei Din Refuah Umishpat, Vol. 1, 1989, p.101
Tur, Choshen Mishpat 378:1. See also Kehillas Yaakov, Bava Kamma, Chapter 1
Such a person would be considered a pursuer of others and a potential damager.
Rabbi Aurbach deals with smallpox in his responsa at a time before the eradication of the disease by the World Health Organization. See "The Ethics of Smallpox Immunization," .
 Minchas Shlomo, vol. 2:29d (Machon Otzros Shlomo Edition)
 Yeshiva World News, May 1, 2009