java.lang.Object
com.mirna.hospitalmanagementapi.application.controllers.PatientController

@RestController @RequestMapping("/api/v1.0/patients") public class PatientController extends Object
A Spring REST controller for managing patients.
Version:
1.0
Author:
Mirna Gama
  • Constructor Details

    • PatientController

      public PatientController()
  • Method Details

    • postPatient

      @PostMapping public org.springframework.http.ResponseEntity<Object> postPatient(@RequestBody @Valid @Valid PatientDTO patientDTO)
      Post method to create a new Patient object based on the provided DTO.
      Parameters:
      patientDTO - The data transfer object containing data for Patient entity.
      Returns:
      A response entity containing the saved patient and created status if successful, or a 400-level error if there is a validation error
    • getPatient

      @GetMapping("/{id}") public org.springframework.http.ResponseEntity<Object> getPatient(@PathVariable Long id)
      Get method to receive a Patient record by the provided ID
      Parameters:
      id - A long representing the patient's unique identifier
      Returns:
      A response entity containing the saved patient if successful, or a 404 level error if it is non-existent