A serious shortage of midwives at Capital and Coast DHB has seen the maternity service go into "code black" three times recently - meaning it reached capacity.