You can do this using a microflow, or directly in the web client. To do it in the web client with no microflow, add an attribute (called Counter) of type integer to your patient entity and set the default value to 1. You can then show a datagrid of patients on your Doctor record using the association, and use the aggregate function on the column properties of the Counter column to sum the rows and give a total count.
To do this in a microflow, perform a retrieve action using the association (retrieve patients with [module.Patient_Doctor = $Doctor]). Having got a list returned (PatientList) you can perform a List Aggregate Function to perform a count of the rows and return an integer variable.
Edit after additional information: The association you want for the retrieve action is Patient-Doctor not Doctor-Patient. When you add a Retrieve action to your microflow, by default it will be set to Retrieve by association. This will not work for you in this situation. You need to change the radio button to retrieve From Database and select the Patient entity to retrieve from. You can then build a query in square brackets like [Module.Patient_Doctor = $Doctor]. That should get you past your first hurdle.
Just retrieve all patients which are associated to your specific doctor. Count the list and return this variable in your microflow. Use this microflow in a virtual attribute in your doctor entity.
Could you tell us what your exact problem is? You said: I've tried several commands but none seem to work.
What doesn't work? The retrieve?