Moved the meat of the get_patient_id code into a generalized function, and added get_doctor_id
and get_test_id functions.