<?php

namespace RxConnexionBundle\Entity;

use Doctrine\ORM\Mapping as ORM;
use RxConnexionBundle\Entity\Base\BaseEntity;
use Symfony\Component\Form\Extension\Core\DataTransformer\DateTimeToStringTransformer;

/**
 * @ORM\Entity(repositoryClass="RxConnexionBundle\Repository\PatientLetterCcRepository")
 * @ORM\Table(name="patient_letter_cc")
 */

class PatientLetterCcEntity extends BaseEntity
{

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

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

    /**
     * @ORM\ManyToOne(targetEntity="PatientLetterEntity", inversedBy="patientLetterCcs")
     * @ORM\JoinColumn(name="patient_letter_id", referencedColumnName="id")
     */
    protected $patientLetter;

    /**
     * @ORM\ManyToOne(targetEntity="PatientReferringProviderEntity", inversedBy="patientLetterCcs")
     * @ORM\JoinColumn(name="patient_referring_provider_id", referencedColumnName="id")
     */
    protected $patientReferringProvider;

    /**
     * @ORM\ManyToOne(targetEntity="PatientReferringHealthFacilityEntity", inversedBy="patientLetterCcs")
     * @ORM\JoinColumn(name="patient_referring_health_facility_id", referencedColumnName="id")
     */
    protected $patientReferringHealthFacility;

    /**
     * @ORM\ManyToOne(targetEntity="PatientInsuranceEntity", inversedBy="patientLetterCcs")
     * @ORM\JoinColumn(name="patient_insurance_id", referencedColumnName="id")
     */
    protected $patientInsurance;

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

    /*--------------------------------------------------------------------------------------------------------*/
    /*					Use Defined Setters and Getters														  */
    /*--------------------------------------------------------------------------------------------------------*/
    /**
     * Get createdAtAsString
     *
     * @return string
     * @throws \Exception
     */
    public function getCreatedAtAsString() {
        $dttst = new DateTimeToStringTransformer();
        return date('m/d/Y H:i A', strtotime($dttst->transform(new \DateTime())));
    }


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



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

        return $this;
    }

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

    /**
     * Set patientLetter
     *
     * @param \RxConnexionBundle\Entity\PatientLetterEntity $patientLetter
     *
     * @return PatientLetterCcEntity
     */
    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 patientReferringProvider
     *
     * @param \RxConnexionBundle\Entity\PatientReferringProviderEntity $patientReferringProvider
     *
     * @return PatientLetterCcEntity
     */
    public function setPatientReferringProvider(\RxConnexionBundle\Entity\PatientReferringProviderEntity $patientReferringProvider = null)
    {
        $this->patientReferringProvider = $patientReferringProvider;

        return $this;
    }

    /**
     * Get patientReferringProvider
     *
     * @return \RxConnexionBundle\Entity\PatientReferringProviderEntity
     */
    public function getPatientReferringProvider()
    {
        return $this->patientReferringProvider;
    }

    /**
     * Set patientReferringHealthFacility
     *
     * @param \RxConnexionBundle\Entity\PatientReferringHealthFacilityEntity $patientReferringHealthFacility
     *
     * @return PatientLetterCcEntity
     */
    public function setPatientReferringHealthFacility(\RxConnexionBundle\Entity\PatientReferringHealthFacilityEntity $patientReferringHealthFacility = null)
    {
        $this->patientReferringHealthFacility = $patientReferringHealthFacility;

        return $this;
    }

    /**
     * Get patientReferringHealthFacility
     *
     * @return \RxConnexionBundle\Entity\PatientReferringHealthFacilityEntity
     */
    public function getPatientReferringHealthFacility()
    {
        return $this->patientReferringHealthFacility;
    }

    /**
     * Set patientInsurance
     *
     * @param \RxConnexionBundle\Entity\PatientInsuranceEntity $patientInsurance
     *
     * @return PatientLetterCcEntity
     */
    public function setPatientInsurance(\RxConnexionBundle\Entity\PatientInsuranceEntity $patientInsurance = null)
    {
        $this->patientInsurance = $patientInsurance;

        return $this;
    }

    /**
     * Get patientInsurance
     *
     * @return \RxConnexionBundle\Entity\PatientInsuranceEntity
     */
    public function getPatientInsurance()
    {
        return $this->patientInsurance;
    }

    /**
     * Set affiliateType
     *
     * @param string $affiliateType
     *
     * @return PatientLetterCcEntity
     */
    public function setAffiliateType($affiliateType)
    {
        $this->affiliateType = $affiliateType;

        return $this;
    }

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