If your doctor is wearing an electronic ankle bracelet, it might be a good idea to ask why.

Harvard-trained cardiologist Vignendra Ariyarajah, who is accused of killing his mistress’ baby because she was pregnant by another man, was fitted with one of the court-ordered monitoring devices while out on $750,000 bond — yet is still seeing patients and doling out prescriptions at medical centers in Brooklyn, it surfaced in court Tuesday.

The doctor has been charged with criminally negligent homicide, manslaughter, assault and other raps in the heinous case.

He is accused of orchestrating the death of his lover’s baby in a jealous rage after learning she was pregnant by another man — who prosecutors revealed in court was a cop.

The “woman was impregnated by a police officer,’’ said Assistant District Attorney Linda Weinman.

The married doctor allegedly enlisted two cohorts to keep his 7 ¹/₂ -months pregnant mistress trapped in a Ditmas Park apartment and administer fentanyl and possibly PCP to her to induce early labor — all while he was skiing in Montana with his wife.

The infant boy lived less than a day, while his mother, Paul Marie Raymond, was found with chemical burns, ligature marks and torn-off fingernails after the tortured birth, officials said.

But the criminal charges against Ariyarajah — who has hobnobbed with Mayor de Blasio and former Vice President Joe Biden — haven’t kept him from practicing medicine in Brooklyn, his lawyer said in court.

According to the Web site Zocdoc, Ariyarajah is affiliated with Brooklyn Hospital Center and is at the top of the physicians’ list for Med Care Consultants, which has an office on Church Street in Brooklyn.

The Brooklyn Hospital Center did not respond to a request for comment. A woman at Med Care declined to comment.

A rep for the state Health Department, which oversees the body governing medical licenses, told The Post in a statement Tuesday, “After first learning of these heinous criminal allegations through media reports today, the Office of Professional Medical Conduct (OPMC) immediately began reviewing all options which under law include moving to immediately suspend a physician’s license pending the outcome of a full investigation.

“Our number one priority is the safety of patients, and we are doing everything in our power to ensure this physician does not pose a risk to patients.”

Ariyarajah, whose release with a monitor was arranged by bail bondsman Ira Judelson, had met his mistress at a clinic where they both worked, a law-enforcement source has said. She worked for him for nine years, according to the defendant’s lawyer, Matt Myers.

Myers has denied the charges against his client and balked Tuesday at the notion that the doctor in any way helped illegally administer drugs to Raymond.

“There is no prescription that he illegally prescribed. There was no PCP in the baby’s system,” Myers said. “He is actually allowed to give this woman [the sedative] Lorazepam, he has a chart for her. … This is not some illegal prescription he’s given here.”

But Assistant District Attorney Linda Weinman countered, “I have narcotic reports that he wrote this prescription” for PCP for Raymond.

The dead baby tested positive for both fentanyl, a highly potent narcotic, and PCP, a law-enforcement source has said.

The doctor appeared before Justice John Ingram in Brooklyn Supreme Court for a routine status hearing, which was eventually adjourned. The suspect, dressed in a gray suit and pink shirt, said, “No comment’’ to The Post after court.

Another woman on her way out of the Church Avenue Multispeciality clinic where Ariyarajah works walked from the facility and also jumped to his defense.

“Innocent until proven guilty,” said the woman, who acknowledged that she does not know him.

Photos posted to Med Care’s Web site show him posing alongside de Blasio at a promotional event for the city’s Pakistan Day Parade last year, and also smiling with Biden.

The defendant, whose wife did not accompany him to the hearing, is due back in court May 9.

Additional reporting by Rebecca Rosenberg and Lorena Mongelli