PORT ST. LUCIE, Fla. — Matt Harvey said he will start on Opening Day against the Royals, even after a tortured few days of battling a mystery ailment, which was revealed to be a bladder infection that caused a blood clot that had to be passed.

“For me, yeah, I really didn’t know what was going on,” Harvey said Tuesday morning. “I was having trouble using the rest room. And obviously any time there’s discoloration in your urine, it’s not a great feeling. So I didn’t know what was going on with my stomach.”

DatabaseMatt Harvey's career starts

Harvey has been cleared for light baseball activity and will pitch a few innings Wednesday, which will serve as his final tuneup before his first career Opening Day assignment in Kansas City on Sunday night.

“He’s got medical clearance to do whatever he has to do and he’ll be ready to go,” manager Terry Collins said.

The Mets breathed a sigh of relief, especially after what a source called early fears that Harvey might require blood thinners, which would have prevented him from starting on Opening Day.

advertisement | advertise on newsday

“Obviously, yesterday, when you heard the word clot, it can send some shivers through your skin,” Collins said. “Fortunately, it worked out all right. He feels good. He’s going to pitch two innings [Wednesday], get back on the mound, start that game, and get ready for Sunday.”

The ailment, though painful, ultimately had minimal impact on Harvey’s ability to pitch. But it was nonetheless unsettling for the pitcher, whose anguish began Sunday, his 27th birthday.

$relatedItem.embed_code.value

On Monday morning, Harvey reported feeling pain throughout the previous night. He eventually passed the blood clot, which he said may have been the end result of a habit he must now break.

Mets videos

“I guess the main issue is I hold my urine in for too long instead of peeing regularly,” Harvey said. “So I guess I have to retrain my bladder to use the restroom a little bit more instead of holding it in.”

Tuesday’s revelation lifted the mystery that had shrouded Harvey’s ailment.

Citing privacy concerns because it was a non-baseball condition, the Mets kept a tight lid on the situation, refusing to divulge anything more than scant information.

Harvey did not travel with the Mets on Monday, when all players on the roster were scheduled to make the trip to Jupiter, Florida, for a game against the Cardinals.

Vote

Who wins the NL wild card game?

New York Mets San Francisco Giants

The Mets initially said that while Harvey was being examined by doctors for a non-orthopedic medical condition, he was still in line to make his scheduled Grapefruit League start Tuesday. A few hours later, the Mets reversed course and said the ace would be skipped, casting doubt on his availability for the opener.

advertisement | advertise on newsday

“Everything feels great,” Harvey said. “I feel relieved that everything’s clear and good to go.”

Harvey said the most disconcerting part of the ordeal was the early uncertainty about his situation. The rampant speculation on social media — much of it unflattering — didn’t help, either.

“Obviously, people didn’t know what was going on, so reading some pretty nasty things about what it might be isn’t very nice,” Harvey said. “But we’ve figured it out.”