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

class PatientChartOtherProcedureEntity extends BaseEntity
{
    /**
     * @ORM\Column(name="amount", type="decimal", precision=10, scale=2, nullable=true)
     * @Groups("forAudit")
     */
    protected $amount;

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

    /**
     * @ORM\Column(name="is_deleted", type="boolean")
     */
    protected $isDeleted;

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

    /**
     * @ORM\OneToMany(targetEntity="PatientChartPaymentOtherProcedureEntity", mappedBy="patientChartOtherProcedure", cascade={"remove"})
     */
    protected $patientChartPaymentOtherProcedures;

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

    public function __construct()
    {
        $this->patientChartPaymentOtherProcedures = new ArrayCollection();
    }

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Use Defined Setters and Getters														  */
    /*--------------------------------------------------------------------------------------------------------*/

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


    /**
     * Set amount
     *
     * @param string $amount
     *
     * @return PatientChartOtherProcedureEntity
     */
    public function setAmount($amount)
    {
        $this->amount = str_replace(',' ,'',$amount);

        return $this;
    }

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

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

    /**
     * Add patientChartPaymentOtherProcedure
     *
     * @param \RxConnexionBundle\Entity\PatientChartPaymentOtherProcedureEntity $patientChartPaymentOtherProcedure
     *
     * @return PatientChartOtherProcedureEntity
     */
    public function addPatientChartPaymentOtherProcedure(\RxConnexionBundle\Entity\PatientChartPaymentOtherProcedureEntity $patientChartPaymentOtherProcedure)
    {
        $this->patientChartPaymentOtherProcedures[] = $patientChartPaymentOtherProcedure;

        return $this;
    }

    /**
     * Remove patientChartPaymentOtherProcedure
     *
     * @param \RxConnexionBundle\Entity\PatientChartPaymentOtherProcedureEntity $patientChartPaymentOtherProcedure
     */
    public function removePatientChartPaymentOtherProcedure(\RxConnexionBundle\Entity\PatientChartPaymentOtherProcedureEntity $patientChartPaymentOtherProcedure)
    {
        $this->patientChartPaymentOtherProcedures->removeElement($patientChartPaymentOtherProcedure);
    }

    /**
     * Get patientChartPaymentOtherProcedures
     *
     * @return \Doctrine\Common\Collections\Collection
     */
    public function getPatientChartPaymentOtherProcedures()
    {
        return $this->patientChartPaymentOtherProcedures;
    }

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

    /**
     * Set createdBy
     *
     * @param string $createdBy
     *
     * @return PatientChartOtherProcedureEntity
     */
    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 PatientChartOtherProcedureEntity
     */
    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 PatientChartOtherProcedureEntity
     */
    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 PatientChartOtherProcedureEntity
     */
    public function setUpdatedAt($updatedAt)
    {
        $this->updatedAt = $updatedAt;

        return $this;
    }

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

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

        return $this;
    }

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