Throwing up blood or haematemesis is seen bleeding from gastrointestinal tract which needs further investigation like endoscopy
Sometimes coughing out blood, and bleeding from nose which can he swallowed and which later gets throwed up. For this reason rule out that it is not from nose. Bleeding from nose in common in children and gastrointestinal bleeding
in rare in children.
Examination by an ENT specialist
would be the correct step ahead.