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

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

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

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

    /**
     * @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="patientLetterPrescriptions")
     * @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->dateOfStudy) ? date('m/d/Y', strtotime($dttst->transform($this->dateOfStudy))) : '';
    }

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


    /**
     * Set interpretationCompletedDoctor
     *
     * @param string $interpretationCompletedDoctor
     *
     * @return PatientLetterGeneralPrescriptionFRSIEntity
     */
    public function setInterpretationCompletedDoctor($interpretationCompletedDoctor)
    {
        $this->interpretationCompletedDoctor = $interpretationCompletedDoctor;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set findingConsistent
     *
     * @param string $findingConsistent
     *
     * @return PatientLetterGeneralPrescriptionFRSIEntity
     */
    public function setFindingConsistent($findingConsistent)
    {
        $this->findingConsistent = $findingConsistent;

        return $this;
    }

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

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