'Custom lookup method for Patient names
@param key: Key for patient table
@param values: Patient IDs'

def lookup_rows(self, key, values, fields=[]):

    table = self.table
    ptable = current.s3db.pr_person
    count = len(values)
    if (count == 1):
        query = (key == values[0])
    else:
        query = key.belongs(values)
    left = ptable.on((table.person_id == ptable.id))
    db = current.db
    rows = db(query).select(patient_patient.id, pr_person.first_name, pr_person.middle_name, pr_person.last_name, limitby=(0, count), left=left)
    self.queries += 1
    return rows
