Prime Minister Justin Trudeau will be portrayed in Sunday’s Canadian-themed episode of “The Simpsons,” which is titled “D’Oh Canada.” Toronto journalist Lucas Meyer tweeted on Monday that he got to guest-voice Trudeau for the segment after putting together an impressions video on YouTube. (THE CANADIAN PRESS/HO-City TV)

“The Simpsons” consulting producer Tim Long grew up in Ontario and has always sensed something secretly Canadian about Lisa, the middle child and most critically-minded member of the enduring American animated family.

“She’s the one who’s had the most barbed critiques of the United States,” Long, a writer-producer who was raised in Exeter, Ont., said in a recent phone interview.

“I thought Bart was sort of like America: brash, unreflective, much more sure of himself. And Lisa was sort of the intellectual, quiet, thoughtful, rational one. And I’ve always felt like that was sort of the relationship between America and Canada, too.”

So when it came to this Sunday’s Canadian-themed episode, it felt natural to make Lisa the one who spends time on this side of the border, said Long, who has won five Emmy Awards.

It happens when the Simpsons visit Niagara Falls and, through a series of wacky mishaps, Lisa goes over the powerful flow of water that separates Ontario and New York.

She lands on the Canadian side and is admitted to hospital, where she realizes Canada is the place for her.

The episode, “D’Oh Canada,” airs on Citytv and Fox.

“She is not unscathed, but because of Canada’s incredibly generous health-care system, she ends up just fine,” said Long, who co-wrote the episode with his wife, screenwriter Miranda Thompson.

“The Simpsons, when they see her in the hospital, are fully prepared to go bankrupt, because that’s what would happen to them in America. But they’re stunned and amazed and delighted to find the health-care system takes care of them.”

Yes, much of the Simpsons clan also visits Canada in the episode, which Long said has “a shocking number of Canadian things” that “95 per cent of the American audience won’t get.”

“They’re briefly there but then Homer gets belligerent and they’re asked to leave, except for Lisa. Then much of the rest of the show features the Simpsons plotting to get her back and trying to convince Lisa that she should come back, because she’s at least initially very happy.”

While Meyer recorded his role in September, Long said they write episodes “until the very last second,” leaving room for current references.

One of those references on Sunday might be the SNC-Lavalin controversy, Long suggested when he said “there may be mention of a current scandal that” Trudeau is in.

“Compared to putting immigrant children in cages, this scandal feels a little bit like small beer to me,” said Long, referencing 2018 footage of migrant children housed in fenced-off cages at U.S. border facilities.

“But I know also that it’s serious and maybe not everyone has been forthcoming about what happened. I understand he’s behind in the polls, which I think would shock most Americans.”

Long was born in Brandon, Man., and moved to Exeter with his family when he was four. He got his big break as head writer of “Late Show with David Letterman” and joined “The Simpsons” in 1998.

He lives in Los Angeles but has found himself back on home soil lately, in Almonte, Ont., shooting the film “The Exchange.” Long wrote the comedy, which is set in Canada and loosely based on his experience with an exchange student as a teen.

On “The Simpsons,” he’s one of three Canadian writers, the others being Joel H. Cohen and Jeff Westbrook.

“Canada is always in the air” in the writers’ room, said Long.

“I remember the day when we taught them that the Canadian one-dollar coin was called a loonie and the two-dollar coin was called a toonie. Oh, that shut down work for several hours, because nobody could believe it.”

The show has referenced Canada before, including an episode where Homer and Grandpa Simpson smuggle prescription drugs from here.

“With the Canadian references, my instinct when I first started was not to make too many of them, because I wanted to fit in,” said Long. “But I find that the kind of American who writes for ‘The Simpsons’ is fascinated by it.

“So you’ll often find that the references on the show to Canada haven’t been written by Canadians, but they’ve been written by Americans looking across the table at a Canadian and thinking, ‘What the hell is with that guy?’”