<?php

namespace dgsoft\StructType;

use \WsdlToPhp\PackageBase\AbstractStructBase;

/**
 * This class stands for IndCoverageReqsTypePreexistingCondition StructType
 * @package Dg
 * @subpackage Structs
 */
class DgIndCoverageReqsTypePreexistingCondition extends DgFreeTextType
{
    /**
     * The _
     * @var \dgsoft\StructType\DgFreeTextType
     */
    public $_;
    /**
     * The DiagnosisDate
     * @var string
     */
    public $DiagnosisDate;
    /**
     * The LastTreatmentDate
     * @var string
     */
    public $LastTreatmentDate;
    /**
     * Constructor method for IndCoverageReqsTypePreexistingCondition
     * @uses DgIndCoverageReqsTypePreexistingCondition::set_()
     * @uses DgIndCoverageReqsTypePreexistingCondition::setDiagnosisDate()
     * @uses DgIndCoverageReqsTypePreexistingCondition::setLastTreatmentDate()
     * @param \dgsoft\StructType\DgFreeTextType $_
     * @param string $diagnosisDate
     * @param string $lastTreatmentDate
     */
    public function __construct(\dgsoft\StructType\DgFreeTextType $_ = null, $diagnosisDate = null, $lastTreatmentDate = null)
    {
        $this
            ->set_($_)
            ->setDiagnosisDate($diagnosisDate)
            ->setLastTreatmentDate($lastTreatmentDate);
    }
    /**
     * Get _ value
     * @return \dgsoft\StructType\DgFreeTextType|null
     */
    public function get_()
    {
        return $this->_;
    }
    /**
     * Set _ value
     * @param \dgsoft\StructType\DgFreeTextType $_
     * @return \dgsoft\StructType\DgIndCoverageReqsTypePreexistingCondition
     */
    public function set_(\dgsoft\StructType\DgFreeTextType $_ = null)
    {
        $this->_ = $_;
        return $this;
    }
    /**
     * Get DiagnosisDate value
     * @return string|null
     */
    public function getDiagnosisDate()
    {
        return $this->DiagnosisDate;
    }
    /**
     * Set DiagnosisDate value
     * @param string $diagnosisDate
     * @return \dgsoft\StructType\DgIndCoverageReqsTypePreexistingCondition
     */
    public function setDiagnosisDate($diagnosisDate = null)
    {
        // validation for constraint: string
        if (!is_null($diagnosisDate) && !is_string($diagnosisDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($diagnosisDate)), __LINE__);
        }
        $this->DiagnosisDate = $diagnosisDate;
        return $this;
    }
    /**
     * Get LastTreatmentDate value
     * @return string|null
     */
    public function getLastTreatmentDate()
    {
        return $this->LastTreatmentDate;
    }
    /**
     * Set LastTreatmentDate value
     * @param string $lastTreatmentDate
     * @return \dgsoft\StructType\DgIndCoverageReqsTypePreexistingCondition
     */
    public function setLastTreatmentDate($lastTreatmentDate = null)
    {
        // validation for constraint: string
        if (!is_null($lastTreatmentDate) && !is_string($lastTreatmentDate)) {
            throw new \InvalidArgumentException(sprintf('Invalid value, please provide a string, "%s" given', gettype($lastTreatmentDate)), __LINE__);
        }
        $this->LastTreatmentDate = $lastTreatmentDate;
        return $this;
    }
    /**
     * Method called when an object has been exported with var_export() functions
     * It allows to return an object instantiated with the values
     * @see AbstractStructBase::__set_state()
     * @uses AbstractStructBase::__set_state()
     * @param array $array the exported values
     * @return \dgsoft\StructType\DgIndCoverageReqsTypePreexistingCondition
     */
    public static function __set_state(array $array)
    {
        return parent::__set_state($array);
    }
    /**
     * Method returning the class name
     * @return string __CLASS__
     */
    public function __toString()
    {
        return __CLASS__;
    }
}
