src/Controller/GeneralWardController.php line 42

Open in your IDE?
  1. <?php
  2. namespace App\Controller;
  3. use App\Entity\{ WardBedWardMedicineSchedule };
  4. use App\Repository\{ CaseMedicineRepositoryCaseRepositoryWardBedRepositoryWardMedicineScheduleRepository };
  5. use App\Service\Pagination;
  6. use Doctrine\ORM\EntityManagerInterface;
  7. use Sensio\Bundle\FrameworkExtraBundle\Configuration\IsGranted;
  8. use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
  9. use Symfony\Component\HttpFoundation\{ RequestResponse };
  10. use Symfony\Component\Routing\Annotation\Route;
  11. use Nzo\UrlEncryptorBundle\Annotations\ParamDecryptor;
  12. #[Route(path'/general-ward'), IsGranted(data'ROLE_WARD')]
  13. class GeneralWardController extends AbstractController
  14. {
  15.     use WardTrait;
  16.     private string $templatePath 'general_ward';
  17.     #[Route(path'/'name'general_ward_index'methods: ['GET'])]
  18.     public function index(Request $requestPagination $paginationWardBedRepository $wardBedRepo) : Response
  19.     {
  20.         return $this->indexMethod($request$pagination$wardBedRepo);
  21.     }
  22.     #[Route(path'/total-patients'name'general_ward_all'methods: ['GET'])]
  23.     public function allBeds(Request $requestPagination $paginationWardBedRepository $wardBedRepo) : Response
  24.     {
  25.         return $this->allBedsMethod($request$pagination$wardBedRepo);
  26.     }
  27.     #[Route(path'/prescription/{id}/{mode}'name'general_ward_prescription'methods: ['GET''POST'])]
  28.     #[ParamDecryptor(["id"])]
  29.     public function prescription(WardBed $wardBedstring $modeCaseRepository $caseRepo) : Response
  30.     {
  31.         return $this->prescriptionMethod($wardBed$mode$caseRepo);
  32.     }
  33.     #[Route(path'/create-schedule/{id}'name'general_ward_create_schedule'methods: ['GET''POST'])]
  34.     #[ParamDecryptor(["id"])]
  35.     public function createSchedule(Request $requestWardBed $wardBedEntityManagerInterface $entityManagerCaseMedicineRepository $caseMedicineRepoWardMedicineScheduleRepository $wardMedicineScheduleRepo) : Response
  36.     {
  37.         return $this->createScheduleMethod($request$wardBed'general_ward_create_schedule'$entityManager$caseMedicineRepo$wardMedicineScheduleRepo);
  38.     }
  39.     #[Route(path'/print-schedule/{id}'name'general_ward_print_schedule'methods: ['GET''POST'])]
  40.     #[ParamDecryptor(["id"])]
  41.     public function printSchedule(WardMedicineSchedule $scheduleWardMedicineScheduleRepository $wardMedicineScheduleRepo) : Response
  42.     {
  43.         return $this->printScheduleMethod($schedule$wardMedicineScheduleRepo);
  44.     }
  45.     #[Route(path'/remove-schedule'name'general_ward_remove_schedule'methods: ['GET'])]
  46.     public function removeSchedule(Request $requestWardMedicineScheduleRepository $wardMedicineScheduleRepo) : Response
  47.     {
  48.         return $this->removeScheduleMethod($request'general_ward_create_schedule'$wardMedicineScheduleRepo);
  49.     }
  50.     #[Route(path'/current-schedule'name'general_ward_current_schedule'methods: ['GET''POST'])]
  51.     public function currentSchedule(Request $requestWardMedicineScheduleRepository $wardMedicineScheduleRepo) : Response
  52.     {
  53.         return $this->currentScheduleMethod($request'general_ward_current_schedule'$wardMedicineScheduleRepo);
  54.     }
  55.     #[Route(path'/emergency-medicine/{id}'name'general_ward_emergency_medicine'methods: ['GET''POST'])]
  56.     #[ParamDecryptor(["id"])]
  57.     public function emergencyMedicine(Request $requestWardBed $wardBedCaseRepository $caseRepoEntityManagerInterface $entityManager) : Response
  58.     {
  59.         return $this->emergencyMedicineMethod($request$wardBed$caseRepo'general_ward_index''general_ward_emergency_medicine'$entityManager);
  60.     }
  61. }