<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use RxConnexionBundle\Entity\Base\BaseEntity;
use JMS\Serializer\Annotation\Groups;
use JMS\Serializer\Annotation\MaxDepth;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\PatientLetterCovidScreeningRepository")
 * @ORM\Table(name="patient_letter_covid_screening")
 */

class PatientLetterCovidScreeningEntity extends BaseEntity
{
    /**
     * @ORM\Column(name="screened_by", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $screenedBy;

    /**
     * @ORM\Column(name="completed_date", type="datetime", nullable=true)
     * @Groups("forAudit")
     */
    protected $completedDate;

    /**
     * @ORM\Column(name="is_experiencing_covid", type="boolean", nullable=true)
     * @Groups("forAudit")
     */
    protected $isExperiencingCovid;

    /**
     * @ORM\Column(name="is_close_contact_person", type="boolean", nullable=true)
     * @Groups("forAudit")
     */
    protected $isCloseContactPerson;

    /**
     * @ORM\Column(name="has_scheduled_appointment", type="boolean", nullable=true)
     * @Groups("forAudit")
     */
    protected $hasScheduledAppointment;

    /**
     * @ORM\Column(name="has_travelled", type="boolean", nullable=true)
     * @Groups("forAudit")
     */
    protected $hasTravelled;

    /**
     * @ORM\ManyToOne(targetEntity="PatientLetterEntity", inversedBy="patientLetterQuotations")
     * @ORM\JoinColumn(name="patient_letter_id", referencedColumnName="id")
     */
    protected $patientLetter;


    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        parent::setCreatedAtValue();
    }

    public function __construct()
    {

    }

    /*--------------------------------------------------------------------------------------------------------*/
    /*					User Defined Setters and Getters													  */
    /*--------------------------------------------------------------------------------------------------------*/

    /**
     * get completedDateAsString
     *
     * @return string
     */
    public function getCompletedDateAsString() {

        $dttst = new DateTimeToStringTransformer();

        return !empty($this->completedDate) ? date('m/d/Y', strtotime($dttst->transform($this->completedDate))) : '';
    }

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Setters and Getters																	  */
    /*--------------------------------------------------------------------------------------------------------*/

    /**
     * Set screenedBy
     *
     * @param string $screenedBy
     *
     * @return PatientLetterCovidScreeningEntity
     */
    public function setScreenedBy($screenedBy)
    {
        $this->screenedBy = $screenedBy;

        return $this;
    }

    /**
     * Get screenedBy
     *
     * @return string
     */
    public function getScreenedBy()
    {
        return $this->screenedBy;
    }

    /**
     * Set completedDate
     *
     * @param \DateTime $completedDate
     *
     * @return PatientLetterCovidScreeningEntity
     */
    public function setCompletedDate($completedDate)
    {
        $this->completedDate = empty($completedDate) ? NULL : new \DateTime($completedDate);

        return $this;
    }

    /**
     * Get completedDate
     *
     * @return \DateTime
     */
    public function getCompletedDate()
    {
        return $this->completedDate;
    }

    /**
     * Set isExperiencingCovid
     *
     * @param boolean $isExperiencingCovid
     *
     * @return PatientLetterCovidScreeningEntity
     */
    public function setIsExperiencingCovid($isExperiencingCovid)
    {
        $this->isExperiencingCovid = $isExperiencingCovid;

        return $this;
    }

    /**
     * Get isExperiencingCovid
     *
     * @return boolean
     */
    public function getIsExperiencingCovid()
    {
        return $this->isExperiencingCovid;
    }

    /**
     * Set isCloseContactPerson
     *
     * @param boolean $isCloseContactPerson
     *
     * @return PatientLetterCovidScreeningEntity
     */
    public function setIsCloseContactPerson($isCloseContactPerson)
    {
        $this->isCloseContactPerson = $isCloseContactPerson;

        return $this;
    }

    /**
     * Get isCloseContactPerson
     *
     * @return boolean
     */
    public function getIsCloseContactPerson()
    {
        return $this->isCloseContactPerson;
    }

    /**
     * Set hasScheduledAppointment
     *
     * @param boolean $hasScheduledAppointment
     *
     * @return PatientLetterCovidScreeningEntity
     */
    public function setHasScheduledAppointment($hasScheduledAppointment)
    {
        $this->hasScheduledAppointment = $hasScheduledAppointment;

        return $this;
    }

    /**
     * Get hasScheduledAppointment
     *
     * @return boolean
     */
    public function getHasScheduledAppointment()
    {
        return $this->hasScheduledAppointment;
    }

    /**
     * Set patientLetter
     *
     * @param \RxConnexionBundle\Entity\PatientLetterEntity $patientLetter
     *
     * @return PatientLetterCovidScreeningEntity
     */
    public function setPatientLetter(\RxConnexionBundle\Entity\PatientLetterEntity $patientLetter = null)
    {
        $this->patientLetter = $patientLetter;

        return $this;
    }

    /**
     * Get patientLetter
     *
     * @return \RxConnexionBundle\Entity\PatientLetterEntity
     */
    public function getPatientLetter()
    {
        return $this->patientLetter;
    }

    /**
     * Set hasTravelled
     *
     * @param boolean $hasTravelled
     *
     * @return PatientLetterCovidScreeningEntity
     */
    public function setHasTravelled($hasTravelled)
    {
        $this->hasTravelled = $hasTravelled;

        return $this;
    }

    /**
     * Get hasTravelled
     *
     * @return boolean
     */
    public function getHasTravelled()
    {
        return $this->hasTravelled;
    }
}
