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

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

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

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

    /**
     * @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="rdi", type="string", nullable=true)
     * @Groups("forAudit")
     */
    protected $rdi;

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

    /**
     * @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\Column(name="is_oral_appliance", type="boolean", nullable=true)
     * @Groups("forAudit")
     */
    protected $isOralAppliance;

    /**
     * @ORM\ManyToOne(targetEntity="PatientLetterEntity", inversedBy="patientLetterPrescriptionPsss")
     * @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 interpretationCompletedDoctor
     *
     * @param string $interpretationCompletedDoctor
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    public function setInterpretationCompletedDoctor($interpretationCompletedDoctor)
    {
        $this->interpretationCompletedDoctor = $interpretationCompletedDoctor;

        return $this;
    }

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

    /**
     * Set diagnosis
     *
     * @param string $diagnosis
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    public function setDiagnosis($diagnosis)
    {
        $this->diagnosis = $diagnosis;

        return $this;
    }

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

    /**
     * Set recommendation
     *
     * @param string $recommendation
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    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 PatientLetterPrescriptionPSSEntity
     */
    public function setAhi($ahi)
    {
        $this->ahi = $ahi;

        return $this;
    }

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

    /**
     * Set rdi
     *
     * @param string $rdi
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    public function setRdi($rdi)
    {
        $this->rdi = $rdi;

        return $this;
    }

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

    /**
     * Set isCpapTheraphy
     *
     * @param boolean $isCpapTheraphy
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    public function setIsCpapTheraphy($isCpapTheraphy)
    {
        $this->isCpapTheraphy = $isCpapTheraphy;

        return $this;
    }

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

    /**
     * Set cpapTheraphyOne
     *
     * @param string $cpapTheraphyOne
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    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 PatientLetterPrescriptionPSSEntity
     */
    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 PatientLetterPrescriptionPSSEntity
     */
    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 PatientLetterPrescriptionPSSEntity
     */
    public function setIsReferralToSleepSpecialist($isReferralToSleepSpecialist)
    {
        $this->isReferralToSleepSpecialist = $isReferralToSleepSpecialist;

        return $this;
    }

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

    /**
     * Set isOralAppliance
     *
     * @param boolean $isOralAppliance
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    public function setIsOralAppliance($isOralAppliance)
    {
        $this->isOralAppliance = $isOralAppliance;

        return $this;
    }

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

    /**
     * Set patientLetter
     *
     * @param \RxConnexionBundle\Entity\PatientLetterEntity $patientLetter
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    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 date
     *
     * @param \DateTime $date
     *
     * @return PatientLetterPrescriptionPSSEntity
     */
    public function setDate($date)
    {
        $this->date = empty($date) ? NULL : new \DateTime($date);

        return $this;
    }

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