A busy road out of Edinburgh was closed in both directions at rush hour after a crash which saw an 18-year-old man taken to hospital.