Showing a model is logistic If we suppose that the true relationship between the probability of disease ($D=1$) and the level of risk factor $X$ is given by the logistic model
$$P(D=1|X=x) = \frac{e^{\alpha + \beta x}}{1 + e^{\alpha + \beta x}}.$$
If we introduce a new random variable $Z$, where $Z$ is $0$ or $1$. Further, if $P(Z=1|D=0,x)=\pi_0$, and $P(Z=1|D=1,x)=\pi_1$, and $\pi_0$ and $\pi_1$ are independent of $x$. How can I show that the model for $P(D=1|Z=1,x)$ is still logistic?
I've tried using the fact that
$$P(Z=1|D=1,x) = \frac{P(Z=1,D=1|X=x)}{P(D=1|X=x)}=\pi_1$$
which implies that
$$P(Z=1,D=1|X=x) = \pi_1\frac{e^{\alpha + \beta x}}{1 + e^{\alpha + \beta x}}$$
but this seems to lead me nowhere. I'm not sure if I am missing something or have made a mistake somewhere, but any pointers on how to get started would be greatly appreciated. Thanks.

\begin{aligned}
P(Z=1|X=x) &= P(Z=1|D=1,X=x)P(D=1|X=x)\\ 
&\quad+ P(Z=1|D=0,X=x)P(D=0|X=x)\\
&= \pi_1\dfrac{e^{\alpha + \beta x}}{1+e^{\alpha + \beta x}}+\pi_0 \dfrac{1}{1+e^{\alpha + \beta x}}
\end{aligned}
Combine this with your final result to see that
\begin{aligned}
P(D=1|Z=1,X=x) &= P(Z=1,D=1|X=x) / P(Z=1|X=x)\\
&= \pi_1\dfrac{e^{\alpha + \beta x}}{1+e^{\alpha + \beta x}} / \left(\pi_1\dfrac{e^{\alpha + \beta x}}{1+e^{\alpha + \beta x}}+\pi_0 \dfrac{1}{1+e^{\alpha + \beta x}}\right)\\
&=\dfrac{\pi_1e^{\alpha + \beta x}}{ \pi_0 + \pi_1e^{\alpha + \beta x}}\\
&= \dfrac{e^{\mu + \beta x}}{ 1 + e^{\mu + \beta x}} 
\end{aligned}
where $\mu = \log(\pi_1/\pi_0) + \alpha$
