Is there a version of accuracy weighted by prevalence? I have been learning the basic terminology for how to think about binary tests involving medical tests. The basic terms are here in this table

This is the confusion matrix.
My issue is the following. Note, I assume $T = N + P$ is the size of the total population. Then "accuracy" of the test is defined as
$$ACC = \frac{TP+TN}{T}$$
where you have essentially the cases you diagnosed correctly divided by the total cases you ran the test on.
But for many diseases, the disease will not be prevalent, as defined by
$$PREV = \frac{P}{T}$$
This means that $ACC$ can be very biased. Suppose our model is "assume no one has a disease" and suppose 98% of the population doesn't have it, then our accuracy would be fabulous because we would be right 98% of the time, but have a 0 True Positive Rate.
Is there a measure for test accuracy that essentially weights the $TP$ and $TN$ by prevalence such that
$$ACC_{2} = \frac{TP\cdot w_{TP} + TN \cdot w_{TN}}{T}$$
where $w_{TP}$ and $w_{TN}$ are somehow determined by the prevalence of the disease?
I want something that in other words gives me an estimate of the overall accuracy that uses the prevalence to weight the accuracy to avoid having low prevalence of a disease lead to a biased overall estimate of accuracy.

There is balanced accuracy which is a mean of sensitivity and specificity. So if you have the same number of people in positive and negative class, then it is the same as accuracy, otherwise it is essentially weighted based on the size of each group. The chance level is always 0.5 and the perfect score is always 1.
