Let $D$ be an integer different from $0$ and $-1$ , such that $|D|$ is not a perfect square exceeding $1$.
A necessary condition for a prime number $p$ being expressible as $$p = x^2 + Dy^2$$ is $$\left(\frac{-D}{p}\right) = 1$$
For which integers $D$ is this condition also sufficient ?
For $|D| \le 2$ , infinite descent can be applied and possibly for $|D| = 3$ (who can clarify that ?)
Do the idoneal numbers play a role here ? Or do we need another approach , like the quadratic number fields ?
Additional question : For which numbers $D$ don't we have any possibility to classify the prime numbers of the form $x^2 + Dy^2$ ?
one thing you have not done is distinguish between discriminant $p$ (or $-p$) when $p$ is prime, compared with $-4p$ or $4p.$
The primes represented by $x^2 + xy + 3 y^2$ are entirely predictable. Discriminant is $-11,$ all you need to know.
However, the primes represented by $x^2 + 11 y^2$ are those $p$ for which $-11$ is a residue AND $$ x^3 + x^2 - x + 1 $$ factors $\pmod p$ as three distinct linear factors. The other primes are represented by $3 x^2 + 2 xy + 4 y^2.$
Discriminant $37:$ The primes represented by $x^2 + xy - 9 y^2$ are entirely predictable. Discriminant is $37,$ all you need to know.
However, the primes represented by $x^2 - 37 y^2$ are those $p$ for which $37$ is a residue AND a certain monic cubic $$ x^3 + x^2 - 3x - 1 $$ factors $\pmod p$ as three distinct linear factors. The other primes are represented by $3 x^2 + 2 xy -12 y^2.$
Here are the first few primes $x^2 - 37 y^2$
$$ 3 x^2 + 2 xy - 12 y^2 $$