improve query patient records