Patient Search: List the patient who sees the doctor

My question was exactly relate to this

@angshuonline Provided the answer am ask if there is any one write the query.