<?php
namespace App\Entity;
use App\Repository\PlanoCabeceraRepository;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\ORM\Mapping as ORM;
use DateTime;
/**
* @ORM\Entity(repositoryClass=PlanoCabeceraRepository::class)
* @ORM\HasLifecycleCallbacks
*/
class PlanoCabecera
{
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* @ORM\Column(type="string", length=20)
*/
private $nombre_plano;
/**
* @ORM\Column(type="string", length=100)
*/
private $nombre_pantilla;
/**
* @ORM\Column(type="boolean")
*/
private $estado;
/**
* @ORM\ManyToOne(targetEntity=Paciente::class, inversedBy="planoCabeceras")
* @ORM\JoinColumn(nullable=false)
*/
private $paciente;
/**
* @ORM\Column(type="string", length=13, nullable=true)
*/
private $cedula_afiliado;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $nombre_afiliado;
/**
* @ORM\Column(type="string", length=100, nullable=true)
*/
private $parentesco;
/**
* @ORM\Column(type="datetime")
*/
private $created_at;
/**
* @ORM\Column(type="datetime")
*/
private $updated_at;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $apellido_afiliado;
/**
* @ORM\Column(type="date")
*/
private $ingreso;
/**
* @ORM\Column(type="date")
*/
private $alta;
/**
* @ORM\ManyToOne(targetEntity=TipoSeguro::class, inversedBy="planoCabeceras")
* @ORM\JoinColumn(nullable=false)
*/
private $tiposeguro;
/**
* @ORM\Column(type="string", length=25, nullable=true)
*/
private $cobertura_compartida;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $presuntivo_definitivo;
/**
* @ORM\ManyToOne(targetEntity=SeguroPrivado::class, inversedBy="planoCabeceras")
* @ORM\JoinColumn(nullable=true)
*/
private $seguroprivado;
/**
* @ORM\ManyToOne(targetEntity=Empresa::class, inversedBy="planoCabeceras")
* @ORM\JoinColumn(nullable=false)
*/
private $empresa;
/**
* @ORM\ManyToOne(targetEntity=Dependencia::class, inversedBy="planoCabeceras")
* @ORM\JoinColumn(nullable=false)
*/
private $dependencia;
/**
* @ORM\ManyToOne(targetEntity=Derivacion::class, inversedBy="planoCabeceras")
* @ORM\JoinColumn(nullable=false)
*/
private $derivacion;
/**
* @ORM\OneToMany(targetEntity=PlanoDetalle::class, mappedBy="planocabecera")
*/
private $planoDetalles;
/**
* @ORM\Column(type="string", length=10)
*/
private $iess_msp;
/**
* @ORM\Column(type="string", length=10)
*/
private $cie10;
/**
* @ORM\Column(type="string", length=255)
*/
private $cie10_txt;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $cie10_2;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cie10_txt_2;
/**
* @ORM\Column(type="string", length=10, nullable=true)
*/
private $cie10_3;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $cie10_txt_3;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $pres_def_2;
/**
* @ORM\Column(type="string", length=50, nullable=true)
*/
private $pres_def_3;
/**
* @ORM\Column(type="string", length=50)
*/
private $tipo_consulta;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_crea;
/**
* @ORM\Column(type="string", length=50)
*/
private $ip_modifica;
/**
* @ORM\Column(type="integer")
*/
private $user_crea;
/**
* @ORM\Column(type="integer")
*/
private $user_modifica;
/**
* @ORM\ManyToOne(targetEntity=User::class, inversedBy="planoCabeceras")
*/
private $doctor;
/**
* @ORM\ManyToOne(targetEntity=HistoriaClinica::class, inversedBy="planoCabeceras")
*/
private $historia;
public function __construct()
{
$this->planoDetalles = new ArrayCollection();
$this->ingreso = new \DateTime();
$this->alta = new \DateTime();
}
public function getId(): ?int
{
return $this->id;
}
public function getNombrePlano(): ?string
{
return $this->nombre_plano;
}
public function setNombrePlano(string $nombre_plano): self
{
$this->nombre_plano = $nombre_plano;
return $this;
}
public function getNombrePantilla(): ?string
{
return $this->nombre_pantilla;
}
public function setNombrePantilla(string $nombre_pantilla): self
{
$this->nombre_pantilla = $nombre_pantilla;
return $this;
}
public function getEstado(): ?bool
{
return $this->estado;
}
public function setEstado(bool $estado): self
{
$this->estado = $estado;
return $this;
}
public function getPaciente(): ?Paciente
{
return $this->paciente;
}
public function setPaciente(?Paciente $paciente): self
{
$this->paciente = $paciente;
return $this;
}
public function getCreatedAt(): ?\DateTimeInterface
{
return $this->created_at;
}
public function setCreatedAt(\DateTimeInterface $created_at): self
{
$this->created_at = $created_at;
return $this;
}
public function getUpdatedAt(): ?\DateTimeInterface
{
return $this->updated_at;
}
public function setUpdatedAt(\DateTimeInterface $updated_at): self
{
$this->updated_at = $updated_at;
return $this;
}
/**
* @ORM\PrePersist
* @ORM\PreUpdate
*/
public function updatedTimestamps(): void
{
$dateTimeNow = new DateTime('now');
$this->setUpdatedAt($dateTimeNow);
if ($this->getCreatedAt() === null) {
$this->setCreatedAt($dateTimeNow);
}
}
public function getCedulaAfiliado(): ?string
{
return $this->cedula_afiliado;
}
public function setCedulaAfiliado(?string $cedula_afiliado): self
{
$this->cedula_afiliado = $cedula_afiliado;
return $this;
}
public function getNombreAfiliado(): ?string
{
return $this->nombre_afiliado;
}
public function setNombreAfiliado(?string $nombre_afiliado): self
{
$this->nombre_afiliado = $nombre_afiliado;
return $this;
}
public function getParentesco(): ?string
{
return $this->parentesco;
}
public function setParentesco(?string $parentesco): self
{
$this->parentesco = $parentesco;
return $this;
}
public function getApellidoAfiliado(): ?string
{
return $this->apellido_afiliado;
}
public function setApellidoAfiliado(?string $apellido_afiliado): self
{
$this->apellido_afiliado = $apellido_afiliado;
return $this;
}
public function getIngreso(): ?\DateTimeInterface
{
return $this->ingreso;
}
public function setIngreso(\DateTimeInterface $ingreso): self
{
$this->ingreso = $ingreso;
return $this;
}
public function getAlta(): ?\DateTimeInterface
{
return $this->alta;
}
public function setAlta(\DateTimeInterface $alta): self
{
$this->alta = $alta;
return $this;
}
public function getTiposeguro(): ?TipoSeguro
{
return $this->tiposeguro;
}
public function setTiposeguro(?TipoSeguro $tiposeguro): self
{
$this->tiposeguro = $tiposeguro;
return $this;
}
public function getCoberturaCompartida(): ?string
{
return $this->cobertura_compartida;
}
public function setCoberturaCompartida(?string $cobertura_compartida): self
{
$this->cobertura_compartida = $cobertura_compartida;
return $this;
}
public function getPresuntivoDefinitivo(): ?string
{
return $this->presuntivo_definitivo;
}
public function setPresuntivoDefinitivo(?string $presuntivo_definitivo): self
{
$this->presuntivo_definitivo = $presuntivo_definitivo;
return $this;
}
public function getSeguroprivado(): ?SeguroPrivado
{
return $this->seguroprivado;
}
public function setSeguroprivado(?SeguroPrivado $seguroprivado): self
{
$this->seguroprivado = $seguroprivado;
return $this;
}
public function getEmpresa(): ?Empresa
{
return $this->empresa;
}
public function setEmpresa(?Empresa $empresa): self
{
$this->empresa = $empresa;
return $this;
}
public function getDependencia(): ?Dependencia
{
return $this->dependencia;
}
public function setDependencia(?Dependencia $dependencia): self
{
$this->dependencia = $dependencia;
return $this;
}
public function getDerivacion(): ?Derivacion
{
return $this->derivacion;
}
public function setDerivacion(?Derivacion $derivacion): self
{
$this->derivacion = $derivacion;
return $this;
}
/**
* @return Collection|PlanoDetalle[]
*/
public function getPlanoDetalles(): Collection
{
return $this->planoDetalles;
}
public function getPlanoDetalles_iva()
{
$criteria = Criteria::create()
->andWhere(Criteria::expr()->eq('iva', 0.12))
;
return $this->planoDetalles->matching($criteria);
}
public function addPlanoDetalle(PlanoDetalle $planoDetalle): self
{
if (!$this->planoDetalles->contains($planoDetalle)) {
$this->planoDetalles[] = $planoDetalle;
$planoDetalle->setPlanocabecera($this);
}
return $this;
}
public function removePlanoDetalle(PlanoDetalle $planoDetalle): self
{
if ($this->planoDetalles->contains($planoDetalle)) {
$this->planoDetalles->removeElement($planoDetalle);
// set the owning side to null (unless already changed)
if ($planoDetalle->getPlanocabecera() === $this) {
$planoDetalle->setPlanocabecera(null);
}
}
return $this;
}
public function getIessMsp(): ?string
{
return $this->iess_msp;
}
public function setIessMsp(string $iess_msp): self
{
$this->iess_msp = $iess_msp;
return $this;
}
public function getCie10(): ?string
{
return $this->cie10;
}
public function setCie10(string $cie10): self
{
$this->cie10 = $cie10;
return $this;
}
public function getCie10Txt(): ?string
{
return $this->cie10_txt;
}
public function setCie10Txt(string $cie10_txt): self
{
$this->cie10_txt = $cie10_txt;
return $this;
}
public function getCie102(): ?string
{
return $this->cie10_2;
}
public function setCie102(?string $cie10_2): self
{
$this->cie10_2 = $cie10_2;
return $this;
}
public function getCie10Txt2(): ?string
{
return $this->cie10_txt_2;
}
public function setCie10Txt2(?string $cie10_txt_2): self
{
$this->cie10_txt_2 = $cie10_txt_2;
return $this;
}
public function getCie103(): ?string
{
return $this->cie10_3;
}
public function setCie103(?string $cie10_3): self
{
$this->cie10_3 = $cie10_3;
return $this;
}
public function getCie10Txt3(): ?string
{
return $this->cie10_txt_3;
}
public function setCie10Txt3(?string $cie10_txt_3): self
{
$this->cie10_txt_3 = $cie10_txt_3;
return $this;
}
public function getPresDef2(): ?string
{
return $this->pres_def_2;
}
public function setPresDef2(?string $pres_def_2): self
{
$this->pres_def_2 = $pres_def_2;
return $this;
}
public function getPresDef3(): ?string
{
return $this->pres_def_3;
}
public function setPresDef3(?string $pres_def_3): self
{
$this->pres_def_3 = $pres_def_3;
return $this;
}
public function getTipoConsulta(): ?string
{
return $this->tipo_consulta;
}
public function setTipoConsulta(string $tipo_consulta): self
{
$this->tipo_consulta = $tipo_consulta;
return $this;
}
public function getIpCrea(): ?string
{
return $this->ip_crea;
}
public function setIpCrea(string $ip_crea): self
{
$this->ip_crea = $ip_crea;
return $this;
}
public function getIpModifica(): ?string
{
return $this->ip_modifica;
}
public function setIpModifica(string $ip_modifica): self
{
$this->ip_modifica = $ip_modifica;
return $this;
}
public function getUserCrea(): ?int
{
return $this->user_crea;
}
public function setUserCrea(int $user_crea): self
{
$this->user_crea = $user_crea;
return $this;
}
public function getUserModifica(): ?int
{
return $this->user_modifica;
}
public function setUserModifica(int $user_modifica): self
{
$this->user_modifica = $user_modifica;
return $this;
}
public function getDoctor(): ?User
{
return $this->doctor;
}
public function setDoctor(?User $doctor): self
{
$this->doctor = $doctor;
return $this;
}
public function getHistoria(): ?HistoriaClinica
{
return $this->historia;
}
public function setHistoria(?HistoriaClinica $historia): self
{
$this->historia = $historia;
return $this;
}
}