Modify the order of high-risk queries so flagged is found before finding registrations to improve performance. Issue: medic/medic-webapp#652