Obstetric ultrasound is a diagnostic imaging procedure used to confirm pregnancy viability and detect both intrauterine and ectopic pregnancies. During the procedure, a transducer is either moved over the abdomen or inserted vaginally, emitting sound waves that produce real-time images of the uterus and surrounding structures.