TORONTO -- Ontario's highest court ruled Wednesday that doctors in the province must give referrals for medical services that clash with their religious beliefs, calling it a compromise that balances the rights of physicians and the interests of patients.

In a unanimous ruling, a three-judge panel dismissed an appeal seeking to overturn a divisional court decision that upheld the requirement for an "effective referral," an effort to connect patients with another, willing health-care provider.

The requirement is part of a set of policies issued in 2016 by the College of Physicians and Surgeons of Ontario to address issues surrounding, among other things, assisted dying, contraception and abortion.

"The issues raised in this proceeding present difficult choices for religious physicians who object to the policies, but they do have choices," the appeal court wrote.

"While the solution is not a perfect one for some physicians, such as the individual appellants, it is not a perfect one for their patients either. They will lose the personal support of their physicians at a time when they are most vulnerable."

The policies "represent a compromise," the court wrote.

"They strike a reasonable balance between patients' interests and physicians' Charter-protected religious freedom. They are reasonable limits prescribed by law that are demonstrably justified in a free and democratic society."

The college, which regulates doctors in Ontario, called the ruling a victory for patients.

"The court has recognized the importance of ensuring patients get access to the care they need," said Dr. Nancy Whitmore, its registrar and CEO. "Our effective referral policy ensures equitable access to health care, particularly on the part of the more vulnerable members of our society while respecting the rights of all of those involved."

Those behind the appeal expressed their disappointment at the outcome of the case, saying the decision will put some physicians in an impossible position.

"Ultimately it is patient care that suffers, as our doctors will retire early, relocate, or change fields," said Dr. Ryan Wilson, president of Canadian Physicians for Life, one of three professional organizations involved in the appeal, along with five individual doctors.

"For many, their religious and conscience rights are being violated and they won't be able to practise medicine in Ontario."

The appeal challenged a ruling last year by the divisional court, which found that while the referral requirement does infringe on doctors' religious freedom, the benefits to the public outweigh the cost to physicians.

The lower court noted an effective referral is not as involved as a formal one, in which a doctor is required to provide a letter and arrange an appointment with another physician. It said doctors can ask staff to handle the effective referral, or choose to specialize in a type of medicine where these issues are less frequent.

In the appeal, the group of doctors argued the ruling was unreasonable because it gave more weight to an assumed problem with access to health care than to a real infringement of doctors' rights.

The group -- which includes the Christian Medical and Dental Society of Canada, the Canadian Federation of Catholic Physicians' Societies and Canadian Physicians for Life -- said there is no evidence that patients would be harmed by not receiving a referral.

It also alleged the court erred in saying doctors could pick specialties where fewer moral conflicts arise, arguing that presumes physicians can easily switch jobs.

The group also introduced new evidence in the appeal, arguing Ontario's Care Co-ordination Service meant to help navigate the assisted dying process was now accessible to the public rather than only physicians and could thus replace an effective referral.

The appeal court agreed with the divisional court that "as a matter of logic and common sense" the requirement for an effective referral promotes equitable access to care, particularly for vulnerable patients.

It also found that the self-referral method proposed by the doctors' group would not meet the needs of patients seeking "the most intimate and urgent medical advice and care."

"It is impossible to conceive of more private, emotional or challenging issues for any patient," the appeal court wrote. "Given the importance of family physicians as 'gatekeepers' and 'patient navigators' in the health-care system, there is compelling evidence that patients will suffer harm in the absence of an effective referral."

While the doctors' group argued the requirement will force physicians to leave the province or cease practising medicine, which would harm the public, the appeal court noted no evidence to that effect was presented.

Changing the scope of their practice may require sacrifices from physicians, the appeal court found. However, "the appellants have no common law, proprietary or constitutional right to practise medicine," it said.

The college had brought new evidence on appeal suggesting doctors could change or narrow the scope of their practice without resorting to retraining. Its expert witness said some areas of medicine are unlikely to encounter requests for assisted death or reproductive health issues, including hair restoration, sport and exercise medicine, hernia repair and aviation examinations.