Index: backend/src/main/java/medora/controller/AppointmentController.java
===================================================================
--- backend/src/main/java/medora/controller/AppointmentController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/AppointmentController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,239 @@
+package medora.controller;
+
+import medora.dto.AppointmentDTO;
+import medora.dto.CreateAppointmentRequest;
+import medora.dto.DoctorDTO;
+import medora.dto.PatientDTO;
+import medora.models.domain.Appointment;
+import medora.service.AppointmentService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/appointments")
+public class AppointmentController {
+
+    private static final Logger logger = LoggerFactory.getLogger(AppointmentController.class);
+
+    private final AppointmentService appointmentService;
+
+    public AppointmentController(AppointmentService appointmentService) {
+        this.appointmentService = appointmentService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> createAppointment(@RequestBody CreateAppointmentRequest request) {
+        try {
+            if (request.getPatientId() == null || request.getPatientId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid patient ID is required"));
+            }
+            if (request.getDoctorId() == null || request.getDoctorId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid doctor ID is required"));
+            }
+            if (request.getAppointmentDate() == null) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Appointment date is required"));
+            }
+            if (request.getAppointmentTime() == null) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Appointment time is required"));
+            }
+
+            Appointment appointment = appointmentService.createAppointment(
+                    request.getPatientId(),
+                    request.getDoctorId(),
+                    request.getAppointmentDate(),
+                    request.getAppointmentTime()
+            );
+            AppointmentDTO dto = convertToDTO(appointment);
+
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating appointment: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating appointment: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create appointment: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{appointmentId}")
+    public ResponseEntity<?> getAppointmentById(@PathVariable Long appointmentId) {
+        try {
+            logger.info("Fetching appointment with ID: {}", appointmentId);
+            return appointmentService.getAppointmentById(appointmentId)
+                    .map(a -> ResponseEntity.ok(convertToDTO(a)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching appointment: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching appointment: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch appointment: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping
+    public ResponseEntity<?> getAllAppointments() {
+        try {
+            logger.info("Fetching all appointments");
+            List<Appointment> appointments = appointmentService.getAllAppointments();
+            List<AppointmentDTO> dtos = appointments.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching appointments: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching appointments: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch appointments: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/patient/{patientId}")
+    public ResponseEntity<?> getAppointmentsForPatient(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching appointments for patient ID: {}", patientId);
+            List<Appointment> appointments = appointmentService.getAppointmentsForPatient(patientId);
+            List<AppointmentDTO> dtos = appointments.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching patient appointments: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching patient appointments: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch appointments: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/doctor/{doctorId}")
+    public ResponseEntity<?> getAppointmentsForDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching appointments for doctor ID: {}", doctorId);
+            List<Appointment> appointments = appointmentService.getAppointmentsForDoctor(doctorId);
+            List<AppointmentDTO> dtos = appointments.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctor appointments: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctor appointments: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch appointments: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/doctor/{doctorId}/schedule")
+    public ResponseEntity<?> getDoctorSchedule(
+            @PathVariable Long doctorId,
+            @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date) {
+        try {
+            logger.info("Fetching doctor schedule for doctor ID: {} on {}", doctorId, date);
+            List<Appointment> appointments = appointmentService.getDoctorSchedule(doctorId, date);
+            List<AppointmentDTO> dtos = appointments.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctor schedule: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctor schedule: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch schedule: " + e.getMessage()));
+        }
+    }
+
+    @PatchMapping("/{appointmentId}/cancel")
+    public ResponseEntity<?> cancelAppointment(@PathVariable Long appointmentId) {
+        try {
+            logger.info("Cancelling appointment with ID: {}", appointmentId);
+            Appointment appointment = appointmentService.cancelAppointment(appointmentId);
+            AppointmentDTO dto = convertToDTO(appointment);
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error cancelling appointment: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error cancelling appointment: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to cancel appointment: " + e.getMessage()));
+        }
+    }
+
+    @PatchMapping("/{appointmentId}/complete")
+    public ResponseEntity<?> completeAppointment(@PathVariable Long appointmentId) {
+        try {
+            logger.info("Completing appointment with ID: {}", appointmentId);
+            Appointment appointment = appointmentService.completeAppointment(appointmentId);
+            AppointmentDTO dto = convertToDTO(appointment);
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error completing appointment: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error completing appointment: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to complete appointment: " + e.getMessage()));
+        }
+    }
+
+    private AppointmentDTO convertToDTO(Appointment appointment) {
+        PatientDTO patientDTO = null;
+        DoctorDTO doctorDTO = null;
+
+        if (appointment.getPatient() != null) {
+            patientDTO = new PatientDTO();
+            patientDTO.setPatientId(appointment.getPatient().getPatientId());
+            patientDTO.setFirstName(appointment.getPatient().getFirstName());
+            patientDTO.setLastName(appointment.getPatient().getLastName());
+            patientDTO.setEmailAddress(appointment.getPatient().getEmailAddress());
+            patientDTO.setEmbg(appointment.getPatient().getEmbg());
+        }
+
+        if (appointment.getDoctor() != null) {
+            doctorDTO = new DoctorDTO();
+            doctorDTO.setDoctorId(appointment.getDoctor().getDoctorId());
+            doctorDTO.setFirstName(appointment.getDoctor().getFirstName());
+            doctorDTO.setLastName(appointment.getDoctor().getLastName());
+            doctorDTO.setEmailAddress(appointment.getDoctor().getEmailAddress());
+        }
+
+        return new AppointmentDTO(
+                appointment.getAppointmentId(),
+                appointment.getAppointmentDate(),
+                appointment.getAppointmentTime(),
+                appointment.getStatus(),
+                patientDTO,
+                doctorDTO
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/BillingController.java
===================================================================
--- backend/src/main/java/medora/controller/BillingController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/BillingController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,164 @@
+package medora.controller;
+
+import medora.dto.BillingDTO;
+import medora.dto.CreateBillingRequest;
+import medora.dto.UpdateBillingRequest;
+import medora.models.domain.Billing;
+import medora.service.BillingService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/billing")
+public class BillingController {
+
+    private static final Logger logger = LoggerFactory.getLogger(BillingController.class);
+
+    private final BillingService billingService;
+
+    public BillingController(BillingService billingService) {
+        this.billingService = billingService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> generateBillingRecord(@RequestBody CreateBillingRequest request) {
+        try {
+            if (request.getMedicalRecordId() == null || request.getMedicalRecordId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid medical record ID is required"));
+            }
+            if (request.getAdminId() == null || request.getAdminId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid admin ID is required"));
+            }
+            if (request.getTotalCost() == null || request.getTotalCost().signum() < 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid total cost is required"));
+            }
+
+            Billing billing = billingService.generateBillingRecord(
+                    request.getMedicalRecordId(),
+                    request.getAdminId(),
+                    request.getTotalCost()
+            );
+            BillingDTO dto = convertToDTO(billing);
+
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating billing record: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating billing record: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create billing record: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{billId}")
+    public ResponseEntity<?> getBillingById(@PathVariable Long billId) {
+        try {
+            logger.info("Fetching billing record with ID: {}", billId);
+            return billingService.getBillingById(billId)
+                    .map(b -> ResponseEntity.ok(convertToDTO(b)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching billing record: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching billing record: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch billing record: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping
+    public ResponseEntity<?> getAllBillings() {
+        try {
+            logger.info("Fetching all billing records");
+            List<Billing> billings = billingService.getAllBillingRecords();
+            List<BillingDTO> dtos = billings.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching billing records: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching billing records: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch billing records: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/patient/{patientId}")
+    public ResponseEntity<?> getBillingHistoryForPatient(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching billing history for patient ID: {}", patientId);
+            List<Billing> billings = billingService.getBillingHistoryForPatient(patientId);
+            List<BillingDTO> dtos = billings.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching billing history: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching billing history: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch billing history: " + e.getMessage()));
+        }
+    }
+
+    @PatchMapping("/{billId}/payment-status")
+    public ResponseEntity<?> updatePaymentStatus(@PathVariable Long billId,
+                                                @RequestBody UpdateBillingRequest request) {
+        try {
+            if (request.getPaymentStatus() == null) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Payment status is required"));
+            }
+
+            LocalDate paymentDate = request.getPaymentDate();
+            Billing billing = billingService.updatePaymentStatus(billId, request.getPaymentStatus(), paymentDate);
+            BillingDTO dto = convertToDTO(billing);
+
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error updating payment status: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error updating payment status: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to update payment status: " + e.getMessage()));
+        }
+    }
+
+    private BillingDTO convertToDTO(Billing billing) {
+        String patientName = "";
+        if (billing.getMedicalRecord() != null && billing.getMedicalRecord().getPatient() != null) {
+            patientName = billing.getMedicalRecord().getPatient().getFirstName() + " " +
+                         billing.getMedicalRecord().getPatient().getLastName();
+        }
+        return new BillingDTO(
+                billing.getBillId(),
+                billing.getMedicalRecord() != null ? billing.getMedicalRecord().getRecordId() : null,
+                patientName,
+                billing.getTotalCost(),
+                billing.getPaymentStatus(),
+                billing.getPaymentDate()
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/DiagnosisController.java
===================================================================
--- backend/src/main/java/medora/controller/DiagnosisController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/DiagnosisController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,148 @@
+package medora.controller;
+
+import medora.dto.CreateDiagnosisRequest;
+import medora.dto.DiagnosisDTO;
+import medora.models.domain.Diagnosis;
+import medora.service.DiagnosisService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/diagnoses")
+public class DiagnosisController {
+
+    private static final Logger logger = LoggerFactory.getLogger(DiagnosisController.class);
+
+    private final DiagnosisService diagnosisService;
+
+    public DiagnosisController(DiagnosisService diagnosisService) {
+        this.diagnosisService = diagnosisService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> recordDiagnosis(@RequestBody CreateDiagnosisRequest request) {
+        try {
+            if (request.getPatientId() == null || request.getPatientId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid patient ID is required"));
+            }
+            if (request.getDoctorId() == null || request.getDoctorId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid doctor ID is required"));
+            }
+            if (request.getName() == null || request.getName().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Diagnosis name is required"));
+            }
+
+            Diagnosis diagnosis = diagnosisService.recordDiagnosis(
+                    request.getPatientId(),
+                    request.getDoctorId(),
+                    request.getName(),
+                    request.getDescription()
+            );
+            DiagnosisDTO dto = convertToDTO(diagnosis);
+
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error recording diagnosis: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error recording diagnosis: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to record diagnosis: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{diagnosisId}")
+    public ResponseEntity<?> getDiagnosisById(@PathVariable Long diagnosisId) {
+        try {
+            logger.info("Fetching diagnosis with ID: {}", diagnosisId);
+            return diagnosisService.getDiagnosisById(diagnosisId)
+                    .map(d -> ResponseEntity.ok(convertToDTO(d)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching diagnosis: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching diagnosis: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch diagnosis: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/patient/{patientId}")
+    public ResponseEntity<?> getDiagnosesForPatient(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching diagnoses for patient ID: {}", patientId);
+            List<Diagnosis> diagnoses = diagnosisService.getDiagnosesForPatient(patientId);
+            List<DiagnosisDTO> dtos = diagnoses.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching diagnoses: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching diagnoses: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch diagnoses: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/doctor/{doctorId}")
+    public ResponseEntity<?> getDiagnosesForDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching diagnoses for doctor ID: {}", doctorId);
+            List<Diagnosis> diagnoses = diagnosisService.getDiagnosesByDoctor(doctorId);
+            List<DiagnosisDTO> dtos = diagnoses.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching diagnoses: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching diagnoses: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch diagnoses: " + e.getMessage()));
+        }
+    }
+
+    private DiagnosisDTO convertToDTO(Diagnosis diagnosis) {
+        String patientName = "";
+        Long patientId = null;
+        if (diagnosis.getPatient() != null) {
+            patientName = diagnosis.getPatient().getFirstName() + " " + diagnosis.getPatient().getLastName();
+            patientId = diagnosis.getPatient().getPatientId();
+        }
+
+        String doctorName = "";
+        Long doctorId = null;
+        if (diagnosis.getDoctor() != null) {
+            doctorName = diagnosis.getDoctor().getFirstName() + " " + diagnosis.getDoctor().getLastName();
+            doctorId = diagnosis.getDoctor().getDoctorId();
+        }
+
+        return new DiagnosisDTO(
+                diagnosis.getDiagnosisId(),
+                patientId,
+                patientName,
+                doctorId,
+                doctorName,
+                diagnosis.getName(),
+                diagnosis.getDescription()
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/DoctorController.java
===================================================================
--- backend/src/main/java/medora/controller/DoctorController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/DoctorController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,268 @@
+package medora.controller;
+
+import medora.dto.*;
+import medora.models.domain.Departments;
+import medora.models.domain.DoctorLevel;
+import medora.models.domain.DoctorSpecialization;
+import medora.models.domain.Doctors;
+import medora.service.DoctorService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/doctors")
+public class DoctorController {
+
+    private static final Logger logger = LoggerFactory.getLogger(DoctorController.class);
+
+    private final DoctorService doctorService;
+
+    public DoctorController(DoctorService doctorService) {
+        this.doctorService = doctorService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> createDoctor(@RequestBody CreateDoctorRequest request) {
+        try {
+            if (request.getFirstName() == null || request.getFirstName().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "First name is required"));
+            }
+            if (request.getLastName() == null || request.getLastName().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Last name is required"));
+            }
+            if (request.getEmailAddress() == null || request.getEmailAddress().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Email is required"));
+            }
+
+            Doctors doctor = new Doctors();
+            doctor.setFirstName(request.getFirstName());
+            doctor.setLastName(request.getLastName());
+            doctor.setEmailAddress(request.getEmailAddress());
+
+            DoctorLevel level = new DoctorLevel();
+            level.setLevelId(request.getLevelId());
+            doctor.setLevel(level);
+
+            DoctorSpecialization specialization = new DoctorSpecialization();
+            specialization.setSpecializationId(request.getSpecializationId());
+            doctor.setSpecialization(specialization);
+
+            Departments department = new Departments();
+            department.setDepartmentId(request.getDepartmentId());
+            doctor.setDepartment(department);
+
+            Doctors createdDoctor = doctorService.createDoctor(doctor);
+            DoctorDTO dto = convertToDTO(createdDoctor);
+
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating doctor: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating doctor: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create doctor: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{doctorId}")
+    public ResponseEntity<?> getDoctorById(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching doctor with ID: {}", doctorId);
+            Doctors doctor = doctorService.getDoctorById(doctorId);
+            DoctorDTO dto = convertToDTO(doctor);
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctor: {}", e.getMessage());
+            return ResponseEntity.notFound().build();
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctor: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch doctor: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/email/{emailAddress}")
+    public ResponseEntity<?> getDoctorByEmail(@PathVariable String emailAddress) {
+        try {
+            logger.info("Fetching doctor with email: {}", emailAddress);
+            Doctors doctor = doctorService.getDoctorByEmail(emailAddress);
+            DoctorDTO dto = convertToDTO(doctor);
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctor: {}", e.getMessage());
+            return ResponseEntity.notFound().build();
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctor: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch doctor: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/department/{departmentId}")
+    public ResponseEntity<?> getDoctorsByDepartment(@PathVariable Long departmentId) {
+        try {
+            logger.info("Fetching doctors for department ID: {}", departmentId);
+            List<Doctors> doctors = doctorService.getDoctorsByDepartment(departmentId);
+            List<DoctorDTO> dtos = doctors.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch doctors: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/specialization/{specializationId}")
+    public ResponseEntity<?> getDoctorsBySpecialization(@PathVariable Long specializationId) {
+        try {
+            logger.info("Fetching doctors with specialization ID: {}", specializationId);
+            List<Doctors> doctors = doctorService.getDoctorsBySpecialization(specializationId);
+            List<DoctorDTO> dtos = doctors.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch doctors: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/level/{levelId}")
+    public ResponseEntity<?> getDoctorsByLevel(@PathVariable Long levelId) {
+        try {
+            logger.info("Fetching doctors with level ID: {}", levelId);
+            List<Doctors> doctors = doctorService.getDoctorsByLevel(levelId);
+            List<DoctorDTO> dtos = doctors.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch doctors: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping
+    public ResponseEntity<?> getAllDoctors() {
+        try {
+            logger.info("Fetching all doctors");
+            List<Doctors> doctors = doctorService.getAllDoctors();
+            List<DoctorDTO> dtos = doctors.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctors: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch doctors: " + e.getMessage()));
+        }
+    }
+
+    @PutMapping("/{doctorId}")
+    public ResponseEntity<?> updateDoctor(@PathVariable Long doctorId,
+                                         @RequestBody CreateDoctorRequest request) {
+        try {
+            logger.info("Updating doctor with ID: {}", doctorId);
+
+            Doctors doctorDetails = new Doctors();
+            doctorDetails.setFirstName(request.getFirstName());
+            doctorDetails.setLastName(request.getLastName());
+
+            if (request.getLevelId() != null) {
+                DoctorLevel level = new DoctorLevel();
+                level.setLevelId(request.getLevelId());
+                doctorDetails.setLevel(level);
+            }
+
+            if (request.getSpecializationId() != null) {
+                DoctorSpecialization specialization = new DoctorSpecialization();
+                specialization.setSpecializationId(request.getSpecializationId());
+                doctorDetails.setSpecialization(specialization);
+            }
+
+            if (request.getDepartmentId() != null) {
+                Departments department = new Departments();
+                department.setDepartmentId(request.getDepartmentId());
+                doctorDetails.setDepartment(department);
+            }
+
+            Doctors updatedDoctor = doctorService.updateDoctor(doctorId, doctorDetails);
+            DoctorDTO dto = convertToDTO(updatedDoctor);
+
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error updating doctor: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error updating doctor: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to update doctor: " + e.getMessage()));
+        }
+    }
+
+    private DoctorDTO convertToDTO(Doctors doctor) {
+        DoctorLevelDTO levelDTO = null;
+        if (doctor.getLevel() != null) {
+            levelDTO = new DoctorLevelDTO(doctor.getLevel().getLevelId(), doctor.getLevel().getLevel());
+        }
+
+        DoctorSpecializationDTO specializationDTO = null;
+        if (doctor.getSpecialization() != null) {
+            specializationDTO = new DoctorSpecializationDTO(
+                    doctor.getSpecialization().getSpecializationId(),
+                    doctor.getSpecialization().getSpecializationName()
+            );
+        }
+
+        DepartmentDTO departmentDTO = null;
+        if (doctor.getDepartment() != null) {
+            departmentDTO = new DepartmentDTO(
+                    doctor.getDepartment().getDepartmentId(),
+                    doctor.getDepartment().getDepartmentName()
+            );
+        }
+
+        return new DoctorDTO(
+                doctor.getDoctorId(),
+                doctor.getFirstName(),
+                doctor.getLastName(),
+                doctor.getEmailAddress(),
+                levelDTO,
+                specializationDTO,
+                departmentDTO
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/LabController.java
===================================================================
--- backend/src/main/java/medora/controller/LabController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/LabController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,276 @@
+package medora.controller;
+
+import medora.dto.*;
+import medora.models.domain.LabResults;
+import medora.models.domain.LabTests;
+import medora.models.domain.MedicalRecordLabResults;
+import medora.models.domain.PerformedLabTests;
+import medora.service.LabService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/lab-tests")
+public class LabController {
+
+    private static final Logger logger = LoggerFactory.getLogger(LabController.class);
+
+    private final LabService labService;
+
+    public LabController(LabService labService) {
+        this.labService = labService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> createLabTest(@RequestBody CreateLabTestRequest request) {
+        try {
+            if (request.getTestName() == null || request.getTestName().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Test name is required"));
+            }
+            if (request.getCost() == null || request.getCost().signum() < 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid cost is required"));
+            }
+
+            LabTests labTest = labService.requestLabTest(
+                    request.getTestName(),
+                    request.getDescription(),
+                    request.getCost()
+            );
+            LabTestDTO dto = convertToDTO(labTest);
+
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating lab test: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating lab test: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create lab test: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{testId}")
+    public ResponseEntity<?> getLabTestById(@PathVariable Long testId) {
+        try {
+            logger.info("Fetching lab test with ID: {}", testId);
+            return labService.getLabTestById(testId)
+                    .map(t -> ResponseEntity.ok(convertToDTO(t)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching lab test: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching lab test: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch lab test: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping
+    public ResponseEntity<?> getAllLabTests() {
+        try {
+            logger.info("Fetching all lab tests");
+            List<LabTests> tests = labService.getAllLabTests();
+            List<LabTestDTO> dtos = tests.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching lab tests: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching lab tests: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch lab tests: " + e.getMessage()));
+        }
+    }
+
+    @PutMapping("/{testId}")
+    public ResponseEntity<?> updateLabTest(@PathVariable Long testId,
+                                          @RequestBody CreateLabTestRequest request) {
+        try {
+            logger.info("Updating lab test with ID: {}", testId);
+            LabTests updatedTest = labService.updateLabTest(
+                    testId,
+                    request.getTestName(),
+                    request.getDescription(),
+                    request.getCost()
+            );
+            LabTestDTO dto = convertToDTO(updatedTest);
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error updating lab test: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error updating lab test: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to update lab test: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/request")
+    public ResponseEntity<?> requestLabTest(@RequestBody RequestLabTestRequest request) {
+        try {
+            logger.info("Requesting lab test {} for patient {}", request.getTestId(), request.getPatientId());
+
+            PerformedLabTests performedTest = labService.requestLabTestForPatient(
+                    request.getPatientId(),
+                    request.getDoctorId(),
+                    request.getTestId(),
+                    request.getTestDate(),
+                    request.getNotes()
+            );
+
+            return ResponseEntity.status(HttpStatus.CREATED)
+                    .body(convertPerformedTestToDTO(performedTest));
+        } catch (IllegalArgumentException e) {
+            logger.error("Validation error requesting lab test: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (RuntimeException e) {
+            logger.error("Error requesting lab test: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error requesting lab test: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to request lab test: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/requests/patient/{patientId}")
+    public ResponseEntity<?> getLabTestRequestsForPatient(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching lab test requests for patient {}", patientId);
+            List<PerformedLabTests> requests = labService.getLabTestRequestsForPatient(patientId);
+            List<LabTestRequestDTO> dtos = requests.stream()
+                    .map(this::convertPerformedTestToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching lab test requests: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching lab test requests: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch lab test requests: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/requests/doctor/{doctorId}")
+    public ResponseEntity<?> getLabTestRequestsByDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching lab test requests by doctor {}", doctorId);
+            List<PerformedLabTests> requests = labService.getLabTestRequestsByDoctor(doctorId);
+            List<LabTestRequestDTO> dtos = requests.stream()
+                    .map(this::convertPerformedTestToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctor lab test requests: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctor lab test requests: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch lab test requests: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/results")
+    public ResponseEntity<?> submitLabResult(@RequestBody SubmitLabResultRequest request) {
+        try {
+            logger.info("Submitting lab result for medical record {}", request.getMedicalRecordId());
+
+            MedicalRecordLabResults result = labService.storeLabResult(
+                    request.getMedicalRecordId(),
+                    request.getTestId(),
+                    request.getResults(),
+                    request.getResultDate()
+            );
+
+            return ResponseEntity.status(HttpStatus.CREATED)
+                    .body(convertResultToDTO(result));
+        } catch (IllegalArgumentException e) {
+            logger.error("Validation error submitting lab result: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (RuntimeException e) {
+            logger.error("Error submitting lab result: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error submitting lab result: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to submit lab result: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/results/medical-record/{medicalRecordId}")
+    public ResponseEntity<?> getLabResultsForMedicalRecord(@PathVariable Long medicalRecordId) {
+        try {
+            logger.info("Fetching lab results for medical record {}", medicalRecordId);
+            List<MedicalRecordLabResults> results = labService.getLabResultsForMedicalRecord(medicalRecordId);
+            List<LabResultDTO> dtos = results.stream()
+                    .map(this::convertResultToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching lab results: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching lab results: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch lab results: " + e.getMessage()));
+        }
+    }
+
+    private LabTestDTO convertToDTO(LabTests labTest) {
+        return new LabTestDTO(
+                labTest.getTestId(),
+                labTest.getTestName(),
+                labTest.getDescription(),
+                labTest.getCost()
+        );
+    }
+
+    private LabTestRequestDTO convertPerformedTestToDTO(PerformedLabTests performedTest) {
+        return new LabTestRequestDTO(
+                performedTest.getLabTest().getTestId(),
+                performedTest.getLabTest().getTestName(),
+                performedTest.getPatient().getPatientId(),
+                performedTest.getPatient().getFirstName() + " " + performedTest.getPatient().getLastName(),
+                performedTest.getDoctor().getDoctorId(),
+                performedTest.getDoctor().getFirstName() + " " + performedTest.getDoctor().getLastName(),
+                performedTest.getTestDate(),
+                performedTest.getNotes()
+        );
+    }
+
+    private LabResultDTO convertResultToDTO(MedicalRecordLabResults recordLabResult) {
+        LabResults labResult = recordLabResult.getLabResult();
+        return new LabResultDTO(
+                labResult.getResultId(),
+                labResult.getLabTest().getTestId(),
+                labResult.getLabTest().getTestName(),
+                recordLabResult.getMedicalRecord().getRecordId(),
+                labResult.getResults(),
+                labResult.getResultDate()
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/MedicalRecordController.java
===================================================================
--- backend/src/main/java/medora/controller/MedicalRecordController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/MedicalRecordController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,391 @@
+package medora.controller;
+
+import medora.dto.AllergyDTO;
+import medora.dto.ComprehensiveMedicalRecordDTO;
+import medora.dto.MedicalRecordDTO;
+import medora.dto.SymptomDTO;
+import medora.models.domain.*;
+import medora.repository.*;
+import medora.service.MedicalRecordService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/medical-records")
+public class MedicalRecordController {
+
+    private static final Logger logger = LoggerFactory.getLogger(MedicalRecordController.class);
+
+    private final MedicalRecordService medicalRecordService;
+    private final DiagnosisRepository diagnosisRepository;
+    private final MedicalReportRepository medicalReportRepository;
+    private final MedicalRecordAllergyRepository allergyRepository;
+    private final MedicalRecordSymptomRepository symptomRepository;
+    private final SymptomRepository allSymptomRepository;
+    private final AllergyRepository allAllergyRepository;
+    private final PrescriptionRepository allPrescriptionRepository;
+    private final PrescriptionMedicalRecordRepository prescriptionMedicalRecordRepository;
+
+    public MedicalRecordController(MedicalRecordService medicalRecordService,
+                                  DiagnosisRepository diagnosisRepository,
+                                  MedicalReportRepository medicalReportRepository,
+                                  MedicalRecordAllergyRepository allergyRepository,
+                                  MedicalRecordSymptomRepository symptomRepository,
+                                  SymptomRepository allSymptomRepository,
+                                  AllergyRepository allAllergyRepository,
+                                  PrescriptionRepository allPrescriptionRepository,
+                                  PrescriptionMedicalRecordRepository prescriptionMedicalRecordRepository) {
+        this.medicalRecordService = medicalRecordService;
+        this.diagnosisRepository = diagnosisRepository;
+        this.medicalReportRepository = medicalReportRepository;
+        this.allergyRepository = allergyRepository;
+        this.symptomRepository = symptomRepository;
+        this.allSymptomRepository = allSymptomRepository;
+        this.allAllergyRepository = allAllergyRepository;
+        this.allPrescriptionRepository = allPrescriptionRepository;
+        this.prescriptionMedicalRecordRepository = prescriptionMedicalRecordRepository;
+    }
+
+    @GetMapping("/{recordId}")
+    public ResponseEntity<?> getMedicalRecordById(@PathVariable Long recordId) {
+        try {
+            logger.info("Fetching medical record with ID: {}", recordId);
+            return medicalRecordService.getMedicalRecordById(recordId)
+                    .map(r -> ResponseEntity.ok(convertToDTO(r)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching medical record: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching medical record: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch medical record: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/patient/{patientId}")
+    public ResponseEntity<?> getMedicalRecordByPatientId(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching comprehensive medical record for patient ID: {}", patientId);
+            return medicalRecordService.getMedicalRecordByPatientId(patientId)
+                    .map(record -> {
+                        List<Diagnosis> diagnoses = diagnosisRepository.findByPatientPatientId(patientId);
+                        List<MedicalReport> reports = medicalReportRepository.findByMedicalRecordRecordId(record.getRecordId());
+                        return ResponseEntity.ok(convertToComprehensiveDTO(record, diagnoses, reports));
+                    })
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching medical record: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching medical record: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch medical record: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{medicalRecordId}/allergies")
+    public ResponseEntity<?> getAllergiesForMedicalRecord(@PathVariable Long medicalRecordId) {
+        try {
+            logger.info("Fetching allergies for medical record ID: {}", medicalRecordId);
+            List<MedicalRecordAllergies> allergies = allergyRepository.findByMedicalRecordRecordId(medicalRecordId);
+            List<AllergyDTO> dtos = allergies.stream()
+                    .map(a -> new AllergyDTO(
+                            a.getAllergy().getAllergyId(),
+                            a.getAllergy().getName(),
+                            a.getReaction(),
+                            a.getSeverity()
+                    ))
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching allergies: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching allergies: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch allergies: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{medicalRecordId}/symptoms")
+    public ResponseEntity<?> getSymptomsForMedicalRecord(@PathVariable Long medicalRecordId) {
+        try {
+            logger.info("Fetching symptoms for medical record ID: {}", medicalRecordId);
+            List<MedicalRecordSymptoms> symptoms = symptomRepository.findByMedicalRecordRecordId(medicalRecordId);
+            List<SymptomDTO> dtos = symptoms.stream()
+                    .map(s -> new SymptomDTO(
+                            s.getSymptom().getSymptomId(),
+                            s.getSymptom().getName(),
+                            s.getSymptom().getDescription()
+                    ))
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching symptoms: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching symptoms: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch symptoms: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/dropdown/diagnoses")
+    public ResponseEntity<?> getAllDiagnoses() {
+        try {
+            logger.info("Fetching all available diagnoses");
+            List<Diagnosis> diagnoses = diagnosisRepository.findAll();
+            return ResponseEntity.ok(diagnoses.stream()
+                    .map(d -> new java.util.LinkedHashMap<String, Object>() {{
+                        put("id", d.getDiagnosisId());
+                        put("name", d.getName());
+                    }})
+                    .collect(Collectors.toList()));
+        } catch (Exception e) {
+            logger.error("Error fetching diagnoses: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch diagnoses: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/dropdown/symptoms")
+    public ResponseEntity<?> getAllSymptoms() {
+        try {
+            logger.info("Fetching all available symptoms");
+            List<Symptoms> symptoms = allSymptomRepository.findAll();
+            return ResponseEntity.ok(symptoms.stream()
+                    .map(s -> new java.util.LinkedHashMap<String, Object>() {{
+                        put("id", s.getSymptomId());
+                        put("name", s.getName());
+                    }})
+                    .collect(Collectors.toList()));
+        } catch (Exception e) {
+            logger.error("Error fetching symptoms: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch symptoms: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/dropdown/allergies")
+    public ResponseEntity<?> getAllAllergies() {
+        try {
+            logger.info("Fetching all available allergies");
+            List<Allergies> allergies = allAllergyRepository.findAll();
+            return ResponseEntity.ok(allergies.stream()
+                    .map(a -> new java.util.LinkedHashMap<String, Object>() {{
+                        put("id", a.getAllergyId());
+                        put("name", a.getName());
+                    }})
+                    .collect(Collectors.toList()));
+        } catch (Exception e) {
+            logger.error("Error fetching allergies: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch allergies: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/dropdown/prescriptions")
+    public ResponseEntity<?> getAllPrescriptions() {
+        try {
+            logger.info("Fetching all available prescriptions");
+            List<Prescriptions> prescriptions = allPrescriptionRepository.findAll();
+            return ResponseEntity.ok(prescriptions.stream()
+                    .map(p -> new java.util.LinkedHashMap<String, Object>() {{
+                        put("id", p.getPrescriptionId());
+                        put("name", p.getMedicationName());
+                    }})
+                    .collect(Collectors.toList()));
+        } catch (Exception e) {
+            logger.error("Error fetching prescriptions: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch prescriptions: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/{medicalRecordId}/symptoms")
+    public ResponseEntity<?> recordSymptom(@PathVariable Long medicalRecordId, @RequestBody Map<String, Object> request) {
+        try {
+            if (medicalRecordId == null || medicalRecordId <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid medical record ID is required"));
+            }
+            Object symptomIdObj = request.get("symptomId");
+            if (symptomIdObj == null) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Symptom ID is required"));
+            }
+            Long symptomId = symptomIdObj instanceof Number ? ((Number) symptomIdObj).longValue() : Long.parseLong(symptomIdObj.toString());
+            String severity = (String) request.getOrDefault("severity", "MEDIUM");
+
+            logger.info("Recording symptom {} for medical record {}", symptomId, medicalRecordId);
+            medicalRecordService.recordSymptom(medicalRecordId, symptomId, severity);
+            return ResponseEntity.status(HttpStatus.CREATED)
+                    .body(Map.of("message", "Symptom recorded successfully"));
+        } catch (RuntimeException e) {
+            logger.error("Error recording symptom: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error recording symptom: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to record symptom: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/{medicalRecordId}/allergies")
+    public ResponseEntity<?> recordAllergy(@PathVariable Long medicalRecordId, @RequestBody Map<String, Object> request) {
+        try {
+            if (medicalRecordId == null || medicalRecordId <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid medical record ID is required"));
+            }
+            Object allergyIdObj = request.get("allergyId");
+            if (allergyIdObj == null) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Allergy ID is required"));
+            }
+            Long allergyId = allergyIdObj instanceof Number ? ((Number) allergyIdObj).longValue() : Long.parseLong(allergyIdObj.toString());
+            String severity = (String) request.getOrDefault("severity", "MEDIUM");
+            String reaction = (String) request.getOrDefault("reaction", "");
+
+            logger.info("Recording allergy {} for medical record {}", allergyId, medicalRecordId);
+            medicalRecordService.recordAllergy(medicalRecordId, allergyId, reaction, severity);
+            return ResponseEntity.status(HttpStatus.CREATED)
+                    .body(Map.of("message", "Allergy recorded successfully"));
+        } catch (RuntimeException e) {
+            logger.error("Error recording allergy: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error recording allergy: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to record allergy: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/search")
+    public ResponseEntity<?> searchMedicalRecords(
+            @RequestParam(required = false) String patientName,
+            @RequestParam(required = false) String embg,
+            @RequestParam(required = false) String diagnosisName,
+            @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate startDate,
+            @RequestParam(required = false) @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate endDate) {
+        try {
+            logger.info("Searching medical records with filters: patientName={}, embg={}, diagnosisName={}, startDate={}, endDate={}",
+                    patientName, embg, diagnosisName, startDate, endDate);
+            List<MedicalRecord> records = medicalRecordService.searchMedicalRecords(
+                    patientName, embg, diagnosisName, startDate, endDate);
+            List<MedicalRecordDTO> dtos = records.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error searching medical records: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error searching medical records: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to search medical records: " + e.getMessage()));
+        }
+    }
+
+    private MedicalRecordDTO convertToDTO(MedicalRecord record) {
+        String patientName = "";
+        String embg = "";
+        if (record.getPatient() != null) {
+            patientName = record.getPatient().getFirstName() + " " + record.getPatient().getLastName();
+            embg = record.getPatient().getEmbg();
+        }
+        return new MedicalRecordDTO(
+                record.getRecordId(),
+                record.getPatient() != null ? record.getPatient().getPatientId() : null,
+                patientName,
+                embg
+        );
+    }
+
+    private ComprehensiveMedicalRecordDTO convertToComprehensiveDTO(MedicalRecord record,
+                                                                     List<Diagnosis> diagnoses,
+                                                                     List<MedicalReport> reports) {
+        String patientName = "";
+        String embg = "";
+        if (record.getPatient() != null) {
+            patientName = record.getPatient().getFirstName() + " " + record.getPatient().getLastName();
+            embg = record.getPatient().getEmbg();
+        }
+
+        List<MedicalRecordSymptoms> recordSymptoms = symptomRepository.findByMedicalRecordRecordId(record.getRecordId());
+        List<ComprehensiveMedicalRecordDTO.SymptomDTO> symptoms = recordSymptoms.stream()
+                .map(s -> new ComprehensiveMedicalRecordDTO.SymptomDTO(
+                        s.getSymptom().getSymptomId(),
+                        s.getSymptom().getName()
+                ))
+                .collect(Collectors.toList());
+
+        List<MedicalRecordAllergies> recordAllergies = allergyRepository.findByMedicalRecordRecordId(record.getRecordId());
+        List<ComprehensiveMedicalRecordDTO.AllergyDTO> allergies = recordAllergies.stream()
+                .map(a -> new ComprehensiveMedicalRecordDTO.AllergyDTO(
+                        a.getAllergy().getAllergyId(),
+                        a.getAllergy().getName(),
+                        a.getSeverity(),
+                        a.getReaction()
+                ))
+                .collect(Collectors.toList());
+
+        List<PrescriptionMedicalRecord> recordPrescriptions = prescriptionMedicalRecordRepository.findByMedicalRecordRecordId(record.getRecordId());
+        List<ComprehensiveMedicalRecordDTO.PrescriptionDTO> prescriptions = recordPrescriptions.stream()
+                .map(p -> new ComprehensiveMedicalRecordDTO.PrescriptionDTO(
+                        p.getPrescription() != null ? p.getPrescription().getPrescriptionId() : null,
+                        p.getPrescription() != null ? p.getPrescription().getMedicationName() : "",
+                        p.getDosage(),
+                        p.getFrequency(),
+                        p.getDuration()
+                ))
+                .collect(Collectors.toList());
+
+        List<ComprehensiveMedicalRecordDTO.MedicalReportDTO> reportDTOs = reports.stream()
+                .map(r -> new ComprehensiveMedicalRecordDTO.MedicalReportDTO(
+                        r.getReportId(),
+                        r.getDoctor() != null ? r.getDoctor().getFirstName() + " " + r.getDoctor().getLastName() : "",
+                        r.getDescription(),
+                        r.getReportDate().toString()
+                ))
+                .collect(Collectors.toList());
+
+        List<ComprehensiveMedicalRecordDTO.DiagnosisDTO> diagnosisDTOs = diagnoses.stream()
+                .map(d -> new ComprehensiveMedicalRecordDTO.DiagnosisDTO(
+                        d.getDiagnosisId(),
+                        d.getName(),
+                        d.getDescription(),
+                        d.getDoctor() != null ? d.getDoctor().getFirstName() + " " + d.getDoctor().getLastName() : ""
+                ))
+                .collect(Collectors.toList());
+
+        return new ComprehensiveMedicalRecordDTO(
+                record.getRecordId(),
+                record.getPatient() != null ? record.getPatient().getPatientId() : null,
+                patientName,
+                embg,
+                diagnosisDTOs,
+                symptoms,
+                allergies,
+                prescriptions,
+                reportDTOs
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/MedicalReportController.java
===================================================================
--- backend/src/main/java/medora/controller/MedicalReportController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/MedicalReportController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,147 @@
+package medora.controller;
+
+import medora.dto.ComprehensiveMedicalReportDTO;
+import medora.dto.CreateMedicalReportRequest;
+import medora.models.domain.MedicalReport;
+import medora.service.MedicalReportService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+
+@RestController
+@RequestMapping("/api/medical-reports")
+public class MedicalReportController {
+
+    private static final Logger logger = LoggerFactory.getLogger(MedicalReportController.class);
+
+    private final MedicalReportService medicalReportService;
+
+    public MedicalReportController(MedicalReportService medicalReportService) {
+        this.medicalReportService = medicalReportService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> createMedicalReport(@RequestBody CreateMedicalReportRequest request) {
+        try {
+            if (request.getDoctorId() == null || request.getDoctorId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid doctor ID is required"));
+            }
+            if (request.getMedicalRecordId() == null || request.getMedicalRecordId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid medical record ID is required"));
+            }
+            if (request.getDescription() == null || request.getDescription().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Report description is required"));
+            }
+            if (request.getReportDate() == null) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Report date is required"));
+            }
+
+            MedicalReport report = medicalReportService.createMedicalReportWithSelectedItems(
+                    request.getDoctorId(),
+                    request.getMedicalRecordId(),
+                    request.getDescription(),
+                    request.getReportDate(),
+                    request.getSelectedDiagnosisIds(),
+                    request.getSelectedPrescriptionIds(),
+                    request.getSelectedAllergyIds(),
+                    request.getSelectedSymptomIds()
+            );
+
+            ComprehensiveMedicalReportDTO dto = medicalReportService.getComprehensiveReport(report.getReportId());
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating medical report: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating medical report: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create medical report: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{reportId}")
+    public ResponseEntity<?> getMedicalReportById(@PathVariable Long reportId) {
+        try {
+            logger.info("Fetching medical report with ID: {}", reportId);
+            ComprehensiveMedicalReportDTO report = medicalReportService.getComprehensiveReport(reportId);
+            return ResponseEntity.ok(report);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching medical report: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching medical report: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch medical report: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/record/{medicalRecordId}")
+    public ResponseEntity<?> getReportsForMedicalRecord(@PathVariable Long medicalRecordId) {
+        try {
+            logger.info("Fetching reports for medical record ID: {}", medicalRecordId);
+            List<ComprehensiveMedicalReportDTO> reports = medicalReportService.getComprehensiveReportsForMedicalRecord(medicalRecordId);
+            return ResponseEntity.ok(reports);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching medical reports: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching medical reports: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch medical reports: " + e.getMessage()));
+        }
+    }
+
+    @PutMapping("/{reportId}")
+    public ResponseEntity<?> updateMedicalReport(@PathVariable Long reportId,
+                                                 @RequestBody Map<String, String> request) {
+        try {
+            String description = request.get("description");
+            if (description == null || description.isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Description is required"));
+            }
+
+            logger.info("Updating medical report with ID: {}", reportId);
+            MedicalReport updated = medicalReportService.updateMedicalReport(reportId, description);
+            ComprehensiveMedicalReportDTO dto = medicalReportService.getComprehensiveReport(updated.getReportId());
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error updating medical report: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error updating medical report: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to update medical report: " + e.getMessage()));
+        }
+    }
+
+    @DeleteMapping("/{reportId}")
+    public ResponseEntity<?> deleteMedicalReport(@PathVariable Long reportId) {
+        try {
+            logger.info("Deleting medical report with ID: {}", reportId);
+            medicalReportService.deleteMedicalReport(reportId);
+            return ResponseEntity.ok(Map.of("message", "Medical report deleted successfully"));
+        } catch (RuntimeException e) {
+            logger.error("Error deleting medical report: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error deleting medical report: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to delete medical report: " + e.getMessage()));
+        }
+    }
+}
Index: backend/src/main/java/medora/controller/PatientController.java
===================================================================
--- backend/src/main/java/medora/controller/PatientController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/PatientController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,197 @@
+package medora.controller;
+
+import medora.dto.CreatePatientRequest;
+import medora.dto.PatientDTO;
+import medora.models.domain.Patient;
+import medora.service.PatientService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/patients")
+public class PatientController {
+
+    private static final Logger logger = LoggerFactory.getLogger(PatientController.class);
+
+    private final PatientService patientService;
+
+    public PatientController(PatientService patientService) {
+        this.patientService = patientService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> createPatient(@RequestBody CreatePatientRequest request) {
+        try {
+            if (request.getFirstName() == null || request.getFirstName().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "First name is required"));
+            }
+            if (request.getLastName() == null || request.getLastName().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Last name is required"));
+            }
+            if (request.getEmbg() == null || request.getEmbg().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "EMBG is required"));
+            }
+
+            Patient patient = new Patient();
+            patient.setFirstName(request.getFirstName());
+            patient.setLastName(request.getLastName());
+            patient.setEmailAddress(request.getEmailAddress());
+            patient.setDateOfBirth(request.getDateOfBirth());
+            patient.setBloodType(request.getBloodType());
+            patient.setGender(request.getGender());
+            patient.setPhoneNumber(request.getPhoneNumber());
+            patient.setEmbg(request.getEmbg());
+
+            Patient createdPatient = patientService.createPatient(patient);
+            PatientDTO dto = convertToDTO(createdPatient);
+
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating patient: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating patient: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create patient: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{patientId}")
+    public ResponseEntity<?> getPatientById(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching patient with ID: {}", patientId);
+            return patientService.getPatientById(patientId)
+                    .map(p -> ResponseEntity.ok(convertToDTO(p)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching patient: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching patient: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch patient: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/embg/{embg}")
+    public ResponseEntity<?> getPatientByEmbg(@PathVariable String embg) {
+        try {
+            logger.info("Fetching patient with EMBG: {}", embg);
+            return patientService.getPatientByEmbg(embg)
+                    .map(p -> ResponseEntity.ok(convertToDTO(p)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching patient: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching patient: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch patient: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/email/{emailAddress}")
+    public ResponseEntity<?> getPatientByEmail(@PathVariable String emailAddress) {
+        try {
+            logger.info("Fetching patient with email: {}", emailAddress);
+            return patientService.getPatientByEmail(emailAddress)
+                    .map(p -> ResponseEntity.ok(convertToDTO(p)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching patient: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching patient: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch patient: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping
+    public ResponseEntity<?> getAllPatients() {
+        try {
+            logger.info("Fetching all patients");
+            List<Patient> patients = patientService.getAllPatients();
+            List<PatientDTO> patientDTOs = patients.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(patientDTOs);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching patients: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching patients: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch patients: " + e.getMessage()));
+        }
+    }
+
+    @PutMapping("/{patientId}")
+    public ResponseEntity<?> updatePatient(@PathVariable Long patientId,
+                                          @RequestBody CreatePatientRequest request) {
+        try {
+            logger.info("Updating patient with ID: {}", patientId);
+
+            Patient patientDetails = new Patient();
+            patientDetails.setFirstName(request.getFirstName());
+            patientDetails.setLastName(request.getLastName());
+            patientDetails.setPhoneNumber(request.getPhoneNumber());
+            patientDetails.setBloodType(request.getBloodType());
+
+            Patient updatedPatient = patientService.updatePatient(patientId, patientDetails);
+            PatientDTO dto = convertToDTO(updatedPatient);
+
+            return ResponseEntity.ok(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error updating patient: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error updating patient: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to update patient: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/backfill/medical-records")
+    public ResponseEntity<?> backfillMissingMedicalRecords() {
+        try {
+            logger.info("Starting backfill of missing medical records");
+            int createdCount = patientService.createMissingMedicalRecords();
+            return ResponseEntity.ok(Map.of("message", "Backfill complete", "recordsCreated", createdCount));
+        } catch (Exception e) {
+            logger.error("Error during backfill: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Backfill failed: " + e.getMessage()));
+        }
+    }
+
+    private PatientDTO convertToDTO(Patient patient) {
+        return new PatientDTO(
+                patient.getPatientId(),
+                patient.getFirstName(),
+                patient.getLastName(),
+                patient.getEmailAddress(),
+                patient.getDateOfBirth(),
+                patient.getBloodType(),
+                patient.getGender(),
+                patient.getPhoneNumber(),
+                patient.getEmbg()
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/PrescriptionController.java
===================================================================
--- backend/src/main/java/medora/controller/PrescriptionController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/PrescriptionController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,113 @@
+package medora.controller;
+
+import medora.dto.CreatePrescriptionRequest;
+import medora.dto.PrescriptionDTO;
+import medora.models.domain.PrescriptionMedicalRecord;
+import medora.service.PrescriptionService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/prescriptions")
+public class PrescriptionController {
+
+    private static final Logger logger = LoggerFactory.getLogger(PrescriptionController.class);
+
+    private final PrescriptionService prescriptionService;
+
+    public PrescriptionController(PrescriptionService prescriptionService) {
+        this.prescriptionService = prescriptionService;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> prescribeMedication(@RequestBody CreatePrescriptionRequest request) {
+        try {
+            if (request.getMedicalRecordId() == null || request.getMedicalRecordId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid medical record ID is required"));
+            }
+            if (request.getMedicationName() == null || request.getMedicationName().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Medication name is required"));
+            }
+            if (request.getDosage() == null || request.getDosage().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Dosage is required"));
+            }
+
+            PrescriptionMedicalRecord prescription = prescriptionService.prescribeMedication(
+                    request.getMedicalRecordId(),
+                    request.getMedicationName(),
+                    request.getDosage(),
+                    request.getFrequency(),
+                    request.getDuration(),
+                    request.getNotes()
+            );
+            PrescriptionDTO dto = convertToDTO(prescription);
+
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating prescription: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating prescription: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create prescription: " + e.getMessage()));
+        }
+    }
+
+
+    @GetMapping("/medical-record/{medicalRecordId}")
+    public ResponseEntity<?> getPrescriptionsForMedicalRecord(@PathVariable Long medicalRecordId) {
+        try {
+            logger.info("Fetching prescriptions for medical record ID: {}", medicalRecordId);
+            List<PrescriptionMedicalRecord> prescriptions = prescriptionService.getPrescriptionsForMedicalRecord(medicalRecordId);
+            List<PrescriptionDTO> dtos = prescriptions.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching prescriptions: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching prescriptions: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch prescriptions: " + e.getMessage()));
+        }
+    }
+
+
+
+    private PrescriptionDTO convertToDTO(PrescriptionMedicalRecord prescription) {
+        Long prescriptionId = null;
+        Long medicalRecordId = null;
+        String medicationName = null;
+
+        if (prescription.getPrescription() != null) {
+            prescriptionId = prescription.getPrescription().getPrescriptionId();
+            medicationName = prescription.getPrescription().getMedicationName();
+        }
+        if (prescription.getMedicalRecord() != null) {
+            medicalRecordId = prescription.getMedicalRecord().getRecordId();
+        }
+
+        return new PrescriptionDTO(
+                prescriptionId,
+                medicalRecordId,
+                medicationName,
+                prescription.getDosage(),
+                prescription.getFrequency(),
+                prescription.getDuration(),
+                prescription.getNotes()
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/ProcedureController.java
===================================================================
--- backend/src/main/java/medora/controller/ProcedureController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/ProcedureController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,301 @@
+package medora.controller;
+
+import medora.dto.ProcedureRequestDTO;
+import medora.dto.RequestProcedureRequest;
+import medora.dto.SubmitProcedureResultRequest;
+import medora.models.domain.PerformedProcedures;
+import medora.models.domain.ProcedureResults;
+import medora.service.ProcedureService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.format.annotation.DateTimeFormat;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalDate;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/performed-procedures")
+public class ProcedureController {
+
+    private static final Logger logger = LoggerFactory.getLogger(ProcedureController.class);
+
+    private final ProcedureService procedureService;
+
+    public ProcedureController(ProcedureService procedureService) {
+        this.procedureService = procedureService;
+    }
+
+    @GetMapping("/available")
+    public ResponseEntity<?> getAvailableProcedures() {
+        try {
+            logger.info("Fetching all available procedures");
+            return ResponseEntity.ok(procedureService.getAllProcedures());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching procedures: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching procedures: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch procedures: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/request")
+    public ResponseEntity<?> requestProcedure(@RequestBody RequestProcedureRequest request) {
+        try {
+            logger.info("Requesting procedure {} for patient {}", request.getProcedureId(), request.getPatientId());
+
+            PerformedProcedures performedProcedure = procedureService.requestProcedureForPatient(
+                    request.getPatientId(),
+                    request.getDoctorId(),
+                    request.getProcedureId(),
+                    request.getDiagnosisId(),
+                    request.getProcedureDate(),
+                    request.getNotes()
+            );
+
+            return ResponseEntity.status(HttpStatus.CREATED)
+                    .body(convertPerformedProcedureToDTO(performedProcedure));
+        } catch (IllegalArgumentException e) {
+            logger.error("Validation error requesting procedure: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (RuntimeException e) {
+            logger.error("Error requesting procedure: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error requesting procedure: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to request procedure: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/requests/patient/{patientId}")
+    public ResponseEntity<?> getProcedureRequestsForPatient(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching procedure requests for patient {}", patientId);
+            List<PerformedProcedures> requests = procedureService.getProcedureRequestsForPatient(patientId);
+            List<ProcedureRequestDTO> dtos = requests.stream()
+                    .map(this::convertPerformedProcedureToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching procedure requests: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching procedure requests: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch procedure requests: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/requests/doctor/{doctorId}")
+    public ResponseEntity<?> getProcedureRequestsByDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching procedure requests by doctor {}", doctorId);
+            List<PerformedProcedures> requests = procedureService.getProcedureRequestsByDoctor(doctorId);
+            List<ProcedureRequestDTO> dtos = requests.stream()
+                    .map(this::convertPerformedProcedureToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching doctor procedure requests: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching doctor procedure requests: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch procedure requests: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/record")
+    public ResponseEntity<?> recordProcedure(
+            @RequestParam Long procedureId,
+            @RequestParam Long doctorId,
+            @RequestParam Long patientId,
+            @RequestParam(required = false) Long diagnosisId,
+            @RequestParam @DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate procedureDate) {
+        try {
+            logger.info("Recording procedure - procedureId: {}, doctorId: {}, patientId: {}, procedureDate: {}",
+                    procedureId, doctorId, patientId, procedureDate);
+
+            PerformedProcedures procedure = procedureService.recordProcedure(
+                    procedureId, doctorId, patientId, diagnosisId, procedureDate);
+
+            Map<String, Object> response = Map.of(
+                    "performedId", procedure.getPerformedId(),
+                    "procedureId", procedure.getProcedure().getProcedureId(),
+                    "procedureType", procedure.getProcedure().getProcedureType(),
+                    "doctorId", procedure.getDoctor().getDoctorId(),
+                    "patientId", procedure.getPatient().getPatientId(),
+                    "procedureDate", procedure.getProcedureDate(),
+                    "notes", procedure.getNotes() != null ? procedure.getNotes() : ""
+            );
+            return ResponseEntity.status(HttpStatus.CREATED).body(response);
+        } catch (RuntimeException e) {
+            logger.error("Error recording procedure: {}", e.getMessage(), e);
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error recording procedure: {}", e.getMessage(), e);
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to record procedure: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/patient/{patientId}")
+    public ResponseEntity<?> getProceduresForPatient(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching procedures for patient ID: {}", patientId);
+            List<PerformedProcedures> procedures = procedureService.getProceduresForPatient(patientId);
+            return ResponseEntity.ok(procedures);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching procedures: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching procedures: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch procedures: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/medical-record/{medicalRecordId}")
+    public ResponseEntity<?> getProceduresForMedicalRecord(@PathVariable Long medicalRecordId) {
+        try {
+            logger.info("Fetching procedures for medical record ID: {}", medicalRecordId);
+            return ResponseEntity.ok(procedureService.getProceduresForMedicalRecord(medicalRecordId));
+        } catch (RuntimeException e) {
+            logger.error("Error fetching procedures: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching procedures: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch procedures: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{procedureId}")
+    public ResponseEntity<?> getPerformedProcedureById(@PathVariable Long procedureId) {
+        try {
+            logger.info("Fetching performed procedure with ID: {}", procedureId);
+            return procedureService.getPerformedProcedureById(procedureId)
+                    .map(p -> ResponseEntity.ok(p))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching procedure: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching procedure: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch procedure: " + e.getMessage()));
+        }
+    }
+
+    @PatchMapping("/{procedureId}/outcome")
+    public ResponseEntity<?> recordProcedureOutcome(
+            @PathVariable Long procedureId,
+            @RequestParam String notes) {
+        try {
+            logger.info("Recording procedure outcome for ID: {}", procedureId);
+            PerformedProcedures procedure = procedureService.recordProcedureOutcome(procedureId, notes);
+
+            Map<String, Object> response = Map.of(
+                    "performedId", procedure.getPerformedId(),
+                    "procedureId", procedure.getProcedure().getProcedureId(),
+                    "procedureType", procedure.getProcedure().getProcedureType(),
+                    "notes", procedure.getNotes() != null ? procedure.getNotes() : "",
+                    "procedureDate", procedure.getProcedureDate()
+            );
+            return ResponseEntity.ok(response);
+        } catch (RuntimeException e) {
+            logger.error("Error recording procedure outcome: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error recording procedure outcome: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to record procedure outcome: " + e.getMessage()));
+        }
+    }
+
+    @PostMapping("/results")
+    public ResponseEntity<?> submitProcedureResult(@RequestBody SubmitProcedureResultRequest request) {
+        try {
+            logger.info("Submitting procedure result for medical record {}", request.getMedicalRecordId());
+
+            ProcedureResults result = procedureService.storeProcedureResult(
+                    request.getMedicalRecordId(),
+                    request.getProcedureId(),
+                    request.getResultDescription(),
+                    request.getResultDate()
+            );
+
+            return ResponseEntity.status(HttpStatus.CREATED)
+                    .body(convertResultToDTO(result));
+        } catch (IllegalArgumentException e) {
+            logger.error("Validation error submitting procedure result: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (RuntimeException e) {
+            logger.error("Error submitting procedure result: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error submitting procedure result: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to submit procedure result: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/results/medical-record/{medicalRecordId}")
+    public ResponseEntity<?> getProcedureResultsForMedicalRecord(@PathVariable Long medicalRecordId) {
+        try {
+            logger.info("Fetching procedure results for medical record {}", medicalRecordId);
+            List<ProcedureResults> results = procedureService.getProcedureResultsForMedicalRecord(medicalRecordId);
+            return ResponseEntity.ok(results);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching procedure results: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching procedure results: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch procedure results: " + e.getMessage()));
+        }
+    }
+
+    private ProcedureRequestDTO convertPerformedProcedureToDTO(PerformedProcedures performedProcedure) {
+        return new ProcedureRequestDTO(
+                performedProcedure.getProcedure().getProcedureId(),
+                performedProcedure.getProcedure().getProcedureType(),
+                performedProcedure.getPatient().getPatientId(),
+                performedProcedure.getPatient().getFirstName() + " " + performedProcedure.getPatient().getLastName(),
+                performedProcedure.getDoctor().getDoctorId(),
+                performedProcedure.getDoctor().getFirstName() + " " + performedProcedure.getDoctor().getLastName(),
+                performedProcedure.getProcedureDate(),
+                performedProcedure.getNotes()
+        );
+    }
+
+    private Map<String, Object> convertResultToDTO(ProcedureResults result) {
+        return Map.of(
+            "resultId", result.getResultId(),
+            "procedureId", result.getProcedure().getProcedureId(),
+            "procedureType", result.getProcedure().getProcedureType(),
+            "resultDescription", result.getResultDescription() != null ? result.getResultDescription() : "",
+            "resultDate", result.getResultDate()
+        );
+    }
+}
Index: backend/src/main/java/medora/controller/ReferralController.java
===================================================================
--- backend/src/main/java/medora/controller/ReferralController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/controller/ReferralController.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,255 @@
+package medora.controller;
+
+import medora.dto.CreateReferralRequest;
+import medora.dto.ReferralDTO;
+import medora.models.domain.MedicalRecord;
+import medora.models.domain.Referrals;
+import medora.repository.MedicalRecordRepository;
+import medora.service.AppointmentService;
+import medora.service.ReferralService;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.http.HttpStatus;
+import org.springframework.http.ResponseEntity;
+import org.springframework.web.bind.annotation.*;
+
+import java.time.LocalTime;
+import java.util.List;
+import java.util.Map;
+import java.util.stream.Collectors;
+
+@RestController
+@RequestMapping("/api/referrals")
+public class ReferralController {
+
+    private static final Logger logger = LoggerFactory.getLogger(ReferralController.class);
+
+    private final ReferralService referralService;
+    private final AppointmentService appointmentService;
+    private final MedicalRecordRepository medicalRecordRepository;
+
+    public ReferralController(ReferralService referralService,
+                            AppointmentService appointmentService,
+                            MedicalRecordRepository medicalRecordRepository) {
+        this.referralService = referralService;
+        this.appointmentService = appointmentService;
+        this.medicalRecordRepository = medicalRecordRepository;
+    }
+
+    @PostMapping
+    public ResponseEntity<?> createReferral(@RequestBody CreateReferralRequest request) {
+        try {
+            if (request.getMedicalRecordId() == null || request.getMedicalRecordId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid medical record ID is required"));
+            }
+            if (request.getFromDoctorId() == null || request.getFromDoctorId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid from doctor ID is required"));
+            }
+            if (request.getToDoctorId() == null || request.getToDoctorId() <= 0) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Valid to doctor ID is required"));
+            }
+            if (request.getReason() == null || request.getReason().isBlank()) {
+                return ResponseEntity.badRequest()
+                        .body(Map.of("error", "Referral reason is required"));
+            }
+
+            Referrals referral = referralService.createReferral(
+                    request.getMedicalRecordId(),
+                    request.getFromDoctorId(),
+                    request.getToDoctorId(),
+                    request.getReason(),
+                    request.getReferralDate()
+            );
+
+            // Create an appointment for the referral
+            try {
+                MedicalRecord medicalRecord = medicalRecordRepository.findById(request.getMedicalRecordId())
+                        .orElseThrow(() -> new RuntimeException("Medical record not found"));
+                Long patientId = medicalRecord.getPatient().getPatientId();
+
+                appointmentService.createAppointment(
+                        patientId,
+                        request.getToDoctorId(),
+                        request.getReferralDate(),
+                        LocalTime.of(10, 0) // Default appointment time at 10:00 AM
+                );
+                logger.info("Created appointment for referral with ID: {}", referral.getReferralId());
+            } catch (Exception e) {
+                logger.warn("Failed to create appointment for referral: {}", e.getMessage());
+            }
+
+            ReferralDTO dto = convertToDTO(referral);
+            return ResponseEntity.status(HttpStatus.CREATED).body(dto);
+        } catch (RuntimeException e) {
+            logger.error("Error creating referral: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error creating referral: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to create referral: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/patient/{patientId}")
+    public ResponseEntity<?> getReferralsByPatient(@PathVariable Long patientId) {
+        try {
+            logger.info("Fetching referrals for patient ID: {}", patientId);
+            List<Referrals> referrals = referralService.getReferralsForPatient(patientId);
+            List<ReferralDTO> dtos = referrals.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch referrals: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/from-doctor/{doctorId}")
+    public ResponseEntity<?> getReferralsByFromDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching referrals from doctor ID: {}", doctorId);
+            List<Referrals> referrals = referralService.getReferralsByFromDoctor(doctorId);
+            List<ReferralDTO> dtos = referrals.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch referrals: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/to-doctor/{doctorId}")
+    public ResponseEntity<?> getReferralsByToDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching referrals to doctor ID: {}", doctorId);
+            List<Referrals> referrals = referralService.getReferralsToDoctor(doctorId);
+            List<ReferralDTO> dtos = referrals.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch referrals: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/{referralId}")
+    public ResponseEntity<?> getReferralById(@PathVariable Long referralId) {
+        try {
+            logger.info("Fetching referral with ID: {}", referralId);
+            return referralService.getReferralById(referralId)
+                    .map(r -> ResponseEntity.ok(convertToDTO(r)))
+                    .orElse(ResponseEntity.notFound().build());
+        } catch (RuntimeException e) {
+            logger.error("Error fetching referral: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching referral: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch referral: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/doctor/{doctorId}/sent")
+    public ResponseEntity<?> getReferralsSentByDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching referrals sent by doctor ID: {}", doctorId);
+            List<Referrals> referrals = referralService.getReferralsByFromDoctor(doctorId);
+            List<ReferralDTO> dtos = referrals.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch referrals: " + e.getMessage()));
+        }
+    }
+
+    @GetMapping("/doctor/{doctorId}/received")
+    public ResponseEntity<?> getReferralsReceivedByDoctor(@PathVariable Long doctorId) {
+        try {
+            logger.info("Fetching referrals received by doctor ID: {}", doctorId);
+            List<Referrals> referrals = referralService.getReferralsToDoctor(doctorId);
+            List<ReferralDTO> dtos = referrals.stream()
+                    .map(this::convertToDTO)
+                    .collect(Collectors.toList());
+            return ResponseEntity.ok(dtos);
+        } catch (RuntimeException e) {
+            logger.error("Error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.badRequest()
+                    .body(Map.of("error", e.getMessage()));
+        } catch (Exception e) {
+            logger.error("Unexpected error fetching referrals: {}", e.getMessage());
+            return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR)
+                    .body(Map.of("error", "Failed to fetch referrals: " + e.getMessage()));
+        }
+    }
+
+    private ReferralDTO convertToDTO(Referrals referral) {
+        String fromDoctorName = "";
+        Long fromDoctorId = null;
+        if (referral.getFromDoctor() != null) {
+            fromDoctorName = referral.getFromDoctor().getFirstName() + " " + referral.getFromDoctor().getLastName();
+            fromDoctorId = referral.getFromDoctor().getDoctorId();
+        }
+
+        String toDoctorName = "";
+        Long toDoctorId = null;
+        if (referral.getToDoctor() != null) {
+            toDoctorName = referral.getToDoctor().getFirstName() + " " + referral.getToDoctor().getLastName();
+            toDoctorId = referral.getToDoctor().getDoctorId();
+        }
+
+        Long medicalRecordId = null;
+        Long patientId = null;
+        String patientName = "";
+        if (referral.getMedicalRecord() != null) {
+            medicalRecordId = referral.getMedicalRecord().getRecordId();
+            if (referral.getMedicalRecord().getPatient() != null) {
+                patientId = referral.getMedicalRecord().getPatient().getPatientId();
+                patientName = referral.getMedicalRecord().getPatient().getFirstName() + " "
+                        + referral.getMedicalRecord().getPatient().getLastName();
+            }
+        }
+
+        return new ReferralDTO(
+                referral.getReferralId(),
+                medicalRecordId,
+                patientId,
+                patientName,
+                fromDoctorId,
+                fromDoctorName,
+                toDoctorId,
+                toDoctorName,
+                referral.getReason(),
+                referral.getReferralDate()
+        );
+    }
+}
Index: backend/src/main/java/medora/repository/MedicalRecordProcedureResultRepository.java
===================================================================
--- backend/src/main/java/medora/repository/MedicalRecordProcedureResultRepository.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/repository/MedicalRecordProcedureResultRepository.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,24 @@
+package medora.repository;
+
+import medora.models.domain.MedicalRecordProcedureResults;
+import medora.models.domain.id.MedicalRecordProcedureResultId;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+public interface MedicalRecordProcedureResultRepository extends JpaRepository<MedicalRecordProcedureResults, MedicalRecordProcedureResultId> {
+
+    // Find all procedure results for a medical record
+    List<MedicalRecordProcedureResults> findByMedicalRecordRecordId(Long recordId);
+
+    // Check if a procedure result is already linked to a medical record
+    @Query("""
+        SELECT CASE WHEN COUNT(mrpr) > 0 THEN true ELSE false END
+        FROM MedicalRecordProcedureResults mrpr
+        WHERE mrpr.medicalRecord.recordId = :recordId
+        AND mrpr.procedureResult.resultId = :resultId
+    """)
+    boolean existsByMedicalRecordAndProcedureResult(@Param("recordId") Long recordId, @Param("resultId") Long resultId);
+}
Index: backend/src/main/java/medora/repository/ProcedureResultRepository.java
===================================================================
--- backend/src/main/java/medora/repository/ProcedureResultRepository.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
+++ backend/src/main/java/medora/repository/ProcedureResultRepository.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -0,0 +1,32 @@
+package medora.repository;
+
+import medora.models.domain.ProcedureResults;
+import org.springframework.data.jpa.repository.JpaRepository;
+import org.springframework.data.jpa.repository.Query;
+import org.springframework.data.repository.query.Param;
+
+import java.util.List;
+
+public interface ProcedureResultRepository extends JpaRepository<ProcedureResults, Long> {
+
+    // UC017 – Record Procedure Outcome
+    List<ProcedureResults> findByProcedureProcedureId(Long procedureId);
+
+    // Find results for a specific medical record
+    @Query("""
+        SELECT pr FROM ProcedureResults pr
+        WHERE pr IN (
+            SELECT mrpr.procedureResult FROM MedicalRecordProcedureResults mrpr
+            WHERE mrpr.medicalRecord.recordId = :recordId
+        )
+    """)
+    List<ProcedureResults> findByMedicalRecordId(@Param("recordId") Long recordId);
+
+    // Find latest results for a procedure
+    @Query("""
+        SELECT pr FROM ProcedureResults pr
+        WHERE pr.procedure.procedureId = :procedureId
+        ORDER BY pr.resultDate DESC
+    """)
+    List<ProcedureResults> findLatestResultsByProcedure(@Param("procedureId") Long procedureId);
+}
Index: backend/src/main/java/medora/service/ProcedureService.java
===================================================================
--- backend/src/main/java/medora/service/ProcedureService.java	(revision bc882d26274cd2e0b878d7a95fd44f4a49e80a46)
+++ backend/src/main/java/medora/service/ProcedureService.java	(revision f626fb698984f3908860e111bdd44c6aeac8a401)
@@ -1,5 +1,4 @@
 package medora.service;
 
-import jakarta.persistence.EntityManager;
 import medora.dto.SimpleProcedureDTO;
 import medora.models.domain.*;
@@ -10,4 +9,5 @@
 import org.springframework.transaction.annotation.Transactional;
 
+import jakarta.persistence.EntityManager;
 import java.time.LocalDate;
 import java.util.List;
@@ -26,5 +26,6 @@
     private final MedicalRecordRepository medicalRecordRepository;
     private final MedicalRecordProcedureRepository medicalRecordProcedureRepository;
-
+    private final ProcedureResultRepository procedureResultRepository;
+    private final MedicalRecordProcedureResultRepository medicalRecordProcedureResultRepository;
     private final EntityManager entityManager;
 
@@ -36,5 +37,6 @@
                             MedicalRecordRepository medicalRecordRepository,
                             MedicalRecordProcedureRepository medicalRecordProcedureRepository,
-
+                            ProcedureResultRepository procedureResultRepository,
+                            MedicalRecordProcedureResultRepository medicalRecordProcedureResultRepository,
                             EntityManager entityManager) {
 
@@ -46,9 +48,10 @@
         this.medicalRecordRepository = medicalRecordRepository;
         this.medicalRecordProcedureRepository = medicalRecordProcedureRepository;
-
+        this.procedureResultRepository = procedureResultRepository;
+        this.medicalRecordProcedureResultRepository = medicalRecordProcedureResultRepository;
         this.entityManager = entityManager;
     }
 
-    //REQUEST PROCEDURE
+    // ================= REQUEST PROCEDURE (NEW) =================
     @Transactional
     public PerformedProcedures requestProcedureForPatient(Long patientId,
@@ -97,5 +100,5 @@
     }
 
-    // UC016
+    // ================= UC016 =================
     @Transactional
     public PerformedProcedures recordProcedure(Long procedureId,
@@ -142,5 +145,5 @@
     }
 
-    // UC017
+    // ================= UC017 =================
     @Transactional
     public PerformedProcedures recordProcedureOutcome(Long performedProcedureId, String notes) {
@@ -160,5 +163,5 @@
     }
 
-    //  LINK TO MEDICAL RECORD
+    // ================= LINK TO MEDICAL RECORD =================
     @Transactional
     public MedicalRecordProcedures linkProcedureToMedicalRecord(Long medicalRecordId,
@@ -189,5 +192,5 @@
     }
 
-
+    // ================= READ METHODS =================
     @Transactional(readOnly = true)
     public List<PerformedProcedures> getProcedureRequestsForPatient(Long patientId) {
@@ -259,3 +262,51 @@
     }
 
-    }
+    // ================= STORE PROCEDURE RESULT (UC017 Enhanced) =================
+    @Transactional
+    public ProcedureResults storeProcedureResult(Long medicalRecordId,
+                                                 Long procedureId,
+                                                 String resultDescription,
+                                                 LocalDate resultDate) {
+
+        if (medicalRecordId == null || medicalRecordId <= 0)
+            throw new IllegalArgumentException("Medical record ID must be valid");
+
+        if (procedureId == null || procedureId <= 0)
+            throw new IllegalArgumentException("Procedure ID must be valid");
+
+        if (resultDate == null)
+            throw new IllegalArgumentException("Result date is required");
+
+        MedicalRecord record = medicalRecordRepository.findById(medicalRecordId)
+                .orElseThrow(() -> new RuntimeException("Medical record not found"));
+
+        Procedure procedure = procedureRepository.findById(procedureId)
+                .orElseThrow(() -> new RuntimeException("Procedure not found"));
+
+        ProcedureResults result = new ProcedureResults();
+        result.setProcedure(procedure);
+        result.setResultDescription(resultDescription);
+        result.setResultDate(resultDate);
+
+        ProcedureResults savedResult = procedureResultRepository.save(result);
+
+        // Link to medical record
+        MedicalRecordProcedureResults link = new MedicalRecordProcedureResults(record, savedResult);
+        medicalRecordProcedureResultRepository.save(link);
+
+        logger.info("Stored procedure result {} for medical record {}", savedResult.getResultId(), medicalRecordId);
+        return savedResult;
+    }
+
+    @Transactional(readOnly = true)
+    public List<ProcedureResults> getProcedureResultsForMedicalRecord(Long medicalRecordId) {
+
+        if (medicalRecordId == null || medicalRecordId <= 0)
+            throw new IllegalArgumentException("Medical record ID must be valid");
+
+        if (!medicalRecordRepository.existsById(medicalRecordId))
+            throw new RuntimeException("Medical record not found");
+
+        return procedureResultRepository.findByMedicalRecordId(medicalRecordId);
+    }
+}
