Dr McElnay returned home early to help the district health board with the Havelock North Campylobacter outbreak earlier this year.
During her time with the DHB she also fronted the first case of SARs in New Zealand and the listeria outbreak in Hawke's Bay.
She has been a board member of Sport Hawke's Bay, is a current board member of the national Plunket Society and is also the president of the NZ College of Public Health.
Hawke's Bay DHB chief executive Kevin Snee said Dr McElnay had made an "enormous contribution" to public health in Hawke's Bay, and was highly respected both locally and nationally.
"As a district health board we have relied on Caroline's expertise and calm during periods of public health crisis," he said.
Dr Snee said Dr McElnay had been the health equity champion for the DHB for the past three years.
She was the author of the Health Inequity report released in 2014, and published an update to that report this year.
"This work has not only galvanised our own health teams to ensure equity in the work we do, but has also highlighted the role of other social sector agencies and the role they play in helping to ensure equity in Hawke's Bay," he said.
Dr Snee had trained with Dr McElnay in the United Kingdom, and "highly valued" her work and the contribution she made as part of the executive management team.
"I'm sure everyone will wish her well in her new role."
The leadership roles in public health were part of Dr Snee's corporate restructure that was currently out for consultation.
"I will be reviewing those as part of the final decision now with the knowledge of Caroline's resignation, and the expertise we will need to replace her," Dr Snee said.