BOSTON — When Didi Gregorius is activated from the disabled list Friday night, Joe Girardi will try to figure out where the left-handed hitting shortstop fits best into the Yankees’ lineup.

“I don’t know. I started going over it with some guys and I’m going to have a flight and all day [Friday] morning to think about it,’’ Girardi said of adding Gregorius into the lineup against Orioles right-hander Kevin Gausman.

Since Gregorius developed into a run producer last season, when he hit .276 with 20 homers and 70 RBIs, he isn’t going to hit in the lower third of the order.

“I’m going to have to make an adjustment now that Didi is coming back because you figure he is going to hit somewhere in the middle area,’’ Girardi said before the Yankees’ 3-0 victory over the Red Sox on Thursday night at Fenway Park. “I’m going to have to figure that out and how to separate the lefties.’’

When spring training opened, Gary Sanchez and Gregorius were healthy, and that led to speculation Jacoby Ellsbury could be dropped to seventh. However, Ellsbury has hit first, second, fourth and fifth in the order, and is hitting .301 (22-for-73).

One option for Girardi is to use Ellsbury in the leadoff spot and drop the ice-cold Brett Gardner down to the lower third of the order. Gardner, in a 2-for-23 slump and hitting with a .186 for the season, was on the bench Thursday when the Yankees faced Red Sox lefty Chris Sale and Ellsbury led off.

When Sanchez returns from a right biceps injury, Girardi will have to adjust the lineup again.

Sanchez is scheduled to start a minor league rehab assignment Tuesday. It most likely will be for Triple-A Scranton/Wilkes-Barre, but foul weather could change the location.

“He will catch a little bit and DH some,’’ general manager Brian Cashman said of Sanchez, who last played April 8 when he injured the biceps area swinging a bat.

Thursday was the first time since the injury Sanchez took batting practice on the field.

“I’m happy to be able to hit outside. It’s a different feel than in the cage,’’ said Sanchez, who explained how he feels following the first game will determine how many rehab games he needs. “I don’t think I need many games, but we’ll see how I feel. Physically I feel great, just a little bit out of rhythm, but that’s normal.’’

Sanchez still has to throw to bases and likely will do that Saturday or Sunday.

Masahiro Tanaka needed just 97 pitches to beat the Red Sox on Thursday night. That is the fewest by a Yankee in a nine-inning, complete-game outing since Chien-Ming Wang threw 93 against the Red Sox on April 11, 2008, at Fenway Park.

The Yankees improved to 13-7, and though they certainly will welcome Gregorius and Sanchez back, shortstop Ronald Torreyes and catcher Austin Romine have been capable replacements.

“They have done everything and then some,’’ Cashman said of the duo. “Anything you hoped any reserve would provide.’’

Torreyes had two hits off Sale and is hitting .308 (20-for-65) with 13 RBIs. Romine is at .273 and getting high praise from the pitching staff and Girardi for his game-calling and defensive prowess.

The plan for Torreyes with Gregorius back is for him to play short, second and third. And Girardi said he wouldn’t hesitate to use the 5-foot-8, 150-pounder in the outfield.

Infielder Pete Kozma is the prohibitive favorite to be designated for assignment to make room for Gregorius.

Girardi, Cashman and pitching coach Larry Rothschild repeated what Aroldis Chapman said following a shaky ninth inning Wednesday night: The closer was OK.

After recording the final out of a 3-1 victory, television cameras caught Chapman pointing to his left elbow. That and just one of his 33 pitches reaching 100 mph — he gave up a run, a hit and two walks — led to questions about Chapman’s health.

“He is healthy. At times you don’t have your best stuff,’’ Cashman said.

Despite throwing 33 pitches in one inning, Girardi said he would not have shied away from using Chapman if he had been needed Thursday night.

“I think if his workload was heavier we would be more worried about it,’’ Girardi said.

According to Girardi, Aaron Judge was “a little sore’’ after crashing into and over the wall in foul territory Wednesday night when he made a sensational catch.

“He said he’s ready to go and he’s fine,’’ said Girardi, who explained Judge didn’t require any tests.

Judge went 0-for-3 and was hit by a Sale pitch.