<?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\PatientLetterAliceNightOneRepository")
 * @ORM\Table(name="patient_letter_alice_night_one")
 */

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

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

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

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

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

    /**
     * @ORM\Column(name="cpap_therapy_one", type="text", nullable=true)
     * @Groups("forAudit")
     */
    protected $cpapTheraphyOne;

    /**
     * @ORM\Column(name="cpap_therapy_two", type="text", nullable=true)
     * @Groups("forAudit")
     */
    protected $cpapTheraphyTwo;

    /**
     * @ORM\Column(name="cpap_therapy_three", type="text", nullable=true)
     * @Groups("forAudit")
     */
    protected $cpapTheraphyThree;

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

    /**
     * @ORM\ManyToOne(targetEntity="PatientLetterEntity", inversedBy="patientLetterAliceNightOnes")
     * @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 dateOfStudyAsString
     *
     * @return string
     */
    public function getDateOfStudyAsString()
    {

        $dttst = new DateTimeToStringTransformer();

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

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


    /**
     * Set interpretingPhysician
     *
     * @param string $interpretingPhysician
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setInterpretingPhysician($interpretingPhysician)
    {
        $this->interpretingPhysician = $interpretingPhysician;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set recommendation
     *
     * @param string $recommendation
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setRecommendation($recommendation)
    {
        $this->recommendation = $recommendation;

        return $this;
    }

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

    /**
     * Set ahi
     *
     * @param string $ahi
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setAhi($ahi)
    {
        $this->ahi = $ahi;

        return $this;
    }

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

    /**
     * Set osa
     *
     * @param string $osa
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setOsa($osa)
    {
        $this->osa = $osa;

        return $this;
    }

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

    /**
     * Set cpapTheraphyOne
     *
     * @param string $cpapTheraphyOne
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setCpapTheraphyOne($cpapTheraphyOne)
    {
        $this->cpapTheraphyOne = $cpapTheraphyOne;

        return $this;
    }

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

    /**
     * Set cpapTheraphyTwo
     *
     * @param string $cpapTheraphyTwo
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setCpapTheraphyTwo($cpapTheraphyTwo)
    {
        $this->cpapTheraphyTwo = $cpapTheraphyTwo;

        return $this;
    }

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

    /**
     * Set cpapTheraphyThree
     *
     * @param string $cpapTheraphyThree
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setCpapTheraphyThree($cpapTheraphyThree)
    {
        $this->cpapTheraphyThree = $cpapTheraphyThree;

        return $this;
    }

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

    /**
     * Set isReferralToSleepSpecialist
     *
     * @param boolean $isReferralToSleepSpecialist
     *
     * @return PatientLetterAliceNightOneEntity
     */
    public function setIsReferralToSleepSpecialist($isReferralToSleepSpecialist)
    {
        $this->isReferralToSleepSpecialist = $isReferralToSleepSpecialist;

        return $this;
    }

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

    /**
     * Set patientLetter
     *
     * @param \RxConnexionBundle\Entity\PatientLetterEntity $patientLetter
     *
     * @return PatientLetterAliceNightOneEntity
     */
    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;
    }
}
