Adapted query to account for the deletion of the "detection_surgery" table