<?php

namespace RxConnexionBundle\Entity;

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

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\PatientChartTypeMethodRepository")
 * @ORM\Table(name="patient_chart_type_method")
 */

class PatientChartTypeMethodEntity extends BaseEntity
{
    /**
     * @ORM\Column(name="is_deleted", type="boolean")
     */
    protected $isDeleted;

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

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

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

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

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

    /**
     * @ORM\Column(name="average_cpap_usage", type="decimal", precision=12, scale=2, nullable=true)
     * @Groups("forAudit")
     */
    protected $averageCPAPUsage;

    /**
     * @ORM\Column(name="mask_leak", type="decimal", precision=12, scale=2, nullable=true)
     * @Groups("forAudit")
     */
    protected $maskLeak;

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

    /**
     * @ORM\Column(name="neck_size", type="decimal", precision=12, scale=2, nullable=true)
     * @Groups("forAudit")
     */
    protected $neckSize;

    /**
     * @ORM\Column(name="ess", type="decimal", precision=12, scale=2, nullable=true)
     * @Groups("forAudit")
     */
    protected $ess;

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

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

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

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

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

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

    /**
     * @ORM\ManyToOne(targetEntity="PatientChartEntity", inversedBy="chartTypeMethods")
     * @ORM\JoinColumn(name="patient_chart_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $patientChart;

    /**
     * @ORM\ManyToOne(targetEntity="ChartTypeMethodEntity", inversedBy="patientChartTypeMethods")
     * @ORM\JoinColumn(name="chart_type_method_id", referencedColumnName="id")
     * @Groups("forAudit")
     * @MaxDepth(1)
     */
    protected $chartTypeMethod;

    /**
     * Set createdAt
     *
     * @ORM\PrePersist
     */
    public function setCreatedAtValue()
    {
        parent::setCreatedAtValue();
        $this->isDeleted = 0;
    }

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Use Defined Setters and Getters														  */
    /*--------------------------------------------------------------------------------------------------------*/
    /**
     * Get lastDeviceReplacedAsString
     *
     * @return string
     */
    public function getLastDeviceReplacedAsString() {

        $dttst = new DateTimeToStringTransformer();
        return !empty($this->lastDeviceReplaced) ? date('m/d/Y', strtotime($dttst->transform($this->lastDeviceReplaced))) : '';
    }
    /*--------------------------------------------------------------------------------------------------------*/
    /*					Setters and Getters																	  */
    /*--------------------------------------------------------------------------------------------------------*/


    /**
     * Set note
     *
     * @param string $note
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setNote($note)
    {
        $this->note = $note;

        return $this;
    }

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

    /**
     * Set patientChart
     *
     * @param \RxConnexionBundle\Entity\PatientChartEntity $patientChart
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setPatientChart(\RxConnexionBundle\Entity\PatientChartEntity $patientChart = null)
    {
        $this->patientChart = $patientChart;

        return $this;
    }

    /**
     * Get patientChart
     *
     * @return \RxConnexionBundle\Entity\PatientChartEntity
     */
    public function getPatientChart()
    {
        return $this->patientChart;
    }

    /**
     * Set chartTypeMethod
     *
     * @param \RxConnexionBundle\Entity\ChartTypeMethodEntity $chartTypeMethod
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setChartTypeMethod(\RxConnexionBundle\Entity\ChartTypeMethodEntity $chartTypeMethod = null)
    {
        $this->chartTypeMethod = $chartTypeMethod;

        return $this;
    }

    /**
     * Get chartTypeMethod
     *
     * @return \RxConnexionBundle\Entity\ChartTypeMethodEntity
     */
    public function getChartTypeMethod()
    {
        return $this->chartTypeMethod;
    }

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set createdBy
     *
     * @param string $createdBy
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setCreatedBy($createdBy)
    {
        $this->createdBy = $createdBy;

        return $this;
    }

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

