I'll take a stab. I won't include any code examples, just the path I would take.
I image when you say "users" you mean different roles for users. "doctor user" is just a user with the role of "doctor" (see here: http://codex.wordpress.org/Roles_and_Capabilities).
So, I would start by creating 2 new roles: "doctor" and "patient".
The simplest way to create a relation between 2 users (a doctor and a patient) would be to use
usermeta. I would store the patient's doctor
user_id in the patient's
usermeta. You will have to do some custom registration form to show a list of doctors (
get_users( 'role=doctor' )) then save the usermeta for the new user on
I don't know what your reports are, but if a doctor just needs to be able to get a list of their patients, you would need to do a
$wpdb->get_col() on the
usermeta table (as you stored it in the patient's usermeta, you can't use the get_usermeta API.
Presumable you will use a custom post type for reports, and you want the patient to only be able to see their own report. To do this I would probably save some
postmeta on the patient report of
_patient_user_id. Then when you want to show the reports for a user you can do something like
new WP_Query( 'post_type=report&meta_key=_patient_user_id&meta_value=' . get_current_user_id() )
(or something similar).
Personally, I probably wouldn't use any plugins here - you could use a role manager plugin for the roles, but creating them programmatically is pretty quick. Again, you can get plugins to create your custom post types - IMO it's a lot easy and better to do it all with code.