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

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

    /**
     * @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="patientLetterPrescriptionsV2")
     * @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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    public function setRdi($rdi)
    {
        $this->rdi = $rdi;

        return $this;
    }

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

    /**
     * Set osa
     *
     * @param string $osa
     *
     * @return PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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 PatientLetterPrescriptionFRSIv2Entity
     */
    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;
    }
}
