src/Entity/Epicrisis.php line 16

Open in your IDE?
  1. <?php
  2. namespace App\Entity;
  3. use App\Repository\EpicrisisRepository;
  4. use Doctrine\Common\Collections\ArrayCollection;
  5. use Doctrine\Common\Collections\Collection;
  6. use Doctrine\Common\Collections\Criteria;
  7. use Doctrine\ORM\Mapping as ORM;
  8. use DateTime;
  9. /**
  10.  * @ORM\Entity(repositoryClass=EpicrisisRepository::class)
  11.  * @ORM\HasLifecycleCallbacks
  12.  */
  13. class Epicrisis
  14. {
  15.     /**
  16.      * @ORM\Id
  17.      * @ORM\GeneratedValue
  18.      * @ORM\Column(type="integer")
  19.      */
  20.     private $id;
  21.     /**
  22.      * @ORM\ManyToOne(targetEntity=HistoriaClinica::class, inversedBy="epicrises")
  23.      * @ORM\JoinColumn(nullable=false)
  24.      */
  25.     private $historia;
  26.     /**
  27.      * @ORM\Column(type="text", nullable=true)
  28.      */
  29.     private $cuadro_clinico;
  30.     /**
  31.      * @ORM\Column(type="text", nullable=true)
  32.      */
  33.     private $evolucion_complicaciones;
  34.     /**
  35.      * @ORM\Column(type="text", nullable=true)
  36.      */
  37.     private $hallazgos;
  38.     /**
  39.      * @ORM\Column(type="text", nullable=true)
  40.      */
  41.     private $tratamiento;
  42.     /**
  43.      * @ORM\Column(type="text", nullable=true)
  44.      */
  45.     private $egreso;
  46.     /**
  47.      * @ORM\ManyToOne(targetEntity=User::class, inversedBy="epicrises")
  48.      */
  49.     private $doctor;
  50.     /**
  51.      * @ORM\Column(type="datetime", nullable=true)
  52.      */
  53.     private $fecha;
  54.     /**
  55.      * @ORM\Column(type="boolean", nullable=true)
  56.      */
  57.     private $alta_definitiva;
  58.     /**
  59.      * @ORM\Column(type="boolean", nullable=true)
  60.      */
  61.     private $alta_transitoria;
  62.     /**
  63.      * @ORM\Column(type="boolean", nullable=true)
  64.      */
  65.     private $asistomatico;
  66.     /**
  67.      * @ORM\Column(type="boolean", nullable=true)
  68.      */
  69.     private $discapacidad_leve;
  70.     /**
  71.      * @ORM\Column(type="boolean", nullable=true)
  72.      */
  73.     private $discapacidad_moderada;
  74.     /**
  75.      * @ORM\Column(type="boolean", nullable=true)
  76.      */
  77.     private $discapacidad_grave;
  78.     /**
  79.      * @ORM\Column(type="boolean", nullable=true)
  80.      */
  81.     private $retiro_voluntario;
  82.     /**
  83.      * @ORM\Column(type="boolean", nullable=true)
  84.      */
  85.     private $retiro_involuntario;
  86.     /**
  87.      * @ORM\Column(type="boolean", nullable=true)
  88.      */
  89.     private $defuncion_antes_48h;
  90.     /**
  91.      * @ORM\Column(type="boolean", nullable=true)
  92.      */
  93.     private $defuncion_despues_48h;
  94.     /**
  95.      * @ORM\Column(type="string", length=50, nullable=true)
  96.      */
  97.     private $dias_estadia;
  98.     /**
  99.      * @ORM\Column(type="string", length=50, nullable=true)
  100.      */
  101.     private $dias_incapacidad;
  102.     /**
  103.      * @ORM\Column(type="boolean", nullable=true)
  104.      */
  105.     private $estado;
  106.     /**
  107.      * @ORM\Column(type="string", length=50)
  108.      */
  109.     private $ip_crea;
  110.     /**
  111.      * @ORM\Column(type="string", length=50)
  112.      */
  113.     private $ip_modifica;
  114.     /**
  115.      * @ORM\Column(type="integer")
  116.      */
  117.     private $user_crea;
  118.     /**
  119.      * @ORM\Column(type="integer")
  120.      */
  121.     private $user_modifica;
  122.     /**
  123.      * @ORM\Column(type="datetime")
  124.      */
  125.     private $created_at;
  126.     /**
  127.      * @ORM\Column(type="datetime")
  128.      */
  129.     private $updated_at;
  130.     /**
  131.      * @ORM\OneToMany(targetEntity=DiagnosticosEpicrisis::class, mappedBy="epicrisis")
  132.      */
  133.     private $diagnosticosEpicrises;
  134.     /**
  135.      * @ORM\ManyToOne(targetEntity=Estudio::class, inversedBy="epicrises")
  136.      */
  137.     private $estudio;
  138.     public function __construct()
  139.     {
  140.         $this->diagnosticosEpicrises = new ArrayCollection();
  141.     }
  142.     public function getId(): ?int
  143.     {
  144.         return $this->id;
  145.     }
  146.     public function getHistoria(): ?HistoriaClinica
  147.     {
  148.         return $this->historia;
  149.     }
  150.     public function setHistoria(?HistoriaClinica $historia): self
  151.     {
  152.         $this->historia $historia;
  153.         return $this;
  154.     }
  155.     public function getCuadroClinico(): ?string
  156.     {
  157.         return $this->cuadro_clinico;
  158.     }
  159.     public function setCuadroClinico(?string $cuadro_clinico): self
  160.     {
  161.         $this->cuadro_clinico $cuadro_clinico;
  162.         return $this;
  163.     }
  164.     public function getEvolucionComplicaciones(): ?string
  165.     {
  166.         return $this->evolucion_complicaciones;
  167.     }
  168.     public function setEvolucionComplicaciones(?string $evolucion_complicaciones): self
  169.     {
  170.         $this->evolucion_complicaciones $evolucion_complicaciones;
  171.         return $this;
  172.     }
  173.     public function getHallazgos(): ?string
  174.     {
  175.         return $this->hallazgos;
  176.     }
  177.     public function setHallazgos(?string $hallazgos): self
  178.     {
  179.         $this->hallazgos $hallazgos;
  180.         return $this;
  181.     }
  182.     public function getTratamiento(): ?string
  183.     {
  184.         return $this->tratamiento;
  185.     }
  186.     public function setTratamiento(?string $tratamiento): self
  187.     {
  188.         $this->tratamiento $tratamiento;
  189.         return $this;
  190.     }
  191.     public function getEgreso(): ?string
  192.     {
  193.         return $this->egreso;
  194.     }
  195.     public function setEgreso(?string $egreso): self
  196.     {
  197.         $this->egreso $egreso;
  198.         return $this;
  199.     }
  200.     public function getDoctor(): ?User
  201.     {
  202.         return $this->doctor;
  203.     }
  204.     public function setDoctor(?User $doctor): self
  205.     {
  206.         $this->doctor $doctor;
  207.         return $this;
  208.     }
  209.     public function getFecha(): ?\DateTimeInterface
  210.     {
  211.         return $this->fecha;
  212.     }
  213.     public function setFecha(?\DateTimeInterface $fecha): self
  214.     {
  215.         $this->fecha $fecha;
  216.         return $this;
  217.     }
  218.     public function getAltaDefinitiva(): ?bool
  219.     {
  220.         return $this->alta_definitiva;
  221.     }
  222.     public function setAltaDefinitiva(?bool $alta_definitiva): self
  223.     {
  224.         $this->alta_definitiva $alta_definitiva;
  225.         return $this;
  226.     }
  227.     public function getAltaTransitoria(): ?bool
  228.     {
  229.         return $this->alta_transitoria;
  230.     }
  231.     public function setAltaTransitoria(?bool $alta_transitoria): self
  232.     {
  233.         $this->alta_transitoria $alta_transitoria;
  234.         return $this;
  235.     }
  236.     public function getAsistomatico(): ?bool
  237.     {
  238.         return $this->asistomatico;
  239.     }
  240.     public function setAsistomatico(?bool $asistomatico): self
  241.     {
  242.         $this->asistomatico $asistomatico;
  243.         return $this;
  244.     }
  245.     public function getDiscapacidadLeve(): ?bool
  246.     {
  247.         return $this->discapacidad_leve;
  248.     }
  249.     public function setDiscapacidadLeve(?bool $discapacidad_leve): self
  250.     {
  251.         $this->discapacidad_leve $discapacidad_leve;
  252.         return $this;
  253.     }
  254.     public function getDiscapacidadModerada(): ?bool
  255.     {
  256.         return $this->discapacidad_moderada;
  257.     }
  258.     public function setDiscapacidadModerada(?bool $discapacidad_moderada): self
  259.     {
  260.         $this->discapacidad_moderada $discapacidad_moderada;
  261.         return $this;
  262.     }
  263.     public function getDiscapacidadGrave(): ?bool
  264.     {
  265.         return $this->discapacidad_grave;
  266.     }
  267.     public function setDiscapacidadGrave(?bool $discapacidad_grave): self
  268.     {
  269.         $this->discapacidad_grave $discapacidad_grave;
  270.         return $this;
  271.     }
  272.     public function getRetiroVoluntario(): ?bool
  273.     {
  274.         return $this->retiro_voluntario;
  275.     }
  276.     public function setRetiroVoluntario(?bool $retiro_voluntario): self
  277.     {
  278.         $this->retiro_voluntario $retiro_voluntario;
  279.         return $this;
  280.     }
  281.     public function getRetiroInvoluntario(): ?bool
  282.     {
  283.         return $this->retiro_involuntario;
  284.     }
  285.     public function setRetiroInvoluntario(?bool $retiro_involuntario): self
  286.     {
  287.         $this->retiro_involuntario $retiro_involuntario;
  288.         return $this;
  289.     }
  290.     public function getDefuncionAntes48h(): ?bool
  291.     {
  292.         return $this->defuncion_antes_48h;
  293.     }
  294.     public function setDefuncionAntes48h(?bool $defuncion_antes_48h): self
  295.     {
  296.         $this->defuncion_antes_48h $defuncion_antes_48h;
  297.         return $this;
  298.     }
  299.     public function getDefuncionDespues48h(): ?bool
  300.     {
  301.         return $this->defuncion_despues_48h;
  302.     }
  303.     public function setDefuncionDespues48h(?bool $defuncion_despues_48h): self
  304.     {
  305.         $this->defuncion_despues_48h $defuncion_despues_48h;
  306.         return $this;
  307.     }
  308.     public function getDiasEstadia(): ?string
  309.     {
  310.         return $this->dias_estadia;
  311.     }
  312.     public function setDiasEstadia(?string $dias_estadia): self
  313.     {
  314.         $this->dias_estadia $dias_estadia;
  315.         return $this;
  316.     }
  317.     public function getDiasIncapacidad(): ?string
  318.     {
  319.         return $this->dias_incapacidad;
  320.     }
  321.     public function setDiasIncapacidad(?string $dias_incapacidad): self
  322.     {
  323.         $this->dias_incapacidad $dias_incapacidad;
  324.         return $this;
  325.     }
  326.     public function getEstado(): ?bool
  327.     {
  328.         return $this->estado;
  329.     }
  330.     public function setEstado(?bool $estado): self
  331.     {
  332.         $this->estado $estado;
  333.         return $this;
  334.     }
  335.     public function getIpCrea(): ?string
  336.     {
  337.         return $this->ip_crea;
  338.     }
  339.     public function setIpCrea(string $ip_crea): self
  340.     {
  341.         $this->ip_crea $ip_crea;
  342.         return $this;
  343.     }
  344.     public function getIpModifica(): ?string
  345.     {
  346.         return $this->ip_modifica;
  347.     }
  348.     public function setIpModifica(string $ip_modifica): self
  349.     {
  350.         $this->ip_modifica $ip_modifica;
  351.         return $this;
  352.     }
  353.     public function getUserCrea(): ?int
  354.     {
  355.         return $this->user_crea;
  356.     }
  357.     public function setUserCrea(int $user_crea): self
  358.     {
  359.         $this->user_crea $user_crea;
  360.         return $this;
  361.     }
  362.     public function getUserModifica(): ?int
  363.     {
  364.         return $this->user_modifica;
  365.     }
  366.     public function setUserModifica(int $user_modifica): self
  367.     {
  368.         $this->user_modifica $user_modifica;
  369.         return $this;
  370.     }
  371.     public function getCreatedAt(): ?\DateTimeInterface
  372.     {
  373.         return $this->created_at;
  374.     }
  375.     public function setCreatedAt(\DateTimeInterface $created_at): self
  376.     {
  377.         $this->created_at $created_at;
  378.         return $this;
  379.     }
  380.     public function getUpdatedAt(): ?\DateTimeInterface
  381.     {
  382.         return $this->updated_at;
  383.     }
  384.     public function setUpdatedAt(\DateTimeInterface $updated_at): self
  385.     {
  386.         $this->updated_at $updated_at;
  387.         return $this;
  388.     }
  389.     /**
  390.      * @ORM\PrePersist
  391.      * @ORM\PreUpdate
  392.      */
  393.     public function updatedTimestamps(): void
  394.     {
  395.         $dateTimeNow = new DateTime('now');
  396.         $this->setUpdatedAt($dateTimeNow);
  397.         if ($this->getCreatedAt() === null) {
  398.             $this->setCreatedAt($dateTimeNow);
  399.         }
  400.     }
  401.     /**
  402.      * @return Collection|DiagnosticosEpicrisis[]
  403.      */
  404.     public function getDiagnosticosEpicrises(): Collection
  405.     {
  406.         return $this->diagnosticosEpicrises;
  407.     }
  408.     
  409.      public function getDiagnosticosEpicrises2($ingreso): Collection
  410.     {
  411.         $criteria Criteria::create()
  412.             ->andWhere(Criteria::expr()->eq('ingreso_egreso'$ingreso));
  413.         
  414.         return $this->diagnosticosEpicrises->matching($criteria);
  415.     }
  416.     public function addDiagnosticosEpicrisis(DiagnosticosEpicrisis $diagnosticosEpicrisis): self
  417.     {
  418.         if (!$this->diagnosticosEpicrises->contains($diagnosticosEpicrisis)) {
  419.             $this->diagnosticosEpicrises[] = $diagnosticosEpicrisis;
  420.             $diagnosticosEpicrisis->setEpicrisis($this);
  421.         }
  422.         return $this;
  423.     }
  424.     public function removeDiagnosticosEpicrisis(DiagnosticosEpicrisis $diagnosticosEpicrisis): self
  425.     {
  426.         if ($this->diagnosticosEpicrises->removeElement($diagnosticosEpicrisis)) {
  427.             // set the owning side to null (unless already changed)
  428.             if ($diagnosticosEpicrisis->getEpicrisis() === $this) {
  429.                 $diagnosticosEpicrisis->setEpicrisis(null);
  430.             }
  431.         }
  432.         return $this;
  433.     }
  434.     public function getEstudio(): ?Estudio
  435.     {
  436.         return $this->estudio;
  437.     }
  438.     public function setEstudio(?Estudio $estudio): self
  439.     {
  440.         $this->estudio $estudio;
  441.         return $this;
  442.     }
  443. }