src/Entity/Patient.php line 13

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\PatientRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\ORM\Mapping as ORM;
  7. /**
  8.  * @ORM\Entity(repositoryClass=PatientRepository::class)
  9.  */
  10. class Patient
  11. {
  12.     /**
  13.      * @ORM\Id
  14.      * @ORM\GeneratedValue
  15.      * @ORM\Column(type="integer")
  16.      */
  17.     private $id;
  18.     /**
  19.      * @ORM\Column(type="string", length=32, nullable=true)
  20.      */
  21.     private $name;
  22.     /**
  23.      * @ORM\Column(type="string", length=32, nullable=true)
  24.      */
  25.     private $surname;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $alexaId;
  30.     /**
  31.      * @ORM\OneToMany(targetEntity=ExerciseSimpleAnswerResult::class, mappedBy="patient")
  32.      */
  33.     private $exerciseSimpleAnswerResults;
  34.     /**
  35.      * @ORM\OneToMany(targetEntity=ExerciseResult::class, mappedBy="patient")
  36.      */
  37.     private $exerciseResults;
  38.     /**
  39.      * @ORM\Column(type="json", nullable=true)
  40.      */
  41.     private $questionnaire;
  42.     /**
  43.      * @ORM\Column(type="integer", nullable=true)
  44.      */
  45.     private $diagnosis;
  46.     /**
  47.      * @ORM\ManyToMany(targetEntity=User::class, inversedBy="patients")
  48.      */
  49.     private $caregiver;
  50.     /**
  51.      * @ORM\Column(type="text", nullable=true)
  52.      */
  53.     private $scheduling = [];
  54.     /**
  55.      * @ORM\Column(type="integer", nullable=true)
  56.      */
  57.     private $patientKey;
  58.     /**
  59.      * @ORM\Column(type="integer", nullable=true)
  60.      */
  61.     private $sdsQuestionnaireMark;
  62.     /**
  63.      * @ORM\Column(type="datetime_immutable", nullable=true)
  64.      */
  65.     private $sdsQuesstionnaireCreatedAt;
  66.     /**
  67.      * @ORM\Column(type="text", nullable=true)
  68.      */
  69.     private $sdsQuestionnaireAnswers;
  70.     /**
  71.      * @ORM\Column(type="text", nullable=true)
  72.      */
  73.     private $mocaQuestionnaireMarks;
  74.     /**
  75.      * @ORM\Column(type="datetime_immutable", nullable=true)
  76.      */
  77.     private $mocaQuesstionnaireCreatedAt;
  78.     /**
  79.      * @ORM\Column(type="text", nullable=true)
  80.      */
  81.     private $mocaQuestionnaireAnswers;
  82.     /**
  83.      * @ORM\Column(type="string", length=8, nullable=true)
  84.      */
  85.     private $gender;
  86.     /**
  87.      * @ORM\Column(type="datetime", nullable=true)
  88.      */
  89.     private $dateOfBirth;
  90.     /**
  91.      * @ORM\Column(type="text", nullable=true)
  92.      */
  93.     private $medicalInfo;
  94.     /**
  95.      * @ORM\Column(type="text", nullable=true)
  96.      */
  97.     private $habitsInfo;
  98.     /**
  99.      * @ORM\Column(type="text", nullable=true)
  100.      */
  101.     private $fitnessInfo;
  102.     /**
  103.      * @ORM\Column(type="text", nullable=true)
  104.      */
  105.     private $exercisePreferences;
  106.     /**
  107.      * @ORM\Column(type="text", nullable=true)
  108.      */
  109.     private $solvedExercises;
  110.     /**
  111.      * @ORM\Column(type="text", nullable=true)
  112.      */
  113.     private $chatbotConfiguration;
  114.     public function __construct()
  115.     {
  116.         $this->setDiagnosis(0);
  117.         $this->setSdsQuestionnaireMark(null);
  118.         $this->setmocaQuestionnaireMarks(null);
  119.         $this->exerciseSimpleAnswerResults = new ArrayCollection();
  120.         $this->exerciseResults = new ArrayCollection();
  121.         $this->caregiver = new ArrayCollection();
  122.         $this->patientKey rand(1000,9999);
  123.     }
  124.     public function getId(): ?int
  125.     {
  126.         return $this->id;
  127.     }
  128.     public function getName(): ?string
  129.     {
  130.         return $this->name;
  131.     }
  132.     public function setName(?string $name): self
  133.     {
  134.         $this->name $name;
  135.         return $this;
  136.     }
  137.     public function getSurname(): ?string
  138.     {
  139.         return $this->surname;
  140.     }
  141.     public function setSurname(?string $surname): self
  142.     {
  143.         $this->surname $surname;
  144.         return $this;
  145.     }
  146.     public function getAlexaId(): ?string
  147.     {
  148.         return $this->alexaId;
  149.     }
  150.     public function setAlexaId(string $alexaId): self
  151.     {
  152.         $this->alexaId $alexaId;
  153.         return $this;
  154.     }
  155.     /**
  156.      * @return Collection|ExerciseSimpleAnswerResult[]
  157.      */
  158.     public function getExerciseSimpleAnswerResults(): Collection
  159.     {
  160.         return $this->exerciseSimpleAnswerResults;
  161.     }
  162.     public function addExerciseSimpleAnswerResult(ExerciseSimpleAnswerResult $exerciseSimpleAnswerResult): self
  163.     {
  164.         if (!$this->exerciseSimpleAnswerResults->contains($exerciseSimpleAnswerResult)) {
  165.             $this->exerciseSimpleAnswerResults[] = $exerciseSimpleAnswerResult;
  166.             $exerciseSimpleAnswerResult->setPatient($this);
  167.         }
  168.         return $this;
  169.     }
  170.     public function removeExerciseSimpleAnswerResult(ExerciseSimpleAnswerResult $exerciseSimpleAnswerResult): self
  171.     {
  172.         if ($this->exerciseSimpleAnswerResults->removeElement($exerciseSimpleAnswerResult)) {
  173.             // set the owning side to null (unless already changed)
  174.             if ($exerciseSimpleAnswerResult->getPatient() === $this) {
  175.                 $exerciseSimpleAnswerResult->setPatient(null);
  176.             }
  177.         }
  178.         return $this;
  179.     }
  180.     /**
  181.      * @return Collection|ExerciseResult[]
  182.      */
  183.     public function getExerciseResults(): Collection
  184.     {
  185.         return $this->exerciseResults;
  186.     }
  187.     public function addExerciseResult(ExerciseResult $exerciseResult): self
  188.     {
  189.         if (!$this->exerciseResults->contains($exerciseResult)) {
  190.             $this->exerciseResults[] = $exerciseResult;
  191.             $exerciseResult->setPatient($this);
  192.         }
  193.         return $this;
  194.     }
  195.     public function removeExerciseResult(ExerciseResult $exerciseResult): self
  196.     {
  197.         if ($this->exerciseResults->removeElement($exerciseResult)) {
  198.             // set the owning side to null (unless already changed)
  199.             if ($exerciseResult->getPatient() === $this) {
  200.                 $exerciseResult->setPatient(null);
  201.             }
  202.         }
  203.         return $this;
  204.     }
  205.     public function getQuestionnaire(): ?string
  206.     {
  207.         return $this->questionnaire;
  208.     }
  209.     public function setQuestionnaire(?string $questionnaire): self
  210.     {
  211.         $this->questionnaire $questionnaire;
  212.         return $this;
  213.     }
  214.     public function getDiagnosis(): ?int
  215.     {
  216.         return $this->diagnosis;
  217.     }
  218.     public function setDiagnosis(?int $diagnosis): self
  219.     {
  220.         $this->diagnosis $diagnosis;
  221.         return $this;
  222.     }
  223.     /**
  224.      * @return Collection|User[]
  225.      */
  226.     public function getCaregiver(): Collection
  227.     {
  228.         return $this->caregiver;
  229.     }
  230.     public function addCaregiver(User $caregiver): self
  231.     {
  232.         if (!$this->caregiver->contains($caregiver)) {
  233.             $this->caregiver[] = $caregiver;
  234.         }
  235.         return $this;
  236.     }
  237.     public function removeCaregiver(User $caregiver): self
  238.     {
  239.         $this->caregiver->removeElement($caregiver);
  240.         return $this;
  241.     }
  242.     public function __toString()
  243.     {
  244.         return $this->getName().' '.$this->getSurname();
  245.     }
  246.     public function getScheduling(): ?string
  247.     {
  248.         return $this->scheduling;
  249.     }
  250.     public function setScheduling(?string $scheduling): self
  251.     {
  252.         $this->scheduling $scheduling;
  253.         return $this;
  254.     }
  255.     public function getPatientKey(): ?int
  256.     {
  257.         return $this->patientKey;
  258.     }
  259.     public function setPatientKey(?int $patientKey): self
  260.     {
  261.         $this->patientKey $patientKey;
  262.         return $this;
  263.     }
  264.     public function getSdsQuestionnaireMark(): ?int
  265.     {
  266.         return $this->sdsQuestionnaireMark;
  267.     }
  268.     public function setSdsQuestionnaireMark(?int $sdsQuestionnaireMark): self
  269.     {
  270.         $this->sdsQuestionnaireMark $sdsQuestionnaireMark;
  271.         return $this;
  272.     }
  273.     public function getSdsQuesstionnaireCreatedAt(): ?\DateTimeImmutable
  274.     {
  275.         return $this->sdsQuesstionnaireCreatedAt;
  276.     }
  277.     public function setSdsQuesstionnaireCreatedAt(?\DateTimeImmutable $sdsQuesstionnaireCreatedAt): self
  278.     {
  279.         $this->sdsQuesstionnaireCreatedAt $sdsQuesstionnaireCreatedAt;
  280.         return $this;
  281.     }
  282.     public function getSdsQuestionnaireAnswers(): ?string
  283.     {
  284.         return $this->sdsQuestionnaireAnswers;
  285.     }
  286.     public function setSdsQuestionnaireAnswers(?string $sdsQuestionnaireAnswers): self
  287.     {
  288.         $this->sdsQuestionnaireAnswers $sdsQuestionnaireAnswers;
  289.         return $this;
  290.     }
  291.     public function getmocaQuestionnaireMarks(): ?string
  292.     {
  293.         return $this->mocaQuestionnaireMarks;
  294.     }
  295.     public function setmocaQuestionnaireMarks(?string $mocaQuestionnaireMarks): self
  296.     {
  297.         $this->mocaQuestionnaireMarks $mocaQuestionnaireMarks;
  298.         return $this;
  299.     }
  300.     public function getMocaQuesstionnaireCreatedAt(): ?\DateTimeImmutable
  301.     {
  302.         return $this->mocaQuesstionnaireCreatedAt;
  303.     }
  304.     public function setMocaQuesstionnaireCreatedAt(?\DateTimeImmutable $mocaQuesstionnaireCreatedAt): self
  305.     {
  306.         $this->mocaQuesstionnaireCreatedAt $mocaQuesstionnaireCreatedAt;
  307.         return $this;
  308.     }
  309.     public function getMocaQuestionnaireAnswers(): ?string
  310.     {
  311.         return $this->mocaQuestionnaireAnswers;
  312.     }
  313.     public function setMocaQuestionnaireAnswers(?string $mocaQuestionnaireAnswers): self
  314.     {
  315.         $this->mocaQuestionnaireAnswers $mocaQuestionnaireAnswers;
  316.         return $this;
  317.     }
  318.     public function getGender(): ?string
  319.     {
  320.         return $this->gender;
  321.     }
  322.     public function setGender(?string $gender): self
  323.     {
  324.         $this->gender $gender;
  325.         return $this;
  326.     }
  327.     public function getDateOfBirth(): ?\DateTime
  328.     {
  329.         return $this->dateOfBirth;
  330.     }
  331.     public function setDateOfBirth(?\DateTime $dateOfBirth): self
  332.     {
  333.         $this->dateOfBirth $dateOfBirth;
  334.         return $this;
  335.     }
  336.     public function getMedicalInfo(): ?string
  337.     {
  338.         return $this->medicalInfo;
  339.     }
  340.     public function setMedicalInfo(?string $medicalInfo): self
  341.     {
  342.         $this->medicalInfo $medicalInfo;
  343.         return $this;
  344.     }
  345.     public function getHabitsInfo(): ?string
  346.     {
  347.         return $this->habitsInfo;
  348.     }
  349.     public function setHabitsInfo(?string $habitsInfo): self
  350.     {
  351.         $this->habitsInfo $habitsInfo;
  352.         return $this;
  353.     }
  354.     public function getFitnessInfo(): ?string
  355.     {
  356.         return $this->fitnessInfo;
  357.     }
  358.     public function setFitnessInfo(?string $fitnessInfo): self
  359.     {
  360.         $this->fitnessInfo $fitnessInfo;
  361.         return $this;
  362.     }
  363.     public function getExercisePreferences(): ?string
  364.     {
  365.         return $this->exercisePreferences;
  366.     }
  367.     public function setExercisePreferences(?string $exercisePreferences): self
  368.     {
  369.         $this->exercisePreferences $exercisePreferences;
  370.         return $this;
  371.     }
  372.     
  373.     public function getSolvedExercises(): ?string
  374.     {
  375.         return $this->solvedExercises;
  376.     }
  377.     public function setSolvedExercises(?string $solvedExercises): self
  378.     {
  379.         $this->solvedExercises $solvedExercises;
  380.         return $this;
  381.     }
  382.     public function getChatbotConfiguration(): ?string
  383.     {
  384.         return $this->chatbotConfiguration;
  385.     }
  386.     public function setChatbotConfiguration(?string $chatbotConfiguration): self
  387.     {
  388.         $this->chatbotConfiguration $chatbotConfiguration;
  389.         return $this;
  390.     }
  391. }