/** * Parses an MB value * * @param string $value The MB value * @param CHL7v2Field $field The field containing the value * * @return array A structure containing the elements of the value */ protected function parseMB($value, CHL7v2Field $field) { if ($value === null || $value === "") { return array(); } if (!preg_match($this->getRegExpMB(), $value, $matches)) { $field->error(CHL7v2Exception::INVALID_DATA_FORMAT, "'{$value}' ({$this->type})", $field); return false; } return $matches; }