All working, except can't get patient id to return correct result only returns first patient.