    /**
     * Set createdAt
     *
     * @param \DateTime $createdAt
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setCreatedAt($createdAt)
    {
        $this->createdAt = $createdAt;

        return $this;
    }

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

    /**
     * Set updatedBy
     *
     * @param string $updatedBy
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setUpdatedBy($updatedBy)
    {
        $this->updatedBy = $updatedBy;

        return $this;
    }

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

    /**
     * Set updatedAt
     *
     * @param \DateTime $updatedAt
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

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

    /**
     * Set pressureRangeFrom
     *
     * @param string $pressureRangeFrom
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setPressureRangeFrom($pressureRangeFrom)
    {
        $this->pressureRangeFrom = $pressureRangeFrom;

        return $this;
    }

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

    /**
     * Set pressureRangeTo
     *
     * @param string $pressureRangeTo
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setPressureRangeTo($pressureRangeTo)
    {
        $this->pressureRangeTo = $pressureRangeTo;

        return $this;
    }

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

    /**
     * Set currentAHI
     *
     * @param string $currentAHI
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setCurrentAHI($currentAHI)
    {
        $this->currentAHI = $currentAHI;

        return $this;
    }

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

    /**
     * Set averageCPAPUsage
     *
     * @param string $averageCPAPUsage
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setAverageCPAPUsage($averageCPAPUsage)
    {
        $this->averageCPAPUsage = $averageCPAPUsage;

        return $this;
    }

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

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

        return $this;
    }

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

    /**
     * Set maskLeak
     *
     * @param string $maskLeak
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setMaskLeak($maskLeak)
    {
        $this->maskLeak = $maskLeak;

        return $this;
    }

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

    /**
     * Set currentRDI
     *
     * @param string $currentRDI
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setCurrentRDI($currentRDI)
    {
        $this->currentRDI = $currentRDI;

        return $this;
    }

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

    /**
     * Set neckSize
     *
     * @param string $neckSize
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setNeckSize($neckSize)
    {
        $this->neckSize = $neckSize;

        return $this;
    }

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

    /**
     * Set ess
     *
     * @param string $ess
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setEss($ess)
    {
        $this->ess = $ess;

        return $this;
    }

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

    /**
     * Set isDeleted
     *
     * @param boolean $isDeleted
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setIsDeleted($isDeleted)
    {
        $this->isDeleted = $isDeleted;

        return $this;
    }

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

    /**
     * Set initialBerlinQuestionnaireScore
     *
     * @param string $initialBerlinQuestionnaireScore
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setInitialBerlinQuestionnaireScore($initialBerlinQuestionnaireScore)
    {
        $this->initialBerlinQuestionnaireScore = $initialBerlinQuestionnaireScore;

        return $this;
    }

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

    /**
     * Set initialEpworthSleepnessScale
     *
     * @param string $initialEpworthSleepnessScale
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setInitialEpworthSleepnessScale($initialEpworthSleepnessScale)
    {
        $this->initialEpworthSleepnessScale = $initialEpworthSleepnessScale;

        return $this;
    }

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

    /**
     * Set initialAhi
     *
     * @param string $initialAhi
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setInitialAhi($initialAhi)
    {
        $this->initialAhi = $initialAhi;

        return $this;
    }

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

    /**
     * Set initialRdi
     *
     * @param string $initialRdi
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setInitialRdi($initialRdi)
    {
        $this->initialRdi = $initialRdi;

        return $this;
    }

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

    /**
     * Set timeNinetyPercentSpoTwo
     *
     * @param string $timeNinetyPercentSpoTwo
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setTimeNinetyPercentSpoTwo($timeNinetyPercentSpoTwo)
    {
        $this->timeNinetyPercentSpoTwo = $timeNinetyPercentSpoTwo;

        return $this;
    }

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

    /**
     * Set initialMeanSpoTwo
     *
     * @param string $initialMeanSpoTwo
     *
     * @return PatientChartTypeMethodEntity
     */
    public function setInitialMeanSpoTwo($initialMeanSpoTwo)
    {
        $this->initialMeanSpoTwo = $initialMeanSpoTwo;

        return $this;
    }

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