Detecting and dating early non-live pregnancy outcomes: generation of a novel pregnancy algorithm from Norwegian linked health registries