function __construct(CHL7v2Entity $parent, CHL7v2DOMElement $specs, $self_pos, $separators) { parent::__construct(); $this->parent = $parent; // Separators stack $this->separator = array_shift($separators); $this->separators = $separators; // Intrinsic properties $this->length = (int) $specs->getAttribute("length"); $this->table = (int) $specs->getAttribute("table"); $this->datatype = $specs->queryTextNode("datatype"); $this->description = $specs->queryTextNode("description"); $this->self_pos = $self_pos; }
function __construct(CHL7v2Segment $segment, CHL7v2DOMElement $spec) { parent::__construct($segment); $this->owner_segment = $segment; $this->name = $spec->queryTextNode("name"); $this->datatype = $spec->queryTextNode("datatype"); $this->length = (int) $spec->getAttribute("length"); $this->table = (int) $spec->getAttribute("table"); $this->meta_spec = $spec; /*if ($this->datatype == "TS") { $this->datatype = "DTM"; }*/ $this->description = $spec->queryTextNode("description"); $this->required = $spec->isRequired(); $this->forbidden = $spec->isForbidden(); $this->unbounded = $spec->isUnbounded(); }