Boris Johnson has said he will look into the temporary closure of a birth centre in Yorkshire - but went on to attack Labour's stance on the NHS.