function parse($data) { parent::parse($data); if ($this->data === "" || $this->data === null) { // === $message->nullValue) { // nullValue ("") or null ?? if ($this->required) { $this->error(CHL7v2Exception::FIELD_EMPTY, $this->getPathString(), $this); } } else { if ($this->forbidden) { $this->error(CHL7v2Exception::FIELD_FORBIDDEN, $this->data, $this); } } $message = $this->getMessage(); $items = CHL7v2::split($message->repetitionSeparator, $this->data, $this->keep()); /* // Ce test ne semble pas etre valide, car meme si maxOccurs n'est pas unbounded, // on en trouve souvent plusieurs occurences if (!$this->unbounded && count($items) > 1) { mbTrace($this); $this->error(CHL7v2Exception::TOO_MANY_FIELD_ITEMS, $this->name, $this); }*/ $this->items = array(); foreach ($items as $i => $components) { $_field_item = new CHL7v2FieldItem($this, $this->meta_spec, $i); $_field_item->parse($components); $this->items[] = $_field_item; } $this->validate(); }