Indices of diagnostic tests, such as sensitivity and specificity, should be determined using diagnostic test results of patients tested in clinical practice. Hospital information systems that store data on diagnostic tests and diagnoses might be used for sampling the desired study population and in the actual process of collecting the data. This paper presents, as an example, a study calculating the sensitivity and specificity of the prostate-specific acid phosphatase test. All data needed in the study were obtained from the hospital information system of Leiden University Hospital. The final health status of each patient was assessed by the cancer registry of the system. The reason for ordering the test was deduced from data on histopathological examinations of prostatic tissue. The actual selections made from the central database are described in dataflow diagrams. The sensitivity of the test was found to be 0.34 and the specificity 0.88, using a discrimination value of 1.00 U/l. The impact of the reason for ordering the test on the specificity is illustrated. Possible biases of these measured values are discussed.