Your period of maternity leave may start up to 6 weeks before the expected date of birth of your child (or earlier if your employer agrees) but it must not start later than the date of birth of your child.
If you want to work in the 6 weeks before your due date your employer can ask for a medical certificate within 7 days that states that you can continue to work and it’s safe for to do your normal job.
If you receive a certificate that says you are fit for work but it is not safe for you to continue in your normal job then you will be entitled to a safe job or no safe job leave. If a medical certificate says you cannot continue work at all then the employer can direct you to start unpaid parental leave. This leave will then deduct as normal from your overall entitlement.