Imagine having a rough week at work, catching the flu, calling in sick for three days, and then returning to discover you’ve been demoted. In corporate America, you might have grounds for a lawsuit. In baseball, you suck it up and pitch the eighth inning.

Andrew Bailey learned that lesson, to an extent, this winter. His 2012 injury problems were far worse than the flu — he missed four months with a thumb injury — but the results were the same. The Red Sox didn’t even let him compete for his job. They acquired two-time All-Star closer Joel Hanrahan in a trade with the Pirates, and that was that.

But three weeks into the season, Hanrahan finds himself wondering what role he’ll fill when he returns from the disabled list shortly. He’s that guy with the flu, and it certainly looks like he’s about to lose his job because of it.

A notoriously slow starter, Hanrahan once again struggled out of the gate this year before tweaking a hamstring and landing on the DL. He was 0-1 with an unsightly 11.57 ERA in his first six appearances.

Bailey, meanwhile, keeps getting better and better. Yesterday, he struck out the side in the ninth to secure a 6-5 win against the A’s, giving him five saves in his league-high 12 appearances. Bailey owns a 1.59 ERA and an absurd 20 strikeouts in just 111⁄3 innings.

So what does Hanrahan make of all of this and the impact it could have on his own role when he returns?

“I can’t answer that question for you,” Hanrahan said yesterday. “We’ll talk about that when the time comes.”

The Hanrahan-Bailey dynamic has been an interesting one all season. Both are two-time All-Stars who want to close. Both have proven themselves in small markets, but not big ones. Both want the job, and neither will apologize for being a competitor.

Before the Red Sox even acquired Hanrahan, they let Bailey know a deal loomed. Manager John Farrell eliminated any chance of a closer controversy by anointing Hanrahan during the winter.

Bailey could have sulked and whined, but he said all the right things publicly, and if he harbored any resentment toward Hanrahan, he didn’t let it show. The two seem friendly.

“They had a couple of conversations with him I guess from what I heard,” Hanrahan said of Bailey. “After missing a lot of time last year, he just wanted to go out and pitch. Obviously, he’s handled it really well. He probably wasn’t the happiest guy when it all went down, but he stepped up and he’s been pitching great.

“He’s doing really good. He’s coming back off a tough year for him last year. It’s good to see. Obviously, with the role he’s in right now, it’s helping out the team, and the team’s been dominating.”