viable pregnancy?

Had anyone had an early ultrasound around 4 weeks to check if the pregnancy is viable or not? How can they tell based on the ultrasound results???