OEModule\PASAPI\resources\PatientId::validate PHP Method

validate() public method

As a primary resource (i.e. mapped to external resource) we need to ensure we have an id for tracking the resource in the system.
public validate ( ) : boolean
return boolean
    public function validate()
    {
        $has_id = false;
        foreach ($this->id_tags as $attr) {
            if (isset($this->{$attr})) {
                $has_id = true;
            }
        }
        if (!$has_id) {
            $this->addError('At least one Id tag of the form ' . implode(',', $this->id_tags) . ' is required.');
        }
        return parent::validate();
    }