Let $D$ and $\
eg D$ represent the events that the patient has and does not have the disease respectively, and let $T$ and $\
eg T$ represent the event that the test is positive or negative respectively.
What do we want to compute?
> $P(D \mid T)$
Unfortunately, all of our probabilities are in the form "test is (pos/neg) given patient (has/doesn't have) disease," which is "backwards" of what we want to compute. Bayes's Rule to the rescue!
> \begin{align*}P(D \mid T) &= \frac{P(D \cap T)}{P(T)}\\\ &= \frac{P(T \mid D) P(D)}{P(T)} \\\&= \frac{P(T \mid D) P(D)}{P(T \mid D)P(D) + P(T \mid \
eg D)P(\
eg D)} \end{align*}