An approach to finding an optimal solution for an important diagnostic problem is described. Examples are taken from laboratory medicine, where the problem can be stated as finding the best combination of tests for making a diagnosis. These tests are typically numerical with unknown decision thresholds. Because of uncertainty in classification, the solution is described in terms of maximizing measures of decision rule performance on a data base of cases, for example maximizing positive predictive value, subject to a constraint of a minimum sensitivity. The resultant rules are quite similar to classification production rules, and the procedures described should be valid for many knowledge acquisition and refinement tasks. The solution is found by a heuristic search procedure, and empirical results for several data bases and published studies are described.