Is there any obstruction other than Riemann-Hurwitz to the existence of covers of Riemann surfaces?

Suppose $X$ is a genus $g$ Riemann surface, and $h,d,e_i$ are positive integers such that $2-2g = d(2-2h) + \sum (e_i-1)$. Is there necessarily a Riemann surface $Y$ with a map $f: Y \rightarrow X$ such that $f$ has degree $d$, $Y$ has genus $h$, and the ramification numbers are precisely the $e_i$? (Refinement: can we choose whatever branch points we want on $X$?)


There is also a problem for $d=1$: if $g=1, h=0, d=1$ and $\sum=2$, there is an equality (I suppose your sign before sum is incorrect), but no such a covering exists because it has degree 1 and so should be diffeomorphism between torus and sphere.