src/AppBundle/Entity/RecurringClaim.php line 17

Open in your IDE?
  1. <?php
  2. namespace AppBundle\Entity;
  3. use Doctrine\Common\Collections\ArrayCollection;
  4. use Doctrine\Common\Collections\Collection;
  5. use Doctrine\ORM\Mapping as ORM;
  6. use Symfony\Component\Validator\Constraints as Assert;
  7. use JMS\Serializer\Annotation as Serializer;
  8. use DateTime;
  9. /**
  10.  * @ORM\Entity(repositoryClass="AppBundle\Entity\Repository\RecurringClaimRepository")
  11.  * @ORM\Table(name="recurringclaim")
  12.  * @Serializer\ExclusionPolicy("all")
  13.  */
  14. class RecurringClaim extends AbstractEntity
  15. {
  16.     const CLAIM_TYPE 'recurring';
  17.     const STATUS_PENDING 'pending';
  18.     const STATUS_ATTENTION 'attention';
  19.     const STATUS_APPROVED 'approved';
  20.     const STATUS_REJECTED 'rejected';
  21.     const STATUS_CLOSED 'closed'// Alternative rejection. Possible TODO: consider actual status rejected, and separate into a sub-status field
  22.     const STATUS_CANCELED 'canceled';
  23.     // Recurring frequency is defined in terms of the period
  24.     const FREQUENCY_WEEKLY '1 week';
  25.     const FREQUENCY_BIWEEKLY '2 week';
  26.     const FREQUENCY_SEMIMONTHLY '.5 month';
  27.     const FREQUENCY_MONTHLY '1 month';
  28.     const FREQUENCY_QUARTERLY '3 month';
  29.     const FREQUENCY_SEMIANNUALLY '6 month';
  30.     const FREQUENCY_ANNUALLY '12 month';
  31.     
  32.     // Irregular frequency requiring manual one-time claim creation
  33.     const FREQUENCY_MANUAL 'manual';
  34.     
  35.     const START_NOW 'Now';
  36.     const START_LATER 'Later';
  37.     const APPROVAL_AUTOMATIC 'automatic';
  38.     const APPROVAL_WITH_ATTESTATION 'attest';
  39.     const APPROVAL_WITH_COVERAGE 'coverage';
  40.     
  41.     protected static $allStatuses = array(
  42.             self::STATUS_PENDING,
  43.             self::STATUS_ATTENTION,
  44.             self::STATUS_APPROVED,
  45.             self::STATUS_REJECTED,
  46.             self::STATUS_CLOSED,
  47.             self::STATUS_CANCELED
  48.         );
  49.     
  50.     protected static $allFrequencies = array(
  51.             self::FREQUENCY_WEEKLY,
  52.             self::FREQUENCY_BIWEEKLY,
  53.             self::FREQUENCY_SEMIMONTHLY,
  54.             self::FREQUENCY_MONTHLY,
  55.             self::FREQUENCY_QUARTERLY,
  56.             self::FREQUENCY_SEMIANNUALLY,
  57.             self::FREQUENCY_ANNUALLY,
  58.             self::FREQUENCY_MANUAL
  59.         );
  60.     
  61.     /**
  62.      * @var int
  63.      * @ORM\Column(type="integer", name="RecurringClaimId")
  64.      * @ORM\Id
  65.      * @ORM\GeneratedValue
  66.      */
  67.     protected $id;
  68.     
  69.     /**
  70.      * @var Participant
  71.      * @ORM\ManyToOne(targetEntity="Participant")
  72.      * @ORM\JoinColumn(name="ParticipantId", referencedColumnName="ParticipantId")
  73.      * @Serializer\Expose
  74.      * @Serializer\Groups({"mainRecurring"})
  75.      */
  76.     protected $participant;
  77.     
  78.     /**
  79.      * @var ParticipantPolicy
  80.      * @ORM\ManyToOne(targetEntity="ParticipantPolicy")
  81.      * @ORM\JoinColumn(name="PolicyId", referencedColumnName="Id")
  82.      * @Serializer\Expose
  83.      * @Serializer\Groups({"details"})
  84.      */
  85.     protected $policy;
  86.     
  87.     /**
  88.      * @var RecurringClaimReview
  89.      * @ORM\OneToOne(targetEntity="RecurringClaimReview", mappedBy="recurringClaim")
  90.      * @Serializer\Expose
  91.      * @Serializer\Groups({"supervisor"})
  92.      */
  93.     protected $review;
  94.     /**
  95.      * @var RecurringClaim
  96.      * @ORM\OneToOne(targetEntity="RecurringClaim")
  97.      * @ORM\JoinColumn(name="ReplacesClaimId", referencedColumnName="RecurringClaimId")
  98.      * @Serializer\Expose
  99.      * @Serializer\Groups({"supervisor"})
  100.      */
  101.     protected $replacesClaim;
  102.     /**
  103.      * @var Collection
  104.      * @ORM\OneToMany(targetEntity="ClaimDocument", mappedBy="recurringClaim")
  105.      * @Serializer\Expose
  106.      */
  107.     protected $documents;
  108.     
  109.     /**
  110.      * @var Collection
  111.      * @ORM\OneToMany(targetEntity="Claim", mappedBy="recurringClaim")
  112.      */
  113.     protected $claims;
  114.     
  115.     /**
  116.      * @var DateTime
  117.      * @ORM\Column(type="datetime", name="Approved")
  118.      */
  119.     protected $dateApproved;
  120.     
  121.     /**
  122.      * @var DateTime
  123.      * @ORM\Column(type="datetime", name="Rejected")
  124.      */
  125.     protected $dateRejected;
  126.     /**
  127.      * @var DateTime
  128.      * @ORM\Column(type="datetime", name="Canceled")
  129.      */
  130.     protected $dateCanceled;
  131.     
  132.     /**
  133.      * @todo There should be no need for a serialized array here, but for now there is
  134.      * @var array
  135.      * @ORM\Column(type="array", name="ClaimInfo")
  136.      */
  137.     protected $claimInfo = array(
  138.         'SubmittedByDependentId' => '',
  139.         'ParticipantNote' => '',
  140.         'SupervisorNote' => '',
  141.         'SupervisorPrivateNote' => '',
  142.         'Receipt' => '',
  143.         'ReceiptLocation' => '',
  144.         'ClaimType' => 'Health Insurance Premium',
  145.         'ReceiptImageType' => '',
  146.         'IsHSA' => 0,
  147.         'DateOfService' => null,
  148.         'EndDateOfService' => null,
  149.         'OriginalAmount' => 0,
  150.         'ProviderOfService' => '',
  151.         'RecipientOfService' => '',
  152.         'RecipientDependentId' => '',
  153.         'EnteredBySupervisor' => '',
  154.         'POPFullPolicyAmount' => 0,
  155.         'StartDate' => null,
  156.         'StartDateOption' => self::START_NOW,
  157.         'EndDate' => null
  158.     );
  159.     
  160.     /**
  161.      * @var string
  162.      * @ORM\Column(type="string", name="Status", length=9)
  163.      * @Serializer\Expose
  164.      */
  165.     protected $status self::STATUS_PENDING;
  166.     /**
  167.      * @var string
  168.      * @ORM\Column(type="string", name="Period")
  169.      * @Serializer\Expose
  170.      */
  171.     protected $period;
  172.     
  173.     /**
  174.      * @var int
  175.      * @ORM\Column(type="integer", name="Level")
  176.      * @Serializer\Expose
  177.      */
  178.     protected $level 1;
  179.     
  180.     /**
  181.      * @var DateTime
  182.      * @ORM\Column(type="datetime", name="DateOfNextStep", nullable=true)
  183.      * @Serializer\Expose
  184.      */
  185.     protected $dateOfNextStep;
  186.     
  187.     /**
  188.      * @var DateTime
  189.      * @ORM\Column(type="datetime", name="CreationDate")
  190.      * @Serializer\Expose
  191.      * @Serializer\SerializedName("dateCreated")
  192.      */
  193.     protected $dateCreated;
  194.     
  195.     /**
  196.      * @var DateTime
  197.      * @ORM\Column(type="datetime", name="LastModified", nullable=true)
  198.      * @Serializer\Expose
  199.      */
  200.     protected $dateLastModified;
  201.     
  202.     /**
  203.      * @var Supervisor
  204.      * @ORM\ManyToOne(targetEntity="Supervisor")
  205.      * @ORM\JoinColumn(name="LastModifiedBySupervisorId", referencedColumnName="SupervisorId")
  206.      * @Serializer\Expose
  207.      * @Serializer\Groups({"details"})
  208.      */
  209.     protected $lastModifiedBySupervisor;
  210.     
  211.     /**
  212.      * @var Supervisor
  213.      * @ORM\ManyToOne(targetEntity="Supervisor")
  214.      * @ORM\JoinColumn(name="ProcessedSupervisorId", referencedColumnName="SupervisorId")
  215.      * @Serializer\Expose
  216.      * @Serializer\Groups({"details"})
  217.      */
  218.     protected $processedBySupervisor;
  219.     /**
  220.      * @var bool
  221.      * @ORM\Column(type="boolean", name="ApproveFirstClaim")
  222.      */
  223.     protected $approveFirstClaim true;
  224.     
  225.     
  226.     protected $dateOfService;
  227.     public function __construct()
  228.     {
  229.         $this->documents = new ArrayCollection();
  230.         $this->claims = new ArrayCollection();
  231.         $this->dateCreated = new DateTime();
  232.     }
  233.     
  234.     /**
  235.      * @return string
  236.      * @Serializer\VirtualProperty
  237.      */
  238.     public function getClaimType()
  239.     {
  240.         return self::CLAIM_TYPE;
  241.     }
  242.     
  243.     /**
  244.      * @param Participant $participant
  245.      * @return self
  246.      */
  247.     public function setParticipant(Participant $participant)
  248.     {
  249.         $this->participant $participant;
  250.         return $this;
  251.     }
  252.     
  253.     /**
  254.      * @return Participant
  255.      */
  256.     public function getParticipant()
  257.     {
  258.         return $this->participant;
  259.     }
  260.     
  261.     /**
  262.      * @return ParticipantPolicy
  263.      * 
  264.      */
  265.     public function getPolicy()
  266.     {
  267.         return $this->policy;
  268.     }
  269.     
  270.     /**
  271.      * @param ParticipantPolicy $policy
  272.      * @return self
  273.      */
  274.     public function setPolicy(ParticipantPolicy $policy null)
  275.     {
  276.         
  277.         $this->policy $policy;
  278.         return $this;
  279.     }
  280.     
  281.     /**
  282.      * @return RecurringClaimReview
  283.      */
  284.     public function getReview()
  285.     {
  286.         return $this->review;
  287.     }
  288.     
  289.     /**
  290.      * @param RecurringClaimReview $review
  291.      * @return self
  292.      */
  293.     public function setReview(RecurringClaimReview $review null)
  294.     {
  295.         $this->review $review;
  296.         
  297.         // Ensure two-way relationship
  298.         if ($review && $review->getRecurringClaim() !== $this) {
  299.             $review->setRecurringClaim($this);
  300.         }
  301.         
  302.         return $this;
  303.     }
  304.     
  305.     /**
  306.      * @return ClaimDocument[]
  307.      */
  308.     public function getDocuments()
  309.     {
  310.         return $this->documents->toArray();
  311.     }
  312.     
  313.     /**
  314.      * @return string
  315.      */
  316.     public function getStatus()
  317.     {
  318.         return $this->status;
  319.     }
  320.     /**
  321.      * @param string $new
  322.      * @return self
  323.      */
  324.     public function setStatus($new)
  325.     {
  326.         if (!in_array($newself::$allStatusestrue)) {
  327.             throw new \InvalidArgumentException("Invalid status: '$new'");
  328.         }
  329.         
  330.         $this->status $new;
  331.         return $this;
  332.     }
  333.     
  334.     /**
  335.      * @Serializer\VirtualProperty 
  336.      * @Serializer\SerializedName("approvedAmount")
  337.      * @return float
  338.      */
  339.     public function getApprovedAmount()
  340.     {
  341.         return $this->claimInfo['OriginalAmount'];
  342.     }
  343.     
  344.     /**
  345.      * @param float $new
  346.      * @return self
  347.      */
  348.     public function setApprovedAmount($new)
  349.     {
  350.         $this->claimInfo['OriginalAmount'] = $new;
  351.         return $this;
  352.     }
  353.     
  354.     /**
  355.      * @Assert\GreaterThan(value=0)
  356.      * @Serializer\VirtualProperty 
  357.      * @Serializer\SerializedName("originalAmount")
  358.      * @return float
  359.      */
  360.     public function getOriginalAmount()
  361.     { 
  362.         return $this->claimInfo['OriginalAmount'];
  363.     }
  364.     
  365.     /**
  366.      * @param float $new
  367.      * @return self
  368.      */
  369.     public function setOriginalAmount($new)
  370.     {
  371.         $this->claimInfo['OriginalAmount'] = $new;
  372.         return $this;
  373.     }
  374.     /**
  375.      * @Serializer\VirtualProperty
  376.      * @return float
  377.      */
  378.     public function getPremiumAmount()
  379.     {
  380.         return $this->claimInfo['POPFullPolicyAmount'];
  381.     }
  382.     /**
  383.      * @param float $new
  384.      * @return self
  385.      */
  386.     public function setPremiumAmount($new)
  387.     {
  388.         $this->claimInfo['POPFullPolicyAmount'] = $new;
  389.         return $this;
  390.     }
  391.     
  392.     /**
  393.      * @Serializer\VirtualProperty
  394.      * @Serializer\SerializedName("recipientDependentId")
  395.      * @return int
  396.      */
  397.     public function getRecipientDependentId()
  398.     {
  399.         return $this->claimInfo['RecipientDependentId'];
  400.     }
  401.     
  402.     /**
  403.      * @return Participant|Dependent
  404.      */
  405.     public function getRecipient()
  406.     {
  407.         $dependentId $this->claimInfo['RecipientDependentId'];
  408.         if ($dependentId) {
  409.             foreach ($this->getParticipant()->getDependents() as $dependent) {
  410.                 if ($dependent->getId() === $dependentId) {
  411.                     return $dependent;
  412.                 }
  413.             }
  414.         }
  415.         
  416.         return $this->participant;
  417.     }
  418.     
  419.     /**
  420.      * @param Participant|Dependent $recipient
  421.      * @return self
  422.      */
  423.     public function setRecipient($recipient)
  424.     {
  425.         if ($recipient instanceof Dependent) {
  426.             $this->claimInfo['RecipientDependentId'] = $recipient->getId();
  427.         }
  428.         else {
  429.             $this->claimInfo['RecipientDependentId'] = 0;
  430.         }
  431.         
  432.         $this->claimInfo['RecipientOfService'] = $recipient->getFirstName() . ' ' $recipient->getLastName();
  433.         return $this;
  434.     }
  435.     
  436.     /**
  437.      * @Serializer\VirtualProperty
  438.      * @Serializer\SerializedName("participantNote")
  439.      * @return string
  440.      */
  441.     public function getParticipantNote()
  442.     {
  443.         return $this->claimInfo['ParticipantNote'];
  444.     }
  445.     
  446.     /**
  447.      * @param string $new
  448.      * @return self
  449.      */
  450.     public function setParticipantNote($new)
  451.     {
  452.         $this->claimInfo['ParticipantNote'] = $new;
  453.         return $this;
  454.     }
  455.     
  456.     /**
  457.      * @Serializer\VirtualProperty
  458.      * @Serializer\SerializedName("supervisorNote")
  459.      * @return string
  460.      */
  461.     public function getSupervisorNote()
  462.     {
  463.         return $this->getClaimInfoIndex('SupervisorNote');
  464.     }
  465.     
  466.     /**
  467.      * @param string $new
  468.      * @return self
  469.      */
  470.     public function setSupervisorNote($new)
  471.     {
  472.         $this->claimInfo['SupervisorNote'] = $new;
  473.         return $this;
  474.     }
  475.     
  476.     /**
  477.      * @Serializer\VirtualProperty
  478.      * @Serializer\Groups({"supervisor"})
  479.      * @return string
  480.      */
  481.     public function getSupervisorPrivateNote()
  482.     {
  483.         return $this->getClaimInfoIndex('SupervisorPrivateNote');
  484.     }
  485.     
  486.     /**
  487.      * @param string $new
  488.      * @return self
  489.      */
  490.     public function setSupervisorPrivateNote($new)
  491.     {
  492.         $this->claimInfo['SupervisorPrivateNote'] = $new;
  493.         return $this;
  494.     }
  495.     
  496.     /**
  497.      * @Serializer\VirtualProperty
  498.      * @Assert\NotBlank
  499.      * @Serializer\SerializedName("providerName")
  500.      * @return string
  501.      * 
  502.      */
  503.     public function getProviderName()
  504.     {
  505.         return $this->claimInfo['ProviderOfService'];
  506.     }
  507.     
  508.     /**
  509.      * @param string $new
  510.      * @return self
  511.      */
  512.     public function setProviderName($new)
  513.     {
  514.         
  515.         $this->claimInfo['ProviderOfService'] = $new;
  516.         return $this;
  517.     }
  518.     
  519.     /**
  520.      * @Assert\NotBlank
  521.      * @return string
  522.      */
  523.     public function getPeriod()
  524.     {
  525.         return $this->period;
  526.     }
  527.     
  528.     /**
  529.      * @param string $new
  530.      * @return self
  531.      */
  532.     public function setPeriod($new)
  533.     {
  534.         if (!in_array($newself::$allFrequenciestrue)) {
  535.             throw new \InvalidArgumentException("Invalid period '$new'");
  536.         }
  537.         
  538.         $this->period $new;
  539.         return $this;
  540.     }
  541.     
  542.     /**
  543.      * @Assert\NotBlank
  544.      * @Serializer\VirtualProperty
  545.      * @Serializer\Type("DateTime<'Y-m-d'>")
  546.      * @Serializer\SerializedName("startDate")
  547.      * @return DateTime
  548.      */
  549.     public function getStartDate()
  550.     {
  551.         return $this->claimInfo['StartDate'] ? new DateTime($this->claimInfo['StartDate']) : null;
  552.     }
  553.     
  554.     /**
  555.      * @param DateTime $date
  556.      * @return self
  557.      */
  558.     public function setStartDate(DateTime $date null)
  559.     {
  560.         $this->claimInfo['StartDate'] = $date $date->format('Y-m-d') : null;
  561.         return $this;
  562.     }
  563.     
  564.     /**
  565.      * @Serializer\VirtualProperty
  566.      * @return string
  567.      */
  568.     public function getStartDateOption()
  569.     {
  570.         return $this->claimInfo['StartDateOption'];
  571.     }
  572.     /**
  573.      * @Serializer\VirtualProperty
  574.      * @Serializer\Type("DateTime<'Y-m-d'>")
  575.      * @return DateTime|null
  576.      */
  577.     public function getEndDate()
  578.     {
  579.         $endDate $this->getClaimInfoIndex('EndDate');
  580.         if ($endDate) {
  581.             return new DateTime($endDate);
  582.         }
  583.         return null;
  584.     }
  585.     /**
  586.      * @param DateTime $date
  587.      * @return self
  588.      */
  589.     public function setEndDate(DateTime $date null)
  590.     {
  591.         $this->claimInfo['EndDate'] = $date $date->format('Y-m-d') : null;
  592.         return $this;
  593.     }
  594.     
  595.     /**
  596.      * @param string $new
  597.      * @return self
  598.      */
  599.     public function setStartDateOption($new)
  600.     {
  601.         if ($new !== self::START_NOW && $new !== self::START_LATER) {
  602.             throw new \InvalidArgumentException('Invalid start date option');
  603.         }
  604.         $this->claimInfo['StartDateOption'] = $new;
  605.         return $this;
  606.     }
  607.     
  608.     /**
  609.      * @Assert\NotBlank
  610.      * @Serializer\VirtualProperty
  611.      * @Serializer\Type("DateTime<'Y-m-d'>")
  612.      * @Serializer\SerializedName("dateOfService")
  613.      * @return DateTime
  614.      */
  615.     public function getDateOfService()
  616.     {
  617.         
  618.         return $this->claimInfo['DateOfService'] ? new DateTime($this->claimInfo['DateOfService']) : null;
  619.     }
  620.     
  621.     /**
  622.      * @param DateTime $date
  623.      * @return self
  624.      */
  625.     public function setDateOfService(DateTime $date null)
  626.     {
  627.         $this->claimInfo['DateOfService'] = $date $date->format('Y-m-d') : null;
  628.         
  629.         return $this;
  630.     }
  631.     
  632.     /**
  633.      * @Serializer\VirtualProperty
  634.      * @Serializer\Type("DateTime<'Y-m-d'>")
  635.      * @return DateTime
  636.      */
  637.     public function getEndDateOfService()
  638.     {
  639.         return empty($this->claimInfo['EndDateOfService']) ? null : new DateTime($this->claimInfo['EndDateOfService']);
  640.     }
  641.     
  642.     /**
  643.      * @param DateTime $date
  644.      * @return self
  645.      */
  646.     public function setEndDateOfService(DateTime $date null)
  647.     {
  648.         $this->claimInfo['EndDateOfService'] = $date $date->format('Y-m-d') : null;
  649.         return $this;
  650.     }
  651.     
  652.     /**
  653.      * @param ClaimDocument $document
  654.      * @return self
  655.      */
  656.     public function addDocument(ClaimDocument $document)
  657.     {
  658.         $this->documents->add($document);
  659.         return $this;
  660.     }
  661.     
  662.     /**
  663.      * @param ClaimDocument $document
  664.      * @return self
  665.      */
  666.     public function removeDocument(ClaimDocument $document)
  667.     {
  668.         $this->documents->removeElement($document);
  669.         return $this;
  670.     }
  671.     
  672.     /**
  673.      * @param string $imageId
  674.      * @return ClaimDocument|null
  675.      */
  676.     public function getDocumentByImageId($imageId)
  677.     {
  678.         foreach ($this->documents as $doc) {
  679.             if ($doc->getImageId() === $imageId) {
  680.                 return $doc;
  681.             }
  682.         }
  683.         
  684.         return null;
  685.     }
  686.     /**
  687.      * @return RecurringClaim
  688.      */
  689.     public function getReplacesClaim()
  690.     {
  691.         return $this->replacesClaim;
  692.     }
  693.     /**
  694.      * @param RecurringClaim $claim
  695.      * @return $this
  696.      */
  697.     public function setReplacesClaim(RecurringClaim $claim=null)
  698.     {
  699.         $this->replacesClaim $claim;
  700.         return $this;
  701.     }
  702.     
  703.     /**
  704.      * @param User $user
  705.      * @return self
  706.      */
  707.     public function setSubmittedBy(User $user)
  708.     {
  709.         $this->claimInfo['SubmittedByDependentId'] = $user instanceof Dependent $user->getId() : 0;
  710.         return $this;
  711.     }
  712.     
  713.     /**
  714.      * @Serializer\VirtualProperty
  715.      * @Assert\NotBlank
  716.      * @return string
  717.      */
  718.     public function getReceiptLocation()
  719.     {
  720.         return $this->claimInfo['ReceiptLocation'];
  721.     }
  722.     
  723.     /**
  724.      * @param string $new
  725.      * @return self
  726.      */
  727.     public function setReceiptLocation($new)
  728.     {
  729.         $this->claimInfo['ReceiptLocation'] = $new;
  730.         return $this;
  731.     }
  732.     /**
  733.      * @Serializer\VirtualProperty
  734.      * @Assert\NotBlank
  735.      * @Serializer\SerializedName("natureOfExpense")
  736.      * @return string
  737.      */
  738.     public function getNatureOfExpense()
  739.     {
  740.         return $this->claimInfo['ClaimType'];
  741.     }
  742.     
  743.     /**
  744.      * @param Claim $claim
  745.      * @return self
  746.      */
  747.     public function addClaim(Claim $claim)
  748.     {
  749.         $this->claims->add($claim);
  750.         return $this;
  751.     }
  752.     
  753.     /**
  754.      * @return Claim[]
  755.      */
  756.     public function getClaims()
  757.     {
  758.         return $this->claims->toArray();
  759.     }
  760.     
  761.     /**
  762.      * @return Claim|null
  763.      */
  764.     public function getMostRecentClaim()
  765.     {
  766.         $mostRecent null;
  767.         foreach ($this->claims as $claim) {
  768.             if (!$mostRecent || $claim->getDateOfService() > $mostRecent->getDateOfService()) {
  769.                 $mostRecent $claim;
  770.             }
  771.         }
  772.         
  773.         return $mostRecent;
  774.     }
  775.     
  776.     
  777.     /**
  778.      * @return bool
  779.      */
  780.     public function isAppliedToHSA()
  781.     {
  782.         return (bool) $this->claimInfo['IsHSA'];
  783.     }
  784.     /**
  785.      * @param bool $new
  786.      * @return self
  787.      */
  788.     public function setIsAppliedToHSA($new
  789.     {
  790.         $this->claimInfo['IsHSA'] = $new 0;
  791.         return $this;
  792.     }
  793.     
  794.     /**
  795.      * @return int
  796.      */
  797.     public function getLevel()
  798.     {
  799.         return $this->level;
  800.     }
  801.     
  802.     /**
  803.      * @param int $level
  804.      * @return self
  805.      */
  806.     public function setLevel($level)
  807.     {
  808.         $this->level $level;
  809.         return $this;
  810.     }
  811.     
  812.     /**
  813.      * @Serializer\SerializedName("dateCreated")
  814.      * @return DateTime
  815.      */
  816.     public function getDateCreated()
  817.     {
  818.         return $this->dateCreated;
  819.     }
  820.     
  821.     /**
  822.      * @return bool
  823.      */
  824.     public function isApproved()
  825.     {
  826.         return (bool) $this->dateApproved;
  827.     }
  828.     /**
  829.      * @return bool
  830.      */
  831.     public function isRejected()
  832.     {
  833.         return (bool) $this->dateRejected;
  834.     }
  835.     /**
  836.      * @return bool
  837.      */
  838.     public function isCanceled()
  839.     {
  840.         return (bool) $this->dateCanceled;
  841.     }
  842.     /**
  843.      * @return bool
  844.      */
  845.     public function isFinal()
  846.     {
  847.         return $this->dateApproved || $this->dateRejected || $this->dateCanceled;
  848.     }
  849.     
  850.     /**
  851.      * @return DateTime
  852.      */
  853.     public function getDateOfNextStep()
  854.     {
  855.         return $this->dateOfNextStep;
  856.     }
  857.     /**
  858.      * @param DateTime $dateOfNextStep
  859.      * @return self
  860.      */
  861.     public function setDateOfNextStep(DateTime $dateOfNextStep null)
  862.     {
  863.         $this->dateOfNextStep $dateOfNextStep;
  864.         return $this;
  865.     }
  866.     /**
  867.      * @return DateTime
  868.      */
  869.     public function getDateApproved()
  870.     {
  871.         return $this->dateApproved;
  872.     }
  873.     /**
  874.      * @param DateTime $dateApproved
  875.      * @return $this
  876.      */
  877.     public function setDateApproved(DateTime $dateApproved null)
  878.     {
  879.         $this->dateApproved $dateApproved;
  880.         return $this;
  881.     }
  882.     /**
  883.      * @return DateTime
  884.      */
  885.     public function getDateRejected()
  886.     {
  887.         return $this->dateRejected;
  888.     }
  889.     /**
  890.      * @param DateTime $dateRejected
  891.      * @return $this
  892.      */
  893.     public function setDateRejected(DateTime $dateRejected null)
  894.     {
  895.         $this->dateRejected $dateRejected;
  896.         return $this;
  897.     }
  898.     /**
  899.      * @return DateTime
  900.      */
  901.     public function getDateCanceled()
  902.     {
  903.         return $this->dateCanceled;
  904.     }
  905.     /**
  906.      * @param DateTime $dateCanceled
  907.      * @return $this
  908.      */
  909.     public function setDateCanceled(DateTime $dateCanceled null)
  910.     {
  911.         $this->dateCanceled $dateCanceled;
  912.         return $this;
  913.     }
  914.     /**
  915.      * @return bool
  916.      */
  917.     public function getApproveFirstClaim()
  918.     {
  919.         return $this->approveFirstClaim;
  920.     }
  921.     /**
  922.      * @param bool $value
  923.      * @return $this
  924.      */
  925.     public function setApproveFirstClaim($value)
  926.     {
  927.         $this->approveFirstClaim = (bool) $value;
  928.         return $this;
  929.     }
  930.     /**
  931.      * @param string $index
  932.      * @return mixed
  933.      */
  934.     protected function getClaimInfoIndex($index)
  935.     {
  936.         return array_key_exists($index$this->claimInfo) ? $this->claimInfo[$index] : null;
  937.     }
  938.     
  939. }