I would talk to your doctor about your work load and see when they suggest you take maternity leave, and maybe not call it your maternity leave if you have to leave before baby is here, but call it a medical leave and then start maternity leave when baby comes so that you don't have to go back to work right after baby comes lol
I told my manager when I was 6 months