Skip to content

Commit

Permalink
Merge pull request #8 from UNMCCC/master
Browse files Browse the repository at this point in the history
Adding the EVN class (event segment)
  • Loading branch information
senaranya authored Aug 15, 2018
2 parents d7db213 + 6cee1d2 commit 671cac9
Show file tree
Hide file tree
Showing 2 changed files with 86 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .phpdoc-md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use Aranyasen\HL7\Segments\IN3;
use Aranyasen\HL7\Segments\IN1;
use Aranyasen\HL7\Segments\PID;
use Aranyasen\HL7\Segments\MSH;
use Aranyasen\HL7\Segments\EVN;
use Aranyasen\HL7\Segment;
use Aranyasen\HL7\Messages\ACK;
use Aranyasen\HL7\Message;
Expand All @@ -35,5 +36,6 @@ return (object)[
OBX::class,
ORC::class,
PV1::class,
EVN::class,
],
];
84 changes: 84 additions & 0 deletions src/HL7/Segments/EVN.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?php

namespace Aranyasen\HL7\Segments;

use Aranyasen\HL7\Segment;

/**
* NTE segment class
* Ref: https://corepointhealth.com/resource-center/hl7-resources/hl7-evn-event-type-segment
*/
class EVN extends Segment
{
/**
* Index of this segment. Incremented for every new segment of this class created
* @var int
*/
protected static $setId = 1;

public function __construct(array $fields = null)
{
parent::__construct('EVN', $fields);
$this->setID($this::$setId++);
}

public function setEventTypeCode($value, int $position = 1)
{
return $this->setField($position, $value);
}

public function setRecordedDateTime($value, int $position = 2)
{
return $this->setField($position, $value);
}

public function setDateTimeEvent($value, int $position = 3)
{
return $this->setField($position, $value);
}

public function setEventReasonCode($value, int $position = 4)
{
return $this->setField($position, $value);
}

public function setOperatorID($value, int $position = 5)
{
return $this->setField($position, $value);
}

public function setEventOccurred($value, int $position = 6)
{
return $this->setField($position, $value);
}

public function getEventTypeCode(int $position = 1)
{
return $this->getField($position);
}

public function getRecordedDateTime(int $position = 2)
{
return $this->getField($position);
}

public function getDateTimeEvent(int $position = 3)
{
return $this->getField($position);
}

public function getEventReasonCode(int $position = 4)
{
return $this->getField($position);
}

public function getOperatorID(int $position = 5)
{
return $this->setField($position);
}

public function getEventOccurred(int $position = 6)
{
return $this->setField($position);
}
}

0 comments on commit 671cac9

Please sign in to comment.