+
+
Select Doctor
+
+ Choose a doctor to view the patients currently assigned to them.
+
+
+ {loadingDoctors ? (
+
Loading doctors...
+ ) : (
+
+ )}
+
+ {selectedDoctor ? (
+
+ Selected Doctor:
+ {getDoctorName(selectedDoctor)}
+
+ ) : null}
+
+
+
+
Assign / Change Doctor
+
+ Enter the patient ID and select the doctor to assign or change the
+ doctor assignment.
+
+
+
+
+
+
+
+
+
+
Assigned Patients
+
+ Patients assigned to the selected doctor will appear here.
+
+
+
+ {selectedDoctorId ? (
+
+ ) : null}
+
+
+ {!selectedDoctorId ? (
+
Please select a doctor first.
+ ) : loadingPatients ? (
+
Loading assigned patients...
+ ) : patients.length === 0 ? (
+
+ No patients are currently assigned to this doctor.
+
+ ) : (
+
+
+
+
+ | Patient Name |
+ Patient ID |
+ Age |
+ Gender |
+ Action |
+
+
+
+
+ {patients.map((patient) => {
+ const id = getId(patient);
+
+ return (
+
+ | {getPatientName(patient)} |
+ {id || "N/A"} |
+ {patient?.age || patient?.dob || "N/A"} |
+ {patient?.gender || "N/A"} |
+
+
+ |
+
+ );
+ })}
+
+
+
+ )}
+
+