Uploaded From CV. Swandhana Server
This commit is contained in:
No files matched your search
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aranyasen\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class HL7ConnectionException extends Exception
|
||||
{
|
||||
//
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Aranyasen\Exceptions;
|
||||
|
||||
use Exception;
|
||||
|
||||
class HL7Exception extends Exception
|
||||
{
|
||||
//
|
||||
}
|
||||
Vendored
+219
@@ -0,0 +1,219 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen;
|
||||
|
||||
use Aranyasen\Exceptions\HL7Exception;
|
||||
use Exception;
|
||||
use Aranyasen\HL7\Message;
|
||||
use Aranyasen\HL7\Segments\MSH;
|
||||
|
||||
/**
|
||||
* The HL7 class is a factory class for HL7 messages.
|
||||
*
|
||||
* The factory class provides the convenience of changing several defaults for HL7 messaging globally, like separators,
|
||||
* etc. Note that some default settings use characters that have special meaning in PHP, like the HL7 escape character.
|
||||
* To be able to set these values, escape the special characters.
|
||||
*
|
||||
*/
|
||||
class HL7
|
||||
{
|
||||
private array $hl7Globals;
|
||||
private string $hl7String;
|
||||
private bool $emptySubFields = false;
|
||||
private bool $resetIndices = false;
|
||||
private bool $autoIncrementIndices = true;
|
||||
private ?bool $doNotSplitRepetition = null;
|
||||
|
||||
/**
|
||||
* Create a new instance of the HL7 factory, and set global
|
||||
* defaults.
|
||||
*/
|
||||
private function __construct(string $hl7String = '')
|
||||
{
|
||||
$this->setDefaults();
|
||||
$this->hl7String = $hl7String;
|
||||
}
|
||||
|
||||
public static function build(): self
|
||||
{
|
||||
return new static();
|
||||
}
|
||||
|
||||
public static function from(string $hl7String): self
|
||||
{
|
||||
return new static($hl7String);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new Message, using the global HL7 variables as defaults.
|
||||
*
|
||||
* @throws Exception | HL7Exception
|
||||
*/
|
||||
public function createMessage(): Message
|
||||
{
|
||||
if (empty($this->hl7String)) {
|
||||
$msh = $this->createMSH();
|
||||
$message = new Message(
|
||||
$this->hl7String,
|
||||
$this->hl7Globals,
|
||||
$this->emptySubFields,
|
||||
$this->resetIndices,
|
||||
$this->autoIncrementIndices,
|
||||
$this->doNotSplitRepetition
|
||||
);
|
||||
$message->addSegment($msh);
|
||||
return $message;
|
||||
}
|
||||
return new Message(
|
||||
$this->hl7String,
|
||||
$this->hl7Globals,
|
||||
$this->emptySubFields,
|
||||
$this->resetIndices,
|
||||
$this->autoIncrementIndices,
|
||||
$this->doNotSplitRepetition
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a new MSH segment, using the global HL7 variables as defaults.
|
||||
* @throws Exception
|
||||
*/
|
||||
public function createMSH(): MSH
|
||||
{
|
||||
return new MSH(hl7Globals: $this->hl7Globals);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the component separator to be used by the factory. Should be a single character. Default ^
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function withComponentSeparator(string $value): self
|
||||
{
|
||||
$this->checkIfSingleCharacter($value);
|
||||
|
||||
return $this->setGlobal('COMPONENT_SEPARATOR', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the subcomponent separator to be used by the factory. Should be a single character. Default: &
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function withSubcomponentSeparator(string $value): self
|
||||
{
|
||||
$this->checkIfSingleCharacter($value);
|
||||
|
||||
return $this->setGlobal('SUBCOMPONENT_SEPARATOR', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the repetition separator to be used by the factory. Should be a single character. Default: ~
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function withRepetitionSeparator(string $value): self
|
||||
{
|
||||
$this->checkIfSingleCharacter($value);
|
||||
|
||||
return $this->setGlobal('REPETITION_SEPARATOR', $value);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the field separator to be used by the factory. Should be a single character. Default: |
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function withFieldSeparator(string $value): self
|
||||
{
|
||||
$this->checkIfSingleCharacter($value);
|
||||
|
||||
return $this->setGlobal('FIELD_SEPARATOR', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the segment separator to be used by the factory. Should be a single character. Default: \015
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function withSegmentSeparator(string $value): self
|
||||
{
|
||||
$this->checkIfSingleCharacter($value);
|
||||
|
||||
return $this->setGlobal('SEGMENT_SEPARATOR', $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the escape character to be used by the factory. Should be a single character. Default: \
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function withEscapeCharacter(string $value): self
|
||||
{
|
||||
$this->checkIfSingleCharacter($value);
|
||||
|
||||
return $this->setGlobal('ESCAPE_CHARACTER', $value);
|
||||
}
|
||||
|
||||
public function withHL7Version(string $hl7Version): self
|
||||
{
|
||||
return $this->setGlobal('HL7_VERSION', $hl7Version);
|
||||
}
|
||||
|
||||
public function keepEmptySubfields(bool $value = true): self
|
||||
{
|
||||
$this->emptySubFields = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function resetIndices(bool $value = true): self
|
||||
{
|
||||
$this->resetIndices = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function autoIncrementIndices(bool $value = true): self
|
||||
{
|
||||
$this->autoIncrementIndices = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function doNotSplitRepetition(bool $value = true): self
|
||||
{
|
||||
$this->doNotSplitRepetition = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function setGlobal(string $name, string $value): self
|
||||
{
|
||||
$this->hl7Globals[$name] = $value;
|
||||
return $this;
|
||||
}
|
||||
|
||||
private function setDefaults(): void
|
||||
{
|
||||
$this->hl7Globals['SEGMENT_SEPARATOR'] = '\n';
|
||||
$this->hl7Globals['SEGMENT_ENDING_BAR'] = true;
|
||||
$this->hl7Globals['FIELD_SEPARATOR'] = '|';
|
||||
$this->hl7Globals['COMPONENT_SEPARATOR'] = '^';
|
||||
$this->hl7Globals['SUBCOMPONENT_SEPARATOR'] = '&';
|
||||
$this->hl7Globals['REPETITION_SEPARATOR'] = '~';
|
||||
$this->hl7Globals['ESCAPE_CHARACTER'] = '\\';
|
||||
$this->hl7Globals['HL7_VERSION'] = '2.3';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $value
|
||||
* @return void
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
private function checkIfSingleCharacter(string $value): void
|
||||
{
|
||||
if (strlen($value) !== 1) {
|
||||
throw new HL7Exception("Parameter should be a single character. Received: '$value'");
|
||||
}
|
||||
}
|
||||
}
|
||||
+190
@@ -0,0 +1,190 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7;
|
||||
|
||||
use Aranyasen\Exceptions\HL7ConnectionException;
|
||||
use Aranyasen\Exceptions\HL7Exception;
|
||||
use Exception;
|
||||
use Socket;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* ```php
|
||||
* $connection = new Connection('127.0.0.1', 5002);
|
||||
* $req = new Message();
|
||||
* // ... set some request attributes
|
||||
* $response = $connection->send($req);
|
||||
* $response->toString(); // Read ACK message from remote
|
||||
* ```
|
||||
*
|
||||
* The Connection object represents the tcp connection to the HL7 message broker. The Connection has only one public
|
||||
* method (apart from the constructor), send(). The 'send' method takes a Message object as argument, and also
|
||||
* returns a Message object. The send method can be used more than once, before the connection is closed.
|
||||
* Connection is closed automatically when the connection object is destroyed.
|
||||
*
|
||||
* The Connection object holds the following fields:
|
||||
*
|
||||
* MESSAGE_PREFIX
|
||||
*
|
||||
* The prefix to be sent to the HL7 server to initiate the
|
||||
* message. Defaults to \013.
|
||||
*
|
||||
* MESSAGE_SUFFIX
|
||||
* End of message signal for HL7 server. Defaults to \034\015.
|
||||
*
|
||||
*/
|
||||
class Connection
|
||||
{
|
||||
protected Socket $socket;
|
||||
protected int $timeout;
|
||||
|
||||
/** # Octal 13 (Hex: 0B): Vertical Tab */
|
||||
protected string $MESSAGE_PREFIX = "\013";
|
||||
|
||||
/** # 34 (Hex: 1C): file separator character, 15 (Hex: 0D): Carriage return */
|
||||
protected string $MESSAGE_SUFFIX = "\034\015";
|
||||
|
||||
/**
|
||||
* Creates a connection to a HL7 server, or throws exception when a connection could not be established.
|
||||
*
|
||||
* @param string $host Host to connect to
|
||||
* @param int $port Port to connect to
|
||||
* @param int $timeout Connection timeout
|
||||
* @throws HL7ConnectionException
|
||||
*/
|
||||
public function __construct(string $host, int $port, int $timeout = 10)
|
||||
{
|
||||
if (!extension_loaded('sockets')) {
|
||||
throw new HL7ConnectionException('Please install ext-sockets to run Connection');
|
||||
}
|
||||
$this->setSocket($host, $port, $timeout);
|
||||
$this->timeout = $timeout;
|
||||
}
|
||||
|
||||
/**
|
||||
* Create a client-side TCP socket
|
||||
*
|
||||
* @param int $timeout Connection timeout
|
||||
* @throws HL7ConnectionException
|
||||
*/
|
||||
protected function setSocket(string $host, int $port, int $timeout = 10): void
|
||||
{
|
||||
$socket = socket_create(AF_INET, SOCK_STREAM, SOL_TCP);
|
||||
if (!$socket) {
|
||||
$this->throwSocketError('Failed to create socket');
|
||||
}
|
||||
|
||||
if (!socket_set_option($socket, SOL_SOCKET, SO_SNDTIMEO, ['sec' => $timeout, 'usec' => 0])) {
|
||||
$this->throwSocketError('Unable to set timeout on socket');
|
||||
}
|
||||
|
||||
if (!socket_set_option($socket, SOL_SOCKET, SO_RCVTIMEO, ['sec' => $timeout, 'usec' => 0])) {
|
||||
$this->throwSocketError('Unable to set timeout on socket');
|
||||
}
|
||||
|
||||
if (!socket_set_option($socket, SOL_SOCKET, SO_REUSEADDR, 1)) {
|
||||
$this->throwSocketError('Unable to set reuse-address on socket');
|
||||
}
|
||||
|
||||
// Uncomment this if server requires a certain client-side port to be used
|
||||
// if (!socket_bind($socket, "0.0.0.0", $localPort)) {
|
||||
// $this->throwSocketError('Unable to bind socket');
|
||||
// }
|
||||
|
||||
$result = null;
|
||||
try {
|
||||
$result = socket_connect($socket, $host, $port);
|
||||
} catch (Exception) {
|
||||
$this->throwSocketError("Failed to connect to server ($host:$port)");
|
||||
}
|
||||
if (!$result) {
|
||||
$this->throwSocketError("Failed to connect to server ($host:$port)");
|
||||
}
|
||||
|
||||
$this->socket = $socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* @throws HL7ConnectionException
|
||||
*/
|
||||
protected function throwSocketError(string $message): void
|
||||
{
|
||||
throw new HL7ConnectionException($message . ': ' . socket_strerror(socket_last_error()));
|
||||
}
|
||||
|
||||
/**
|
||||
* Sends a Message object over this connection.
|
||||
*
|
||||
* @param string $responseCharEncoding The expected character encoding of the response.
|
||||
* @param bool $noWait Do no wait for ACK. Helpful for building load testing tools...
|
||||
* @throws HL7ConnectionException
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function send(Message $msg, string $responseCharEncoding = 'UTF-8', bool $noWait = false): ?Message
|
||||
{
|
||||
$message = $this->MESSAGE_PREFIX . $msg->toString(true) . $this->MESSAGE_SUFFIX; // As per MLLP protocol
|
||||
if (!socket_write($this->socket, $message, strlen($message))) {
|
||||
throw new HL7Exception("Could not send data to server: " . socket_strerror(socket_last_error()));
|
||||
}
|
||||
|
||||
if ($noWait) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$data = null;
|
||||
|
||||
$startTime = time();
|
||||
while (($buf = socket_read($this->socket, 1024)) !== false) { // Read ACK / NACK from server
|
||||
$data .= $buf;
|
||||
if (preg_match('/' . $this->MESSAGE_SUFFIX . '$/', $data)) {
|
||||
break;
|
||||
}
|
||||
if ((time() - $startTime) > $this->timeout) {
|
||||
throw new HL7ConnectionException(
|
||||
"Response partially received. Timed out listening for end-of-message from server"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (empty($data)) {
|
||||
throw new HL7ConnectionException("No response received within {$this->timeout} seconds");
|
||||
}
|
||||
|
||||
// Remove message prefix and suffix added by the MLLP server
|
||||
$data = preg_replace('/^' . $this->MESSAGE_PREFIX . '/', '', $data);
|
||||
$data = preg_replace('/' . $this->MESSAGE_SUFFIX . '$/', '', $data);
|
||||
|
||||
// set character encoding
|
||||
$data = mb_convert_encoding($data, $responseCharEncoding);
|
||||
|
||||
return new Message($data, null, true, true);
|
||||
}
|
||||
|
||||
/*
|
||||
* Return the raw socket opened/used by this class
|
||||
*/
|
||||
public function getSocket(): Socket
|
||||
{
|
||||
return $this->socket;
|
||||
}
|
||||
|
||||
/**
|
||||
* Close the socket
|
||||
* TODO: Close only when the socket is open
|
||||
*/
|
||||
private function close(): void
|
||||
{
|
||||
try {
|
||||
socket_close($this->socket);
|
||||
} catch (Exception $e) {
|
||||
echo 'Failed to close socket: ' . socket_strerror(socket_last_error()) . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->close();
|
||||
}
|
||||
}
|
||||
+483
@@ -0,0 +1,483 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7;
|
||||
|
||||
use Aranyasen\Exceptions\HL7Exception;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* Class specifying the HL7 message, both request and response.
|
||||
*
|
||||
* In general one needn't create an instance of the Message class directly, but use the HL7 factory class to create one.
|
||||
* When adding segments, note that the segment index starts at 0, so to get the first segment, do
|
||||
* ```php $msg->getSegmentByIndex(0) ```
|
||||
*
|
||||
* The segment separator defaults to \015. To change this, set the global variable $SEGMENT_SEPARATOR.
|
||||
*/
|
||||
class Message
|
||||
{
|
||||
use MessageHelpersTrait;
|
||||
|
||||
protected array $segments = [];
|
||||
|
||||
protected string $segmentSeparator;
|
||||
protected bool $segmentEndingBar; # true, if '|' at end of each segment is needed
|
||||
protected $fieldSeparator;
|
||||
protected string $componentSeparator;
|
||||
protected string $subcomponentSeparator;
|
||||
protected string $repetitionSeparator;
|
||||
protected string $escapeChar;
|
||||
protected $hl7Version;
|
||||
|
||||
// Split (or not) repeated subfields joined by ~. E.g. if true, parses 3^0~4^1 to [3, '0~4', 1]
|
||||
protected bool $doNotSplitRepetition;
|
||||
|
||||
/**
|
||||
* Constructor for Message. Consider using the HL7 factory to obtain a message instead.
|
||||
*
|
||||
* The constructor takes an optional string argument that is a string representation of a HL7 message. If the
|
||||
* string representation is not a valid HL7 message. according to the specifications, undef is returned instead of
|
||||
* a new instance. This means that segments should be separated within the message with the segment separator
|
||||
* (defaults to \015) or a newline, and segments should be syntactically correct. When using the string argument
|
||||
* constructor, make sure that you have escaped any characters that would have special meaning in PHP.
|
||||
*
|
||||
* The control characters and field separator will take the values from the MSH segment, if set. Otherwise defaults
|
||||
* will be used. Changing the MSH fields specifying the field separator and control characters after the MSH has
|
||||
* been added to the message will result in setting these values for the message.
|
||||
*
|
||||
* If the message couldn't be created, for example due to a erroneous HL7 message string, an error is raised.
|
||||
* @param string|null $msgStr
|
||||
* @param array|null $hl7Globals Set control characters or HL7 properties. e.g., ['HL7_VERSION' => '2.5']
|
||||
* @param bool $keepEmptySubFields Set this to true to retain empty sub-fields
|
||||
* @param bool $resetIndices Reset Indices of each segment to 1.
|
||||
* @param bool $autoIncrementIndices True: auto-increment for each instance of same segment.
|
||||
* @param bool|null $doNotSplitRepetition If true, repeated segments will be in single array instead of sub-arrays.
|
||||
* Note: Since this is non-standard, it may be removed in future!
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function __construct(
|
||||
?string $msgStr = null,
|
||||
?array $hl7Globals = null,
|
||||
bool $keepEmptySubFields = false,
|
||||
bool $resetIndices = false,
|
||||
bool $autoIncrementIndices = true,
|
||||
?bool $doNotSplitRepetition = null
|
||||
) {
|
||||
// Control characters and other HL7 properties
|
||||
$this->segmentSeparator = $hl7Globals['SEGMENT_SEPARATOR'] ?? '\n';
|
||||
$this->segmentEndingBar = $hl7Globals['SEGMENT_ENDING_BAR'] ?? true;
|
||||
$this->fieldSeparator = $hl7Globals['FIELD_SEPARATOR'] ?? '|';
|
||||
$this->componentSeparator = $hl7Globals['COMPONENT_SEPARATOR'] ?? '^';
|
||||
$this->subcomponentSeparator = $hl7Globals['SUBCOMPONENT_SEPARATOR'] ?? '&';
|
||||
$this->repetitionSeparator = $hl7Globals['REPETITION_SEPARATOR'] ?? '~';
|
||||
$this->escapeChar = $hl7Globals['ESCAPE_CHARACTER'] ?? '\\';
|
||||
$this->hl7Version = $hl7Globals['HL7_VERSION'] ?? '2.3';
|
||||
|
||||
$this->doNotSplitRepetition = (bool) $doNotSplitRepetition;
|
||||
|
||||
if ($resetIndices) {
|
||||
$this->resetSegmentIndices();
|
||||
}
|
||||
|
||||
// If no HL7 string is passed to the constructor, nothing else to do
|
||||
if (!$msgStr) {
|
||||
return;
|
||||
}
|
||||
|
||||
$segments = preg_split("/[\n\r" . $this->segmentSeparator . ']/', $msgStr, -1, PREG_SPLIT_NO_EMPTY);
|
||||
$this->setSeparators($segments[0]); // First segment is MSH, the control segment
|
||||
|
||||
// Do all segments
|
||||
foreach ($segments as $index => $segmentString) {
|
||||
$fields = preg_split("/\\" . $this->fieldSeparator . '/', $segmentString);
|
||||
$segmentName = array_shift($fields);
|
||||
|
||||
foreach ($fields as $j => $field) {
|
||||
// Skip control field (i.e. first field in MSH segment)
|
||||
if ($index === 0 && $j === 0) {
|
||||
continue;
|
||||
}
|
||||
|
||||
$fields[$j] = $this->extractComponentsFromField($field, $keepEmptySubFields);
|
||||
}
|
||||
|
||||
$segment = $this->getSegmentClass($segmentName, $fields, $autoIncrementIndices);
|
||||
|
||||
$this->addSegment($segment);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Append a segment to the end of the message
|
||||
*/
|
||||
public function addSegment(Segment $segment): bool
|
||||
{
|
||||
if (count($this->segments) === 0) {
|
||||
$this->resetCtrl($segment);
|
||||
}
|
||||
|
||||
$this->segments[] = $segment;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Insert a segment.
|
||||
*
|
||||
* @param null|int $index Index where segment is inserted
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function insertSegment(Segment $segment, ?int $index = null): void
|
||||
{
|
||||
if ($index > count($this->segments)) {
|
||||
throw new InvalidArgumentException("Index out of range. Index: $index, Total segments: " .
|
||||
count($this->segments));
|
||||
}
|
||||
|
||||
if ($index === 0) {
|
||||
$this->resetCtrl($segment);
|
||||
array_unshift($this->segments, $segment);
|
||||
} elseif ($index === count($this->segments)) {
|
||||
$this->segments[] = $segment;
|
||||
} else {
|
||||
$this->segments =
|
||||
array_merge(
|
||||
array_slice($this->segments, 0, $index),
|
||||
[$segment],
|
||||
array_slice($this->segments, $index)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the segment specified by $index.
|
||||
*
|
||||
* Note: Segment count within the message starts at 0.
|
||||
*
|
||||
* @param int $index Index where segment is inserted
|
||||
*/
|
||||
public function getSegmentByIndex(int $index): ?Segment
|
||||
{
|
||||
if ($index >= count($this->segments)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->segments[$index];
|
||||
}
|
||||
|
||||
public function getSegmentIndex(Segment $segment): ?int
|
||||
{
|
||||
foreach ($this->segments as $ii => $value) {
|
||||
if ($value === $segment) {
|
||||
return $ii;
|
||||
}
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of all segments with the given name
|
||||
*
|
||||
* @param string $name Segment name
|
||||
* @return array List of segments identified by name
|
||||
*/
|
||||
public function getSegmentsByName(string $name): array
|
||||
{
|
||||
$segmentsByName = [];
|
||||
|
||||
foreach ($this->segments as $segment) {
|
||||
if ($segment->getName() === $name) {
|
||||
$segmentsByName[] = $segment;
|
||||
}
|
||||
}
|
||||
|
||||
return $segmentsByName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array of all segments with the given subclass of Segment
|
||||
*
|
||||
* @param string $name Segment class
|
||||
* @return array List of segments identified by class
|
||||
*/
|
||||
public function getSegmentsByClass(string $segmentClass): array
|
||||
{
|
||||
if (!is_subclass_of($segmentClass, Segment::class)) {
|
||||
throw new HL7Exception("$segmentClass is not a subclass of " . Segment::class);
|
||||
}
|
||||
$segmentsByClass = [];
|
||||
|
||||
foreach ($this->segments as $segment) {
|
||||
if ($segment instanceof $segmentClass) {
|
||||
$segmentsByClass[] = $segment;
|
||||
}
|
||||
}
|
||||
|
||||
return $segmentsByClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove the segment indexed by $index.
|
||||
*
|
||||
* If it doesn't exist, nothing happens, if it does, all segments
|
||||
* after this one will be moved one index up.
|
||||
*
|
||||
* @param int $index Index where segment is removed
|
||||
*/
|
||||
public function removeSegmentByIndex(int $index): bool
|
||||
{
|
||||
if ($index < count($this->segments)) {
|
||||
array_splice($this->segments, $index, 1);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove given segment
|
||||
*
|
||||
* @return int Count of segments removed
|
||||
*/
|
||||
public function removeSegmentsByName(string $segmentName): int
|
||||
{
|
||||
$count = 0;
|
||||
foreach ($this->getSegmentsByName($segmentName) as $segment) {
|
||||
$this->removeSegmentByIndex($this->getSegmentIndex($segment));
|
||||
$count++;
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove given segment
|
||||
*
|
||||
* @return int Count of segments removed
|
||||
*/
|
||||
public function removeSegmentsByClass(string $segmentClass): int
|
||||
{
|
||||
if (!is_subclass_of($segmentClass, Segment::class)) {
|
||||
throw new HL7Exception("$segmentClass is not a subclass of " . Segment::class);
|
||||
}
|
||||
$count = 0;
|
||||
foreach ($this->getSegmentsByClass($segmentClass) as $segment) {
|
||||
$this->removeSegmentByIndex($this->getSegmentIndex($segment));
|
||||
$count++;
|
||||
}
|
||||
return $count;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the segment on index.
|
||||
*
|
||||
* If index is out of range, or not provided, do nothing. Setting MSH on index 0 will re-validate field separator,
|
||||
* control characters and hl7 version, based on MSH(1), MSH(2) and MSH(12).
|
||||
*
|
||||
* @param int $index Index where segment is set
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function setSegment(Segment $segment, int $index): bool
|
||||
{
|
||||
if ($index > count($this->segments)) {
|
||||
throw new InvalidArgumentException('Index out of range');
|
||||
}
|
||||
|
||||
if ($index === 0 && $segment->getName() === 'MSH') {
|
||||
$this->resetCtrl($segment);
|
||||
}
|
||||
|
||||
$this->segments[$index] = $segment;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* After change of MSH, reset control fields
|
||||
*/
|
||||
protected function resetCtrl(Segment $segment): bool
|
||||
{
|
||||
if ($segment->getField(1)) {
|
||||
$this->fieldSeparator = $segment->getField(1);
|
||||
}
|
||||
|
||||
if (preg_match('/(.)(.)(.)(.)/', (string) $segment->getField(2), $matches)) {
|
||||
$this->componentSeparator = $matches[1];
|
||||
$this->repetitionSeparator = $matches[2];
|
||||
$this->escapeChar = $matches[3];
|
||||
$this->subcomponentSeparator = $matches[4];
|
||||
}
|
||||
|
||||
if ($segment->getField(12)) {
|
||||
$this->hl7Version = $segment->getField(12);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return an array containing all segments in the right order.
|
||||
*
|
||||
* @return array List of all segments
|
||||
*/
|
||||
public function getSegments(): array
|
||||
{
|
||||
return $this->segments;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a string representation of this message.
|
||||
*
|
||||
* This can be used to send the message over a socket to an HL7 server. To print to other output, use the $pretty
|
||||
* argument as some true value. This will not use the default segment separator, but '\n' instead.
|
||||
*
|
||||
* @param boolean $pretty Whether to use \n as separator or default (\r).
|
||||
* @return mixed String representation of HL7 message
|
||||
* @access public
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function toString(bool $pretty = false)
|
||||
{
|
||||
if (empty($this->segments)) {
|
||||
throw new HL7Exception('Message contains no data. Can not convert to string');
|
||||
}
|
||||
|
||||
// Make sure MSH(1) and MSH(2) are ok, even if someone has changed these values
|
||||
$this->resetCtrl($this->segments[0]);
|
||||
|
||||
$message = '';
|
||||
foreach ($this->segments as $segment) {
|
||||
$segmentString = $this->segmentToString($segment);
|
||||
if (!$this->segmentEndingBar) {
|
||||
$segmentString = preg_replace('/\|$/', '', $segmentString);
|
||||
}
|
||||
$message .= $segmentString;
|
||||
$message .= $pretty
|
||||
? str_replace(['\r', '\n'], ["\r", "\n"], $this->segmentSeparator)
|
||||
: $this->segmentSeparator;
|
||||
}
|
||||
|
||||
return $message;
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert Segment object to string
|
||||
*/
|
||||
public function segmentToString(Segment $segment): string
|
||||
{
|
||||
$segmentName = $segment->getName();
|
||||
$segmentString = $segmentName . $this->fieldSeparator;
|
||||
$fields = $segment->getFields(($segmentName === 'MSH' ? 2 : 1));
|
||||
|
||||
foreach ($fields as $field) {
|
||||
if (is_array($field)) {
|
||||
foreach ($field as $index => $value) {
|
||||
is_array($value)
|
||||
? ($segmentString .= implode($this->subcomponentSeparator, $value))
|
||||
: ($segmentString .= $value);
|
||||
|
||||
if ($index < (count($field) - 1)) {
|
||||
$segmentString .= $this->componentSeparator;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$segmentString .= $field;
|
||||
}
|
||||
|
||||
$segmentString .= $this->fieldSeparator;
|
||||
}
|
||||
|
||||
return $segmentString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index attribute of each given segment, so when those are added the indices start from 1
|
||||
*/
|
||||
public function resetSegmentIndices(): void
|
||||
{
|
||||
$reflector = new \ReflectionClass($this);
|
||||
$segments = glob(dirname($reflector->getFileName()) . '/Segments/*.php');
|
||||
|
||||
// Go through each available segment class and reset its ID
|
||||
foreach ($segments as $file) { // ['OBR', 'PID', 'OBX', 'IN1'...]
|
||||
$className = "Aranyasen\\HL7\\Segments\\" . pathinfo($file, PATHINFO_FILENAME);
|
||||
if (class_exists($className) && method_exists($className, 'resetIndex')) {
|
||||
$className::resetIndex();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private function extractComponentsFromField(string $field, bool $keepEmptySubFields): array|string
|
||||
{
|
||||
$pregFlags = $keepEmptySubFields
|
||||
? 0
|
||||
: PREG_SPLIT_NO_EMPTY;
|
||||
|
||||
if ((str_contains($field, $this->repetitionSeparator)) && (! $this->doNotSplitRepetition)) {
|
||||
$components = preg_split("/\\" . $this->repetitionSeparator . '/', $field, -1, $pregFlags);
|
||||
$fields = [];
|
||||
foreach ($components as $index => $component) {
|
||||
$fields[$index] = $this->extractComponentsFromField($component, $keepEmptySubFields);
|
||||
}
|
||||
|
||||
return $fields;
|
||||
}
|
||||
|
||||
$components = preg_split("/\\" . $this->componentSeparator . '/', $field, -1, $pregFlags);
|
||||
foreach ($components as $index => $component) {
|
||||
$subComps = preg_split("/\\" . $this->subcomponentSeparator . '/', $component);
|
||||
// Make it a ref or just the value
|
||||
$components[$index] = count($subComps) === 1
|
||||
? $subComps[0]
|
||||
: $subComps;
|
||||
}
|
||||
|
||||
return count($components) === 1
|
||||
? $components[0]
|
||||
: $components;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set various separators - segment, field etc.
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
private function setSeparators(string $msh): void
|
||||
{
|
||||
if (!preg_match('/^([A-Z0-9]{3})(.)(.)(.)(.)(.)(.)/', $msh, $matches)) {
|
||||
throw new HL7Exception('Not a valid message: invalid control segment', E_USER_ERROR);
|
||||
}
|
||||
|
||||
[, , $fieldSep, $compSep, $repSep, $esc, $subCompSep, $fieldSepCtrl] = $matches;
|
||||
|
||||
// Check whether field separator is repeated after 4 control characters
|
||||
if ($fieldSep !== $fieldSepCtrl) {
|
||||
throw new HL7Exception('Not a valid message: field separator invalid', E_USER_ERROR);
|
||||
}
|
||||
|
||||
// Set field separator based on control segment
|
||||
$this->fieldSeparator = $fieldSep;
|
||||
|
||||
// Set other separators
|
||||
$this->componentSeparator = $compSep;
|
||||
$this->subcomponentSeparator = $subCompSep;
|
||||
$this->escapeChar = $esc;
|
||||
$this->repetitionSeparator = $repSep;
|
||||
}
|
||||
|
||||
private function getSegmentClass(string $segmentName, array $fields, bool $autoIncrementIndices): Segment
|
||||
{
|
||||
// If a class exists for the segment under segments/, (e.g., MSH)
|
||||
$className = "Aranyasen\\HL7\\Segments\\$segmentName";
|
||||
if (!class_exists($className)) {
|
||||
return new Segment($segmentName, $fields);
|
||||
}
|
||||
|
||||
if ($segmentName === 'MSH') {
|
||||
array_unshift($fields, $this->fieldSeparator); # First field for MSH is '|'
|
||||
return new $className($fields);
|
||||
}
|
||||
|
||||
return new $className($fields, $autoIncrementIndices);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7;
|
||||
|
||||
use Aranyasen\Exceptions\HL7Exception;
|
||||
use Aranyasen\HL7\Segments\MSH;
|
||||
|
||||
trait MessageHelpersTrait
|
||||
{
|
||||
/**
|
||||
* Get the segment identified by index as string, using the messages separators.
|
||||
*
|
||||
* @param int $index Index for segment to get
|
||||
* @return string|null String representation of segment
|
||||
*/
|
||||
public function getSegmentAsString(int $index): ?string
|
||||
{
|
||||
$segment = $this->getSegmentByIndex($index);
|
||||
|
||||
if ($segment === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->segmentToString($segment);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the field identified by $fieldIndex from segment $segmentIndex.
|
||||
*
|
||||
* Returns empty string if field is not set.
|
||||
*
|
||||
* @param int $segmentIndex Index for segment to get
|
||||
* @param int $fieldIndex Index for field to get
|
||||
* @return null|string String representation of field
|
||||
*/
|
||||
public function getSegmentFieldAsString(int $segmentIndex, int $fieldIndex): ?string
|
||||
{
|
||||
$segment = $this->getSegmentByIndex($segmentIndex);
|
||||
|
||||
if ($segment === null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$field = $segment->getField($fieldIndex);
|
||||
|
||||
if (!$field) {
|
||||
return null;
|
||||
}
|
||||
|
||||
$fieldString = null;
|
||||
|
||||
if (\is_array($field)) {
|
||||
foreach ($field as $i => $value) {
|
||||
\is_array($value)
|
||||
? ($fieldString .= implode($this->subcomponentSeparator, $value))
|
||||
: ($fieldString .= $value);
|
||||
|
||||
if ($i < (\count($field) - 1)) {
|
||||
$fieldString .= $this->componentSeparator;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$fieldString .= $field;
|
||||
}
|
||||
|
||||
return $fieldString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Write HL7 to a file
|
||||
*
|
||||
* @throws HL7Exception
|
||||
*/
|
||||
public function toFile(string $filename): void
|
||||
{
|
||||
file_put_contents($filename, $this->toString(true));
|
||||
if (!file_exists($filename)) {
|
||||
throw new HL7Exception("Failed to write HL7 to file '$filename'");
|
||||
}
|
||||
}
|
||||
|
||||
public function isOrm(): bool
|
||||
{
|
||||
/** @var MSH $msh */
|
||||
$msh = $this->getFirstSegmentInstance('MSH');
|
||||
return str_contains($msh->getMessageType(), 'ORM');
|
||||
}
|
||||
|
||||
public function isOru(): bool
|
||||
{
|
||||
/** @var MSH $msh */
|
||||
$msh = $this->getFirstSegmentInstance('MSH');
|
||||
return str_contains($msh->getMessageType(), 'ORU');
|
||||
}
|
||||
|
||||
public function isAdt(): bool
|
||||
{
|
||||
/** @var MSH $msh */
|
||||
$msh = $this->getFirstSegmentInstance('MSH');
|
||||
return str_contains($msh->getMessageType(), 'ADT');
|
||||
}
|
||||
|
||||
public function isSiu(): bool
|
||||
{
|
||||
/** @var MSH $msh */
|
||||
$msh = $this->getFirstSegmentInstance('MSH');
|
||||
return str_contains($msh->getMessageType(), 'SIU');
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if given segment is present in the message object
|
||||
*/
|
||||
public function hasSegment(string $segment): bool
|
||||
{
|
||||
return count($this->getSegmentsByName(strtoupper($segment))) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if given segment is present in the message object by class name
|
||||
*/
|
||||
public function hasSegmentOfClass(string $segmentClass): bool
|
||||
{
|
||||
return count($this->getSegmentsByClass($segmentClass)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if given segment is present in the message object by class name
|
||||
*/
|
||||
public function hasSegmentByClass(string $segmentClass): bool
|
||||
{
|
||||
return count($this->getSegmentsByClass($segmentClass)) > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the first segment with given name in the message
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function getFirstSegmentInstance(string $segment)
|
||||
{
|
||||
if (!$this->hasSegment($segment)) {
|
||||
return null;
|
||||
}
|
||||
return $this->getSegmentsByName($segment)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the first segment of the given class in the message
|
||||
*
|
||||
* @return mixed|null
|
||||
*/
|
||||
public function getFirstSegmentInstanceByClass(string $segmentClass)
|
||||
{
|
||||
if (!$this->hasSegmentOfClass($segmentClass)) {
|
||||
return null;
|
||||
}
|
||||
return $this->getSegmentsByClass($segmentClass)[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* @param bool $reIndex After deleting, re-index remaining segments of same name
|
||||
*/
|
||||
public function removeSegment(Segment $segment, bool $reIndex = false): void
|
||||
{
|
||||
if (($key = array_search($segment, $this->segments, true)) !== false) {
|
||||
unset($this->segments[$key]);
|
||||
}
|
||||
|
||||
if (!$reIndex) {
|
||||
return;
|
||||
}
|
||||
|
||||
$segments = $this->getSegmentsByName($segment->getName());
|
||||
$index = 1;
|
||||
/** @var Segment $segment */
|
||||
foreach ($segments as $segment) {
|
||||
$segment->setField(1, $index++);
|
||||
}
|
||||
}
|
||||
|
||||
public function isEmpty(): bool
|
||||
{
|
||||
return empty($this->getSegments());
|
||||
}
|
||||
}
|
||||
+121
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Messages;
|
||||
|
||||
use Aranyasen\HL7\Message;
|
||||
use Aranyasen\HL7\Segments\MSA;
|
||||
use Aranyasen\HL7\Segments\MSH;
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
|
||||
class ACK extends Message
|
||||
{
|
||||
protected string $ACK_TYPE;
|
||||
|
||||
/**
|
||||
* Usage:
|
||||
* ```php
|
||||
* $ack = new ACK($requestMessage);
|
||||
* ```
|
||||
*
|
||||
* Convenience module implementing an acknowledgement (ACK) message. This can be used in HL7 servers to create an
|
||||
* acknowledgement for an incoming message.
|
||||
*
|
||||
* @param Message|null $req
|
||||
* @param MSH|null $reqMsh
|
||||
* @param array|null $hl7Globals Set control characters or HL7 properties. e.g., ['HL7_VERSION' => '2.5']
|
||||
* @throws Exception
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(?Message $req = null, ?MSH $reqMsh = null, ?array $hl7Globals = null)
|
||||
{
|
||||
parent::__construct(null, $hl7Globals);
|
||||
|
||||
if ($req) {
|
||||
$msh = $req->getSegmentByIndex(0);
|
||||
|
||||
if ($msh) {
|
||||
$msh = new MSH($msh->getFields(1), $hl7Globals);
|
||||
} else {
|
||||
$msh = new MSH(null, $hl7Globals);
|
||||
}
|
||||
} else {
|
||||
$msh = new MSH(null, $hl7Globals);
|
||||
}
|
||||
|
||||
$msa = new MSA();
|
||||
|
||||
// Determine acknowledge mode: normal or enhanced
|
||||
//
|
||||
if ($req && ($msh->getField(15) || $msh->getField(16))) {
|
||||
$this->ACK_TYPE = 'E';
|
||||
$msa->setAcknowledgementCode('CA');
|
||||
} else {
|
||||
$this->ACK_TYPE = 'N';
|
||||
$msa->setAcknowledgementCode('AA');
|
||||
}
|
||||
|
||||
$this->addSegment($msh);
|
||||
$this->addSegment($msa);
|
||||
|
||||
$msh->setField(9, 'ACK');
|
||||
|
||||
// Construct an ACK based on the request
|
||||
if ($req && $reqMsh) {
|
||||
$msh->setField(3, $reqMsh->getReceivingApplication());
|
||||
$msh->setField(4, $reqMsh->getReceivingFacility());
|
||||
$msh->setField(5, $reqMsh->getSendingApplication());
|
||||
$msh->setField(6, $reqMsh->getSendingFacility());
|
||||
$msa->setMessageControlID($reqMsh->getMessageControlId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the acknowledgement code for the acknowledgement.
|
||||
*
|
||||
* Code should be one of: A, E, R. Codes can be prepended with C or A, denoting enhanced or normal acknowledge mode.
|
||||
* This denotes: accept, general error and reject respectively. The ACK module will determine the right answer mode
|
||||
* (normal or enhanced) based upon the request, if not provided. The message provided in $msg will be set in MSA 3.
|
||||
*
|
||||
* @param string $code Code to use in acknowledgement
|
||||
* @param string|null $msg Acknowledgement message
|
||||
*/
|
||||
public function setAckCode(string $code, ?string $msg = null): bool
|
||||
{
|
||||
$mode = 'A';
|
||||
|
||||
// Determine acknowledge mode: normal or enhanced
|
||||
//
|
||||
if ($this->ACK_TYPE === 'E') {
|
||||
$mode = 'C';
|
||||
}
|
||||
|
||||
if (\strlen($code) === 1) {
|
||||
$code = "$mode$code";
|
||||
}
|
||||
|
||||
$seg1 = $this->getSegmentByIndex(1);
|
||||
if (!empty($seg1)) {
|
||||
$seg1->setField(1, $code);
|
||||
}
|
||||
if ($msg) {
|
||||
$seg1->setField(3, $msg);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the error message for acknowledgement.
|
||||
*
|
||||
* This will also set the error code to either AE or CE, depending on the mode of the incoming message.
|
||||
*
|
||||
* @param string $msg Error message
|
||||
*/
|
||||
public function setErrorMessage(string $msg): void
|
||||
{
|
||||
$this->setAckCode('E', $msg);
|
||||
}
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aranyasen\HL7;
|
||||
|
||||
class Request
|
||||
{
|
||||
//
|
||||
}
|
||||
+8
@@ -0,0 +1,8 @@
|
||||
<?php
|
||||
|
||||
namespace Aranyasen\HL7;
|
||||
|
||||
class Response
|
||||
{
|
||||
//
|
||||
}
|
||||
+164
@@ -0,0 +1,164 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7;
|
||||
|
||||
use InvalidArgumentException;
|
||||
|
||||
class Segment
|
||||
{
|
||||
protected array $fields = [];
|
||||
|
||||
/**
|
||||
* Create a segment.
|
||||
*
|
||||
* A segment may be created with just a name or a name and an array of field values. The segment name should be a
|
||||
* standard HL7 segment (e.g. MSH / PID etc.) that is three characters long, and upper case. If an array is given,
|
||||
* all fields will be filled from that array. Note that for composed fields and sub-components, the array may hold
|
||||
* sub-arrays and sub-sub-arrays. Repeated fields can not be supported the same way, since we can't distinguish
|
||||
* between composed fields and repeated fields.
|
||||
*
|
||||
* Example:
|
||||
* ```php
|
||||
* $seg = new Segment("PID");
|
||||
*
|
||||
* $seg->setField(3, "12345678");
|
||||
* echo $seg->getField(1);
|
||||
* ```
|
||||
*
|
||||
* @author Aranya Sen
|
||||
* @param string $name Name of the segment
|
||||
* @param array|null $fields Fields for segment
|
||||
* @throws InvalidArgumentException
|
||||
*/
|
||||
public function __construct(string $name, ?array $fields = null)
|
||||
{
|
||||
// Is the name 3 upper case characters?
|
||||
if ((!$name) || (strlen($name) !== 3) || (strtoupper($name) !== $name)) {
|
||||
throw new InvalidArgumentException("Segment name '$name' should be 3 characters and in uppercase");
|
||||
}
|
||||
|
||||
$this->fields[0] = $name;
|
||||
|
||||
if (is_array($fields)) {
|
||||
foreach ($fields as $i => $value) {
|
||||
$this->setField($i + 1, $value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the field specified by index to value.
|
||||
*
|
||||
* Indices start at 1, to stay with the HL7 standard. Trying to set the
|
||||
* value at index 0 has no effect. The value may also be a reference to an array (that may itself contain arrays)
|
||||
* to support composite fields (and sub-components).
|
||||
*
|
||||
* Examples:
|
||||
* ```php
|
||||
* $segment->setField(18, 'abcd'); // Sets 18th field to abcd
|
||||
* $segment->setField(8, 'ab^cd'); // Sets 8th field to ab^cd
|
||||
* $segment->setField(10, ['John', 'Doe']); // Sets 10th field to John^Doe
|
||||
* $segment->setField(12, ['']); // Sets 12th field to ''
|
||||
* ```
|
||||
*
|
||||
* If values are not provided at all, the method will just return.
|
||||
*
|
||||
* @param int $index Index to set
|
||||
*/
|
||||
public function setField(int $index, string|int|array|null $value = ''): bool
|
||||
{
|
||||
if ($index === 0) { // Do not allow changing 0th index, which is the name of the segment
|
||||
return false;
|
||||
}
|
||||
|
||||
if ($this->isValueEmpty($value)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Fill in the blanks...
|
||||
for ($i = count($this->fields); $i < $index; $i++) {
|
||||
$this->fields[$i] = '';
|
||||
}
|
||||
|
||||
$this->fields[$index] = $value;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private function isValueEmpty($value): bool
|
||||
{
|
||||
if (is_array($value)) {
|
||||
return empty($value);
|
||||
}
|
||||
|
||||
if ((string) $value === '0') { // Allow 0
|
||||
return false;
|
||||
}
|
||||
|
||||
return ! $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* Remove any existing value from the field
|
||||
*
|
||||
* @param int $index Field index
|
||||
*/
|
||||
public function clearField(int $index): void
|
||||
{
|
||||
$this->fields[$index] = null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the field at index.
|
||||
*
|
||||
* If the field is a composite field, it returns an array
|
||||
* Example:
|
||||
* ```php
|
||||
* $field = $seg->getField(9); // Returns a string/null/array depending on what the 9th field is.
|
||||
* ```
|
||||
*/
|
||||
public function getField(int $index): array|string|int|null
|
||||
{
|
||||
return $this->fields[$index] ?? null;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the number of fields for this segment, not including the name
|
||||
*
|
||||
* @return int number of fields
|
||||
*/
|
||||
public function size(): int
|
||||
{
|
||||
return count($this->fields) - 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get fields from a segment
|
||||
*
|
||||
* Get the fields in the specified range, or all if nothing specified. If only the 'from' value is provided, all
|
||||
* fields from this index till the end of the segment will be returned.
|
||||
*
|
||||
* @param int $from Start range at this index
|
||||
* @param int|null $to Stop range at this index
|
||||
* @return array List of fields
|
||||
*/
|
||||
public function getFields(int $from = 0, ?int $to = null): array
|
||||
{
|
||||
if (!$to) {
|
||||
$to = count($this->fields);
|
||||
}
|
||||
return array_slice($this->fields, $from, $to - $from + 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the name of the segment. This is basically the value at index 0
|
||||
*
|
||||
* @return string Name of segment
|
||||
*/
|
||||
public function getName(): string
|
||||
{
|
||||
return $this->fields[0];
|
||||
}
|
||||
}
|
||||
+187
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* AIG segment class
|
||||
*
|
||||
* AIG: Appointment information - general resource segment
|
||||
* The AIG segment contains information about various kinds of resources (other than those with specifically defined
|
||||
* segments in this chapter) that can be scheduled. Resources included in a transaction using this segment are assumed
|
||||
* to be controlled by a schedule on a schedule filler application. Resources not controlled by a schedule are not
|
||||
* identified on a schedule request using this segment. Resources described by this segment are general kinds of
|
||||
* resources, such as equipment, that are identified with a simple identification code.
|
||||
|
||||
* Ref: http://hl7-definition.caristix.com:9010/Default.aspx?version=HL7+v2.3.1&segment=AIG
|
||||
*/
|
||||
class AIG 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('AIG', $fields);
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSegmentActionCode($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceID($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceType($value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceGroup($value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceQuantity($value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceQuantityUnits($value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTime($value, int $position = 8): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTimeOffset($value, int $position = 9): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTimeOffsetUnits($value, int $position = 10): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDuration($value, int $position = 11): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDurationUnits($value, int $position = 12): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAllowSubstitutionCode($value, int $position = 13): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerStatusCode($value, int $position = 14): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSegmentActionCode(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceID(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceType(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceGroup(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceQuantity(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceQuantityUnits(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTime(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTimeOffset(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTimeOffsetUnits(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDuration(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDurationUnits(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAllowSubstitutionCode(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerStatusCode(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* AIL segment class
|
||||
*
|
||||
* AIL: Appointment Information - Location Resource
|
||||
*
|
||||
* The AIL segment contains information about location resources (meeting rooms, operating rooms, examination rooms, or
|
||||
* other locations) that can be scheduled. Resources included in a transaction using this segment are assumed to be
|
||||
* controlled by a schedule on a schedule filler application. Resources not controlled by a schedule are not identified
|
||||
* on a schedule request using this segment. Location resources are identified with this specific segment because of the
|
||||
* specific encoding of locations used by the HL7 specification.
|
||||
|
||||
* Ref: http://hl7-definition.caristix.com:9010/Default.aspx?version=HL7+v2.5.1&segment=AIL
|
||||
*/
|
||||
class AIL 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('AIL', $fields);
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSegmentActionCode($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLocationResourceID($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLocationTypeAIL($value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLocationGroup($value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTime($value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTimeOffset($value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTimeOffsetUnits($value, int $position = 8): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDuration($value, int $position = 9): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDurationUnits($value, int $position = 10): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAllowSubstitutionCode($value, int $position = 11): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerStatusCode($value, int $position = 12): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSegmentActionCode(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLocationResourceID(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLocationTypeAIL(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLocationGroup(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTime(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTimeOffset(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTimeOffsetUnits(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDuration(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDurationUnits(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAllowSubstitutionCode(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerStatusCode(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+168
@@ -0,0 +1,168 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* AIP segment class
|
||||
*
|
||||
* AIP: Appointment Information - Personnel Resource
|
||||
* The AIP segment contains information about the personnel types that can be scheduled. Personnel included in a
|
||||
* transaction using this segment are assumed to be controlled by a schedule on a schedule filler application.
|
||||
* Personnel not controlled by a schedule are not identified on a schedule request using this segment. The kinds of
|
||||
* personnel described on this segment include any healthcare provider in the institution controlled by a schedule (for
|
||||
* example: technicians, physicians, nurses, surgeons, anesthesiologists, or CRNAs).
|
||||
|
||||
|
||||
* Ref: http://hl7-definition.caristix.com:9010/Default.aspx?version=HL7+v2.5.1&segment=AIP
|
||||
*/
|
||||
class AIP 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('AIP', $fields);
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSegmentActionCode($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPersonnelResourceID($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceType($value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceGroup($value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTime($value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTimeOffset($value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTimeOffsetUnits($value, int $position = 8): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDuration($value, int $position = 9): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDurationUnits($value, int $position = 10): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAllowSubstitutionCode($value, int $position = 11): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerStatusCode($value, int $position = 12): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSegmentActionCode(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPersonnelResourceID(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceType(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceGroup(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTime(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTimeOffset(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTimeOffsetUnits(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDuration(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDurationUnits(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAllowSubstitutionCode(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerStatusCode(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* DG1 segment class
|
||||
* Ref: http://hl7-definition.caristix.com:9010/HL7%20v2.3.1/segment/DG1
|
||||
*/
|
||||
class DG1 extends Segment
|
||||
{
|
||||
/**
|
||||
* Index of this segment. Incremented for every new segment of this class created
|
||||
*/
|
||||
protected static int $setId = 1;
|
||||
|
||||
public function __construct(?array $fields = null, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('DG1', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosisCodingMethod($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosisCodeDG1($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosisDescription($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosisDateTime($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosisType($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMajorDiagnosticCategory($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosticRelatedGroup($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDRGApprovalIndicator($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDRGGrouperReviewCode($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOutlierType($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOutlierDays($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOutlierCost($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGrouperVersionAndType($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosisPriority($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosingClinician($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosisClassification($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setConfidentialIndicator($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAttestationDateTime($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosisCodingMethod(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosisCodeDG1(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosisDescription(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosisDateTime(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosisType(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMajorDiagnosticCategory(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosticRelatedGroup(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDRGApprovalIndicator(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDRGGrouperReviewCode(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOutlierType(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOutlierDays(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOutlierCost(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGrouperVersionAndType(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosisPriority(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosingClinician(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosisClassification(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getConfidentialIndicator(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAttestationDateTime(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* EQU segment class
|
||||
* Ref: https://www.interfaceware.com/hl7-standard/hl7-segment-EQU.html
|
||||
*/
|
||||
class EQU 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('EQU', $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setEquipmentInstanceIdentifier(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEventDateTime($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEquipmentState($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLocalRemoteControlState($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAlertLevel($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getEquipmentInstanceIdentifier(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEventDateTime(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEquipmentState(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLocalRemoteControlState(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAlertLevel(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+78
@@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* EVN segment class
|
||||
* Ref: http://hl7-definition.caristix.com:9010/HL7%20v2.3.1/segment/EVN
|
||||
* https://corepointhealth.com/resource-center/hl7-resources/hl7-evn-event-type-segment
|
||||
*/
|
||||
class EVN extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('EVN', $fields);
|
||||
}
|
||||
|
||||
public function setEventTypeCode($value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRecordedDateTime($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimePlannedEvent($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEventReasonCode($value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOperatorID($value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEventOccurred($value, int $position = 6): bool
|
||||
{
|
||||
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 getDateTimePlannedEvent(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->getField($position);
|
||||
}
|
||||
|
||||
public function getEventOccurred(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+141
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* FHS: File Header Segment
|
||||
* Ref: https://hl7-definition.caristix.com/v2/HL7v2.3/Segments/FHS
|
||||
*/
|
||||
class FHS extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('FHS', $fields);
|
||||
}
|
||||
|
||||
public function setFileFieldSeparator($value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileEncodingCharacters($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileSendingApplication($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileSendingFacility($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileRecievingApplication($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileRecievingFacility($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileCreationDateTime($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileSecurity($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileNameId($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileHeaderComment($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileControlId($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReferenceFileControlId($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
// -------------------- Getter Methods ------------------------------
|
||||
|
||||
public function getFileFieldSeparator(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileEncodingCharacters(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileSendingApplication(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileSendingFacility(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileRecievingApplication(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileRecievingFacility(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileCreationDateTime(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileSecurity(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileNameId(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileHeaderComment(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileControlId(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReferenceFileControlId(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+41
@@ -0,0 +1,41 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* FTS: File Trailer Segment
|
||||
* Ref: https://hl7-definition.caristix.com/v2/HL7v2.3/Segments/FTS
|
||||
*/
|
||||
class FTS extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('FTS', $fields);
|
||||
}
|
||||
|
||||
public function setFileBatchCount($value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFileTrailerComment($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
// -------------------- Getter Methods ------------------------------
|
||||
|
||||
public function getFileBatchCount(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFileTrailerComment(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+616
@@ -0,0 +1,616 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* GT1 segment class
|
||||
* Reference: https://hl7-definition.caristix.com/v2/HL7v2.5.1/Segments/GT1
|
||||
*/
|
||||
class GT1 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, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('GT1', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorNumber($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorName($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorSpouseName($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorAddress($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorHomePhone($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorBusinessPhone($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorDateOfBirth($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorSex(string $value, int $position = 9)
|
||||
{
|
||||
// Ref: https://hl7-definition.caristix.com/v2/HL7v2.4/Tables/0001
|
||||
if (!in_array($value, ['A', 'F', 'M', 'N', 'O', 'U'], true)) {
|
||||
throw new InvalidArgumentException("Sex should one of 'A', 'F', 'M', 'N', 'O' or 'U'. Given: '$value'");
|
||||
}
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorType($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorRelationship($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorSSN($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorBeginDate($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEndDate($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorPriority($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEmployerName($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEmployerAddress($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEmployerPhone($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEmployeeID($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEmploymentStatus($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorOrganizationName($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorBillingHoldFlag($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorCreditRatingCode($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorDeathDateAndTime($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorDeathFlag($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorChargeAdjustmentCode($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorAnnualIncome($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorHouseholdSize($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEmployerID($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorMaritalStatusCode($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorHireEffectiveDate($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEmploymentStopDate($value, int $position = 32)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLivingDependency($value, int $position = 33)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAmbulatoryStatus($value, int $position = 34)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCitizenship($value, int $position = 35)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPrimaryLanguage($value, int $position = 36)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLivingArrangement($value, int $position = 37)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPublicityCode($value, int $position = 38)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setProtectionIndicator($value, int $position = 39)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStudentIndicator($value, int $position = 40)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReligion($value, int $position = 41)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMotherMaidenName($value, int $position = 42)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNationality($value, int $position = 43)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEthnicGroup($value, int $position = 44)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactPersonsName($value, int $position = 45)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactPersonsPhone($value, int $position = 46)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactReason($value, int $position = 47)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactRelationship($value, int $position = 48)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setJobTitle($value, int $position = 49)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setJobClass($value, int $position = 50)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorEmployersOrganizationName($value, int $position = 51)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setHandicap($value, int $position = 52)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setJobStatus($value, int $position = 53)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorFinancialClass($value, int $position = 54)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorRace($value, int $position = 55)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGuarantorBirthPlace($value, int $position = 56)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVipIndicator($value, int $position = 57)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorNumber(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorName(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorSpouseName(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorAddress(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorHomePhone(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorBusinessPhone(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorDateOfBirth(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorSex(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorType(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorRelationship(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorSSN(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorBeginDate(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEndDate(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorPriority(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEmployerName(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEmployerAddress(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEmployerPhone(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEmployeeID(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEmploymentStatus(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorOrganizationName(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorBillingHoldFlag(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorCreditRatingCode(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorDeathDateAndTime(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorDeathFlag(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorChargeAdjustmentCode(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorAnnualIncome(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorHouseholdSize(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEmployerID(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorMaritalStatusCode(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorHireEffectiveDate(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEmploymentStopDate(int $position = 32)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLivingDependency(int $position = 33)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAmbulatoryStatus(int $position = 34)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCitizenship(int $position = 35)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPrimaryLanguage(int $position = 36)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLivingArrangement(int $position = 37)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPublicityCode(int $position = 38)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getProtectionIndicator(int $position = 39)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStudentIndicator(int $position = 40)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReligion(int $position = 41)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMotherMaidenName(int $position = 42)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNationality(int $position = 43)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEthnicGroup(int $position = 44)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactPersonsName(int $position = 45)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactPersonsPhone(int $position = 46)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactReason(int $position = 47)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactRelationship(int $position = 48)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getJobTitle(int $position = 49)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getJobClass(int $position = 50)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorEmployersOrganizationName(int $position = 51)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getHandicap(int $position = 52)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getJobStatus(int $position = 53)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorFinancialClass(int $position = 54)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorRace(int $position = 55)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGuarantorBirthPlace(int $position = 56)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVipIndicator(int $position = 57)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+531
@@ -0,0 +1,531 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* IN1 segment class
|
||||
* Ref: https://corepointhealth.com/resource-center/hl7-resources/hl7-in1-insurance-segment
|
||||
*/
|
||||
class IN1 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, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('IN1', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsurancePlanID($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuranceCompanyID($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuranceCompanyName($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuranceCompanyAddress($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuranceCoContactPerson($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuranceCoPhoneNumber($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGroupNumber($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setGroupName($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsGroupEmpID($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsGroupEmpName($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlanEffectiveDate($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlanExpirationDate($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAuthorizationInformation($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlanType($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNameOfInsured($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsRelationshipToPatient($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsDateOfBirth($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsAddress($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAssignmentOfBenefits($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCoordinationOfBenefits($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCoordOfBenPriority($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNoticeOfAdmissionFlag($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNoticeOfAdmissionDate($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReportOfEligibilityFlag($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReportOfEligibilityDate($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReleaseInformationCode($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPreAdmitCertPAC($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVerificationDateTime($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVerificationBy($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTypeOfAgreementCode($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setBillingStatus($value, int $position = 32)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLifetimeReserveDays($value, int $position = 33)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDelayBeforeLRDay($value, int $position = 34)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCompanyPlanCode($value, int $position = 35)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPolicyNumber($value, int $position = 36)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPolicyDeductible($value, int $position = 37)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPolicyLimitAmount($value, int $position = 38)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPolicyLimitDays($value, int $position = 39)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRoomRateSemiPrivate($value, int $position = 40)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRoomRatePrivate($value, int $position = 41)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsEmploymentStatus($value, int $position = 42)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsSex($value, int $position = 43)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsEmployersAddress($value, int $position = 44)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVerificationStatus($value, int $position = 45)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriorInsurancePlanID($value, int $position = 46)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCoverageType($value, int $position = 47)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setHandicap($value, int $position = 48)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInsuredsIDNumber($value, int $position = 49)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsurancePlanID(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuranceCompanyID(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuranceCompanyName(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuranceCompanyAddress(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuranceCoContactPerson(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuranceCoPhoneNumber(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGroupNumber(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getGroupName(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsGroupEmpID(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsGroupEmpName(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlanEffectiveDate(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlanExpirationDate(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAuthorizationInformation(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlanType(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNameOfInsured(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsRelationshipToPatient(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsDateOfBirth(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsAddress(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAssignmentOfBenefits(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCoordinationOfBenefits(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCoordOfBenPriority(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNoticeOfAdmissionFlag(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNoticeOfAdmissionDate(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReportOfEligibilityFlag(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReportOfEligibilityDate(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReleaseInformationCode(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPreAdmitCertPAC(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVerificationDateTime(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVerificationBy(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTypeOfAgreementCode(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBillingStatus(int $position = 32)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLifetimeReserveDays(int $position = 33)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDelayBeforeLRDay(int $position = 34)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCompanyPlanCode(int $position = 35)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPolicyNumber(int $position = 36)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPolicyDeductible(int $position = 37)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPolicyLimitAmount(int $position = 38)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPolicyLimitDays(int $position = 39)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRoomRateSemiPrivate(int $position = 40)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRoomRatePrivate(int $position = 41)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsEmploymentStatus(int $position = 42)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsSex(int $position = 43)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsEmployersAddress(int $position = 44)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVerificationStatus(int $position = 45)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorInsurancePlanID(int $position = 46)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCoverageType(int $position = 47)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getHandicap(int $position = 48)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInsuredsIDNumber(int $position = 49)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+291
@@ -0,0 +1,291 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* IN3 segment class
|
||||
* Ref: http://hl7-definition.caristix.com:9010/Default.aspx?version=HL7+v2.5.1&segment=ORC
|
||||
*/
|
||||
class IN3 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, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('IN3', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationNumber($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertifiedBy($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationRequired($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPenalty($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationDateTime($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationModifyDateTime($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOperator($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationBeginDate($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationEndDate($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDays($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNonConcurCodeDescription($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNonConcurEffectiveDateTime($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPhysicianReviewer($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationContact($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationContactPhoneNumber($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAppealReason($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationAgency($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCertificationAgencyPhoneNumber($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPreCertificationRequirement($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCaseManager($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSecondOpinionDate($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSecondOpinionStatus($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSecondOpinionDocumentationReceived($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSecondOpinionPhysician($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationNumber(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertifiedBy(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationRequired(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPenalty(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationDateTime(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationModifyDateTime(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOperator(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationBeginDate(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationEndDate(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDays(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNonConcurCodeDescription(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNonConcurEffectiveDateTime(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPhysicianReviewer(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationContact(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationContactPhoneNumber(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAppealReason(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationAgency(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCertificationAgencyPhoneNumber(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPreCertificationRequirement(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCaseManager(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSecondOpinionDate(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSecondOpinionStatus(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSecondOpinionDocumentationReceived(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSecondOpinionPhysician(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+89
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* MRG segment class
|
||||
* Ref: http://hl7-definition.caristix.com:9010/HL7%20v2.3.1/segment/MRG
|
||||
*/
|
||||
class MRG extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('MRG', $fields);
|
||||
}
|
||||
|
||||
public function setPriorPatientIdentifierList($value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriorAlternatePatientID($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriorPatientAccountNumber($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriorPatientID($value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriorVisitNumber($value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriorAlternateVisitID($value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriorPatientName($value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getPriorPatientIdentifierList(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorAlternatePatientID(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorPatientAccountNumber(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorPatientID(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorVisitNumber(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorAlternateVisitID(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorPatientName(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* MSA: Message acknowledgement segment
|
||||
* Ref: http://hl7-definition.caristix.com:9010/HL7%20v2.3/segment/MSA
|
||||
*/
|
||||
class MSA extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('MSA', $fields);
|
||||
}
|
||||
|
||||
public function setAcknowledgementCode($value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMessageControlID($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTextMessage($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setExpectedSequenceNumber($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDelayedAcknowledgementType($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setErrorCondition($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
// -------------------- Getter Methods ------------------------------
|
||||
|
||||
public function getAcknowledgementCode(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMessageControlID(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTextMessage(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExpectedSequenceNumber(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDelayedAcknowledgementType(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getErrorCondition(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+300
@@ -0,0 +1,300 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
use Exception;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* MSH (message header) segment class
|
||||
*
|
||||
* Usage:
|
||||
* ```php
|
||||
* $seg = new MSH();
|
||||
*
|
||||
* $seg->setField(9, "ADT^A24");
|
||||
* echo $seg->getField(1);
|
||||
* ```
|
||||
*
|
||||
* The MSH is an implementation of the Segment class. The MSH segment is a bit different from other segments, in that
|
||||
* the first field is the field separator after the segment name. Other fields thus start counting from 2! The setting
|
||||
* for the field separator for a whole message can be changed by the setField method on index 1 of the MSH for that
|
||||
* message. The MSH segment also contains the default settings for field 2, COMPONENT_SEPARATOR, REPETITION_SEPARATOR,
|
||||
* ESCAPE_CHARACTER and SUBCOMPONENT_SEPARATOR. These fields default to ^, ~, \ and & respectively.
|
||||
*
|
||||
* Reference: https://corepointhealth.com/resource-center/hl7-resources/hl7-msh-message-header
|
||||
*/
|
||||
class MSH extends Segment
|
||||
{
|
||||
/**
|
||||
* Create an instance of the MSH segment.
|
||||
*
|
||||
* If an array argument is provided, all fields will be filled from that array. Note that for composed fields and
|
||||
* sub-components, the array may hold sub-arrays and sub-sub-arrays. If the reference is not given, the MSH segment
|
||||
* will be created with the MSH 1,2,7,10 and 12 fields filled in for convenience.
|
||||
*
|
||||
* @param null|array $fields
|
||||
* @param null|array $hl7Globals
|
||||
* @throws InvalidArgumentException|Exception
|
||||
*/
|
||||
public function __construct(?array $fields = null, ?array $hl7Globals = null)
|
||||
{
|
||||
parent::__construct('MSH', $fields);
|
||||
|
||||
if (isset($fields)) { // We're done if MSH fields were provided
|
||||
return;
|
||||
}
|
||||
|
||||
// Fill mandatory fields if no fields array is given
|
||||
if (is_array($hl7Globals)) {
|
||||
$this->setField(1, $hl7Globals['FIELD_SEPARATOR']);
|
||||
$this->setField(
|
||||
2,
|
||||
$hl7Globals['COMPONENT_SEPARATOR'] .
|
||||
$hl7Globals['REPETITION_SEPARATOR'] .
|
||||
$hl7Globals['ESCAPE_CHARACTER'] .
|
||||
$hl7Globals['SUBCOMPONENT_SEPARATOR']
|
||||
);
|
||||
$this->setVersionId($hl7Globals['HL7_VERSION']);
|
||||
} else {
|
||||
$this->setField(1, '|');
|
||||
$this->setField(2, '^~\\&');
|
||||
$this->setVersionId('2.3');
|
||||
}
|
||||
$this->setDateTimeOfMessage(date('YmdHis'));
|
||||
$this->setMessageControlId($this->getDateTimeOfMessage() . random_int(10000, 99999));
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the field specified by index to value.
|
||||
*
|
||||
* Indices start at 1, to stay with the HL7 standard. Trying to set the value at index 0 has no effect. Setting the
|
||||
* value on index 1, will effectively change the value of FIELD_SEPARATOR for the message containing this segment,
|
||||
* if the value has length 1; setting the field on index 2 will change the values of COMPONENT_SEPARATOR,
|
||||
* REPETITION_SEPARATOR, ESCAPE_CHARACTER and SUBCOMPONENT_SEPARATOR for the message, if the string is of length 4.
|
||||
*
|
||||
* @param int $index Index of field
|
||||
* @param string $value
|
||||
*/
|
||||
public function setField(int $index, $value = ''): bool
|
||||
{
|
||||
if (($index === 1) && strlen($value) !== 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (($index === 2) && strlen($value) !== 4) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return parent::setField($index, $value);
|
||||
}
|
||||
|
||||
// -------------------- Setter Methods ------------------------------
|
||||
|
||||
public function setSendingApplication($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSendingFacility($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReceivingApplication($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReceivingFacility($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeOfMessage($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSecurity($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Sets message type to MSH segment.
|
||||
*
|
||||
* If trigger event is already set, then it is preserved
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* If field value is ORU^R01 and you call
|
||||
*
|
||||
* ```
|
||||
* $msh->setMessageType('ORM');
|
||||
* ```
|
||||
*
|
||||
* Then the new field value will be ORM^R01.
|
||||
* If it was empty then the new value will be just ORM.
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public function setMessageType($value, int $position = 9): bool
|
||||
{
|
||||
$typeField = $this->getField($position);
|
||||
if (is_array($typeField) && !empty($typeField[1])) {
|
||||
$value = [$value, $typeField[1]];
|
||||
}
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Sets trigger event to MSH segment.
|
||||
*
|
||||
* If meessage type is already set, then it is preserved
|
||||
*
|
||||
* Example:
|
||||
*
|
||||
* If field value is ORU^R01 and you call
|
||||
*
|
||||
* ```
|
||||
* $msh->setTriggerEvent('R30');
|
||||
* ```
|
||||
*
|
||||
* Then the new field value will be ORU^R30.
|
||||
* If trigger event was not set then it will set the new value.
|
||||
*
|
||||
* @param string $value
|
||||
*/
|
||||
public function setTriggerEvent($value, int $position = 9): bool
|
||||
{
|
||||
$typeField = $this->getField($position);
|
||||
if (is_array($typeField) && !empty($typeField[0])) {
|
||||
$value = [$typeField[0], $value];
|
||||
} else {
|
||||
$value = [$typeField, $value];
|
||||
}
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMessageControlId($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setProcessingId($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVersionId($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSequenceNumber($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContinuationPointer($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAcceptAcknowledgementType($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setApplicationAcknowledgementType($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCountryCode($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCharacterSet($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPrincipalLanguage($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
// -------------------- Getter Methods ------------------------------
|
||||
|
||||
public function getSendingApplication(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSendingFacility(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReceivingApplication(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReceivingFacility(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeOfMessage(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
/**
|
||||
* ORM / ORU etc.
|
||||
*/
|
||||
public function getMessageType(int $position = 9): string
|
||||
{
|
||||
$typeField = $this->getField($position);
|
||||
if (!empty($typeField) && is_array($typeField)) {
|
||||
return (string) $typeField[0];
|
||||
}
|
||||
return (string) $typeField;
|
||||
}
|
||||
|
||||
public function getTriggerEvent(int $position = 9): string|bool
|
||||
{
|
||||
$triggerField = $this->getField($position);
|
||||
if (!empty($triggerField[1]) && is_array($triggerField)) {
|
||||
return $triggerField[1];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
public function getMessageControlId(int $position = 10): string
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getProcessingId(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get HL7 version, e.g. 2.1, 2.3, 3.0 etc.
|
||||
*/
|
||||
public function getVersionId(int $position = 12): string|array
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+434
@@ -0,0 +1,434 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* NK1 segment class: Next of Kin / Associated Parties
|
||||
* The NK1 segment contains information about the patients other related parties. Any associated parties may be
|
||||
* identified. Utilizing NK1-1 - set ID, multiple NK1 segments can be sent to patient accounts.
|
||||
*
|
||||
* Ref: https://hl7-definition.caristix.com/v2/HL7v2.5/Segments/NK1
|
||||
*/
|
||||
class NK1 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, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('NK1', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNKName($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRelationship($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAddress($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPhoneNumber($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setBusinessPhoneNumber($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactRole($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDate($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEndDate($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNextOfKinOrAssociatedPartiesJobTitle($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNextOfKinOrAssociatedPartiesJobCodeOrClass($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNextOfKinOrAssociatedPartiesEmployeeNumber($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrganizationName($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMaritalStatus($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministrativeSex($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeOfBirth($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLivingDependency($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAmbulatoryStatus($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCitizenship($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPrimaryLanguage($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLivingArrangement($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPublicityCode($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setProtectionIndicator($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStudentIndicator($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReligion($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMothersMaidenName($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNationality($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEthnicGroup($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactReason($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactPersonsName($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactPersonsTelephoneNumber($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactPersonsAddress($value, int $position = 32)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNextOfKinOrAssociatedPartysIdentifiers($value, int $position = 33)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setJobStatus($value, int $position = 34)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRace($value, int $position = 35)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setHandicap($value, int $position = 36)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContactPersonSocialSecurityNumber($value, int $position = 37)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNextOfKinBirthPlace($value, int $position = 38)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVipIndicator($value, int $position = 39)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNKName(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRelationship(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAddress(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPhoneNumber(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBusinessPhoneNumber(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactRole(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDate(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEndDate(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNextOfKinOrAssociatedPartiesJobTitle(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNextOfKinOrAssociatedPartiesJobCodeOrClass(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNextOfKinOrAssociatedPartiesEmployeeNumber(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrganizationName(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMaritalStatus(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministrativeSex(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeOfBirth(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLivingDependency(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAmbulatoryStatus(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCitizenship(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPrimaryLanguage(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLivingArrangement(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPublicityCode(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getProtectionIndicator(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStudentIndicator(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReligion(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMothersMaidenName(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNationality(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEthnicGroup(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactReason(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactPersonsName(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactPersonsTelephoneNumber(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactPersonsAddress(int $position = 32)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNextOfKinOrAssociatedPartysIdentifiers(int $position = 33)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getJobStatus(int $position = 34)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRace(int $position = 35)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getHandicap(int $position = 36)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContactPersonSocialSecurityNumber(int $position = 37)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNextOfKinBirthPlace(int $position = 38)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVipIndicator(int $position = 39)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* NTE segment class
|
||||
* Ref: https://corepointhealth.com/resource-center/hl7-resources/hl7-nte-notes-comments
|
||||
*/
|
||||
class NTE 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, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('NTE', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSourceOfComment($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setComment($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCommentType($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSourceOfComment(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getComment(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCommentType(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+482
@@ -0,0 +1,482 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* OBR segment class
|
||||
* Ref: https://corepointhealth.com/resource-center/hl7-resources/hl7-obr-segment
|
||||
*/
|
||||
class OBR 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, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('OBR', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerOrderNumber($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerOrderNumber($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setUniversalServiceID($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriority($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRequestedDatetime($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setObservationDateTime($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setObservationEndDateTime($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCollectionVolume($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCollectorIdentifier($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSpecimenActionCode($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDangerCode($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRelevantClinicalInfo($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSpecimenReceivedDateTime($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSpecimenSource($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderingProvider($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderCallbackPhoneNumber($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerfield1($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerfield2($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerField1($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerField2($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* This field specifies the date/time when the results were reported or status changed. This field is used to
|
||||
* indicate the date and time that the results are composed into a report and released, or that a status, as
|
||||
* defined in ORC-5 order status, is entered or changed. (This is a results field only.) When other applications
|
||||
* (such as office or clinical database applications) query the laboratory application for untransmitted results,
|
||||
* the information in this field may be used to control processing on the communications link. Usually, the
|
||||
* ordering service would want only those results for which the reporting date/time is greater than the date/time
|
||||
* the inquiring application last received results.
|
||||
*
|
||||
* @return bool
|
||||
*/
|
||||
public function setResultsRptStatusChngDateTime($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setChargetoPractice($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDiagnosticServSectID($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResultStatus($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setParentResult($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setQuantityTiming($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResultCopiesTo($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setParent($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTransportationMode($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReasonforStudy($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPrincipalResultInterpreter($value, int $position = 32)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAssistantResultInterpreter($value, int $position = 33)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTechnician($value, int $position = 34)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTranscriptionist($value, int $position = 35)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setScheduledDateTime($value, int $position = 36)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNumberofSampleContainers($value, int $position = 37)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTransportLogisticsofCollectedSample($value, int $position = 38)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCollectorsComment($value, int $position = 39)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTransportArrangementResponsibility($value, int $position = 40)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTransportArranged($value, int $position = 41)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEscortRequired($value, int $position = 42)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlannedPatientTransportComment($value, int $position = 43)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerOrderNumber(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerOrderNumber(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getUniversalServiceID(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriority(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRequestedDatetime(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getObservationDateTime(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getObservationEndDateTime(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCollectionVolume(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCollectorIdentifier(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSpecimenActionCode(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDangerCode(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRelevantClinicalInfo(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSpecimenReceivedDateTime(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSpecimenSource(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderingProvider(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderCallbackPhoneNumber(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerfield1(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerfield2(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerField1(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerField2(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResultsRptStatusChngDateTime(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getChargetoPractice(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDiagnosticServSectID(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResultStatus(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getParentResult(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getQuantityTiming(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResultCopiesTo(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getParent(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTransportationMode(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReasonforStudy(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPrincipalResultInterpreter(int $position = 32)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAssistantResultInterpreter(int $position = 33)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTechnician(int $position = 34)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTranscriptionist(int $position = 35)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getScheduledDateTime(int $position = 36)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNumberofSampleContainers(int $position = 37)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTransportLogisticsofCollectedSample(int $position = 38)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCollectorsComment(int $position = 39)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTransportArrangementResponsibility(int $position = 40)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTransportArranged(int $position = 41)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEscortRequired(int $position = 42)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlannedPatientTransportComment(int $position = 43)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+230
@@ -0,0 +1,230 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* OBX segment class
|
||||
* Ref: https://hl7-definition.caristix.com/v2/HL7v2.5.1/Segments/OBX
|
||||
*/
|
||||
class OBX extends Segment
|
||||
{
|
||||
/**
|
||||
* Index of this segment. Incremented for every new segment of this class created
|
||||
*/
|
||||
protected static int $setId = 1;
|
||||
|
||||
public function __construct(?array $fields = null, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('OBX', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setValueType($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setObservationIdentifier($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setObservationSubId($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setObservationValue($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setUnits($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReferenceRange($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAbnormalFlags($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setProbability($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNatureOfAbnormalTest($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setObserveResultStatus($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDataLastObsNormalValues($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setUserDefinedAccessChecks($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeOfTheObservation($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setProducersId($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResponsibleObserver($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setObservationMethod($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEquipmentInstanceIdentifier($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeOfAnalysis($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getValueType(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getObservationIdentifier(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getObservationSubId(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getObservationValue(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getUnits(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReferenceRange(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAbnormalFlags(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getProbability(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNatureOfAbnormalTest(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getObserveResultStatus(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDataLastObsNormalValues(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getUserDefinedAccessChecks(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeOfTheObservation(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getProducersId(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResponsibleObserver(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getObservationMethod(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEquipmentInstanceIdentifier(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeOfAnalysis(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+329
@@ -0,0 +1,329 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* ORC segment class
|
||||
* Ref: http://hl7-definition.caristix.com:9010/Default.aspx?version=HL7%20v2.5.1&segment=ORC
|
||||
*/
|
||||
class ORC extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('ORC', $fields);
|
||||
}
|
||||
|
||||
public function setOrderControl($value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerOrderNumber($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerOrderNumber($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerGroupNumber($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderStatus($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResponseFlag($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setQuantityTiming($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setParentOrder($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeofTransaction($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEnteredBy($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVerifiedBy($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderingProvider($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEnterersLocation($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCallBackPhoneNumber($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderEffectiveDateTime($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderControlCodeReason($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEnteringOrganization($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEnteringDevice($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setActionBy($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdvancedBeneficiaryNoticeCode($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderingFacilityName($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderingFacilityAddress($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderingFacilityPhoneNumber($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderingProviderAddress($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderStatusModifier($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdvancedBeneficiaryNoticeOverrideReason($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillersExpectedAvailabilityDateTime($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setConfidentialityCode($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrderType($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEntererAuthorizationMode($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setParentUniversalServiceIdentifier($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getOrderControl(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerOrderNumber(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerOrderNumber(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerGroupNumber(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderStatus(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResponseFlag(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getQuantityTiming(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getParentOrder(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeofTransaction(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEnteredBy(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVerifiedBy(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderingProvider(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEnterersLocation(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCallBackPhoneNumber(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderEffectiveDateTime(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderControlCodeReason(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEnteringOrganization(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEnteringDevice(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getActionBy(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdvancedBeneficiaryNoticeCode(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderingFacilityName(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderingFacilityAddress(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderingFacilityPhoneNumber(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderingProviderAddress(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderStatusModifier(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdvancedBeneficiaryNoticeOverrideReason(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillersExpectedAvailabilityDateTime(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getConfidentialityCode(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrderType(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEntererAuthorizationMode(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getParentUniversalServiceIdentifier(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+231
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* The patient additional demographic segment contains demographic information that is likely
|
||||
* to change about the patient.
|
||||
*
|
||||
* @link https://hl7-definition.caristix.com/v2/HL7v2.5.1/Segments/PD1
|
||||
*/
|
||||
class PD1 extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('PD1', $fields);
|
||||
}
|
||||
|
||||
public function setLivingDependency(string|null $value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLivingArrangement(string|null $value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientPrimaryFacility(array|null $value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientPrimaryCareProviderNameAndIDNo(array|null $value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStudentIndicator(string|null $value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setHandicap(string|null $value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLivingWillCode(string|null $value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOrganDonorCode(string|null $value, int $position = 8): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSeparateBill(string|null $value, int $position = 9): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDuplicatePatient(array|null $value, int $position = 10): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPublicityCode(array|null $value, int $position = 11): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setProtectionIndicator(string|null $value, int $position = 12): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setProtectionIndicatorEffectiveDate(string|null $value, int $position = 13): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlaceOfWorship(array|null $value, int $position = 14): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdvanceDirectiveCode(array|null $value, int $position = 15): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setImmunizationRegistryStatus(string|null $value, int $position = 16): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setImmunizationRegistryStatusEffectiveDate(string|null $value, int $position = 17): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPublicityCodeEffectiveDate(string|null $value, int $position = 18): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMilitaryBranch(string|null $value, int $position = 19): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMilitaryRankGrade(string|null $value, int $position = 20): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMilitaryStatus(string|null $value, int $position = 21): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getLivingDependency(int $position = 1): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLivingArrangement(int $position = 2): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientPrimaryFacility(int $position = 3): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientPrimaryCareProviderNameAndIDNo(int $position = 4): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStudentIndicator(int $position = 5): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getHandicap(int $position = 6): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLivingWillCode(int $position = 7): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrganDonorCode(int $position = 8): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSeparateBill(int $position = 9): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDuplicatePatient(int $position = 10): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPublicityCode(int $position = 11): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getProtectionIndicator(int $position = 12): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getProtectionIndicatorEffectiveDate(int $position = 13): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlaceOfWorship(int $position = 14): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdvanceDirectiveCode(int $position = 15): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getImmunizationRegistryStatus(int $position = 16): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getImmunizationRegistryStatusEffectiveDate(int $position = 17): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPublicityCodeEffectiveDate(int $position = 18): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMilitaryBranch(int $position = 19): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMilitaryRankGrade(int $position = 20): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMilitaryStatus(int $position = 21): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+357
@@ -0,0 +1,357 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
use InvalidArgumentException;
|
||||
|
||||
/**
|
||||
* PID segment class
|
||||
* Reference: https://corepointhealth.com/resource-center/hl7-resources/hl7-pid-segment
|
||||
*/
|
||||
class PID extends Segment
|
||||
{
|
||||
/**
|
||||
* Index of this segment. Incremented for every new segment of this class created
|
||||
*/
|
||||
protected static int $setId = 1;
|
||||
|
||||
public function __construct(?array $fields = null, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('PID', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientID($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Patient ID (Internal ID)
|
||||
* @param string|array $value
|
||||
*/
|
||||
public function setPatientIdentifierList($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAlternatePatientID($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientName($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMothersMaidenName($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeOfBirth($value, int $position = 7)
|
||||
{
|
||||
// TODO: Validate if $value is of the form %Y%m%d%H%M%S
|
||||
//if ($value !== 'F' && $value !== 'M') {
|
||||
// throw new \InvalidArgumentException("Date should be of the form YYYYmmddHHMMSS. Given: '$value''");
|
||||
//}
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSex(string $value, int $position = 8)
|
||||
{
|
||||
// Ref: https://hl7-definition.caristix.com/v2/HL7v2.4/Tables/0001
|
||||
if (!in_array($value, ['A', 'F', 'M', 'N', 'O', 'U'], true)) {
|
||||
throw new InvalidArgumentException("Sex should one of 'A', 'F', 'M', 'N', 'O' or 'U'. Given: '$value'");
|
||||
}
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientAlias($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRace($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientAddress($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCountryCode($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPhoneNumberHome($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPhoneNumberBusiness($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPrimaryLanguage($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMaritalStatus($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setReligion($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientAccountNumber($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSSNNumber($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDriversLicenseNumber($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMothersIdentifier($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEthnicGroup($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setBirthPlace($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setMultipleBirthIndicator($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setBirthOrder($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCitizenship($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVeteransMilitaryStatus($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setNationality($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientDeathDateAndTime($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientDeathIndicator($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientID(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
/**
|
||||
* Patient ID (Internal ID)
|
||||
* @return array|null|string
|
||||
*/
|
||||
public function getPatientIdentifierList(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAlternatePatientID(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientName(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMothersMaidenName(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeOfBirth(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSex(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientAlias(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRace(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientAddress(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCountryCode(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPhoneNumberHome(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPhoneNumberBusiness(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPrimaryLanguage(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMaritalStatus(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReligion(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientAccountNumber(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSSNNumber(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDriversLicenseNumber(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMothersIdentifier(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEthnicGroup(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBirthPlace(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMultipleBirthIndicator(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBirthOrder(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCitizenship(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVeteransMilitaryStatus(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNationality(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientDeathDateAndTime(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientDeathIndicator(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+708
@@ -0,0 +1,708 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* PV1 segment class
|
||||
* Ref: https://corepointhealth.com/resource-center/hl7-resources/hl7-pv1-patient-visit-information-segment
|
||||
*/
|
||||
class PV1 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, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('PV1', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPatientClass($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAssignedPatientLocation($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAdmissionType($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPreAdmitNumber($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPriorPatientLocation($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAttendingDoctor($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setReferringDoctor($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setConsultingDoctor($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setHospitalService($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setTemporaryLocation($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPreAdmitTestIndicator($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setReAdmissionIndicator($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAdmitSource($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAmbulatoryStatus($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVipIndicator($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAdmittingDoctor($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPatientType($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVisitNumber($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setFinancialClass($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setChargePriceIndicator($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setCourtesyCode($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setCreditRating($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setContractCode($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setContractEffectiveDate($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setContractAmount($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setContractPeriod($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setInterestCode($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setTransferToBadDebtCode($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setTransferToBadDebtDate($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setBadDebtAgencyCode($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setBadDebtTransferAmount($value, int $position = 32)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setBadDebtRecoveryAmount($value, int $position = 33)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setDeleteAccountIndicator($value, int $position = 34)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setDeleteAccountDate($value, int $position = 35)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setDischargeDisposition($value, int $position = 36)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setDischargedToLocation($value, int $position = 37)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setDietType($value, int $position = 38)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setServicingFacility($value, int $position = 39)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setBedStatus($value, int $position = 40)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAccountStatus($value, int $position = 41)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPendingLocation($value, int $position = 42)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPriorTemporaryLocation($value, int $position = 43)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAdmitDateTime($value, int $position = 44)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setDischargeDateTime($value, int $position = 45)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setCurrentPatientBalance($value, int $position = 46)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setTotalCharges($value, int $position = 47)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setTotalAdjustments($value, int $position = 48)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setTotalPayments($value, int $position = 49)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAlternateVisitID($value, int $position = 50)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVisitIndicator($value, int $position = 51)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setOtherHealthcareProvider($value, int $position = 52)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientClass(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAssignedPatientLocation(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdmissionType(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPreAdmitNumber(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorPatientLocation(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAttendingDoctor(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReferringDoctor(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getConsultingDoctor(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getHospitalService(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTemporaryLocation(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPreAdmitTestIndicator(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReAdmissionIndicator(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdmitSource(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAmbulatoryStatus(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVipIndicator(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdmittingDoctor(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientType(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVisitNumber(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFinancialClass(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getChargePriceIndicator(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCourtesyCode(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCreditRating(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContractCode(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContractEffectiveDate(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContractAmount(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContractPeriod(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInterestCode(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTransferToBadDebtCode(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTransferToBadDebtDate(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBadDebtAgencyCode(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBadDebtTransferAmount(int $position = 32)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBadDebtRecoveryAmount(int $position = 33)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDeleteAccountIndicator(int $position = 34)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDeleteAccountDate(int $position = 35)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDischargeDisposition(int $position = 36)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDischargedToLocation(int $position = 37)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDietType(int $position = 38)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getServicingFacility(int $position = 39)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBedStatus(int $position = 40)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAccountStatus(int $position = 41)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPendingLocation(int $position = 42)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriorTemporaryLocation(int $position = 43)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdmitDateTime(int $position = 44)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDischargeDateTime(int $position = 45)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCurrentPatientBalance(int $position = 46)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTotalCharges(int $position = 47)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTotalAdjustments(int $position = 48)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTotalPayments(int $position = 49)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAlternateVisitID(int $position = 50)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVisitIndicator(int $position = 51)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOtherHealthcareProvider(int $position = 52)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+630
@@ -0,0 +1,630 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* PV2 segment class
|
||||
* Ref: https://hl7-definition.caristix.com/v2/HL7v2.4/Segments/PV2
|
||||
*/
|
||||
class PV2 extends Segment
|
||||
{
|
||||
/**
|
||||
* @param ?array $fields
|
||||
*/
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('PV2', $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPriorPendingLocation($value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAccommodationCode($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAdmitReason($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setTransferReason($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPatientValuables($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPatientValuablesLocation($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVisitUserCode($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setExpectedAdmitDateTime($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setExpectedDischargeDateTime($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setEstimatedLengthofInpatientStay($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setActualLengthOfInpatientStay($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVisitDescription($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setReferralSourceCode($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPreviousServiceDate($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setEmploymentIllnessRelatedIndicator($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPurgeStatusCode($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPurgeStatusDate($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setSpecialProgramCode($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setRetentionIndicator($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setExpectedNumberOfInsurancePlans($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVisitPublicityCode($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVisitProtectionIndicator($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setClinicOrganizationName($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPatientStatusCode($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setVisitPriorityCode($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPreviousTreatmentDate($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setExpectedDischargeDisposition($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setSignatureOnFileDate($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setFirstSimilarIllnessDate($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPatientChargeAdjustmentCode($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setRecurringServiceCode($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setBillingMediaCode($value, int $position = 32)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setExpectedSurgeryDateAndTime($value, int $position = 33)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setMilitaryPartnershipCode($value, int $position = 34)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setMilitaryNonAvailabilityCode($value, int $position = 35)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setNewbornBabyIndicator($value, int $position = 36)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setBabyDetainedIndicator($value, int $position = 37)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setModeOfArrivalCode($value, int $position = 38)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setRecreationalDrugUseCode($value, int $position = 39)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAdmissionLevelOfCareCode($value, int $position = 40)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPrecautionCode($value, int $position = 41)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPatientConditionCode($value, int $position = 42)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setLivingWillCode($value, int $position = 43)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setOrganDonorCode($value, int $position = 44)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setAdvanceDirectiveCode($value, int $position = 45)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setPatientStatusEffectiveDate($value, int $position = 46)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function setExpectedLOAReturnDateTime($value, int $position = 47)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
// -------------------- Getter Methods ------------------------------
|
||||
|
||||
public function getAccommodationCode(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdmitReason(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTransferReason(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientValuables(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientValuablesLocation(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVisitUserCode(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExpectedAdmitDateTime(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExpectedDischargeDateTime(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEstimatedLengthofInpatientStay(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getActualLengthOfInpatientStay(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVisitDescription(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getReferralSourceCode(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPreviousServiceDate(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEmploymentIllnessRelatedIndicator(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPurgeStatusCode(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPurgeStatusDate(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSpecialProgramCode(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRetentionIndicator(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExpectedNumberOfInsurancePlans(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVisitPublicityCode(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVisitProtectionIndicator(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getClinicOrganizationName(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientStatusCode(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVisitPriorityCode(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPreviousTreatmentDate(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExpectedDischargeDisposition(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSignatureOnFileDate(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFirstSimilarIllnessDate(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientChargeAdjustmentCode(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRecurringServiceCode(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBillingMediaCode(int $position = 32)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExpectedSurgeryDateAndTime(int $position = 33)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMilitaryPartnershipCode(int $position = 34)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getMilitaryNonAvailabilityCode(int $position = 35)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getNewbornBabyIndicator(int $position = 36)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBabyDetainedIndicator(int $position = 37)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getModeOfArrivalCode(int $position = 38)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRecreationalDrugUseCode(int $position = 39)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdmissionLevelOfCareCode(int $position = 40)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPrecautionCode(int $position = 41)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientConditionCode(int $position = 42)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLivingWillCode(int $position = 43)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOrganDonorCode(int $position = 44)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdvanceDirectiveCode(int $position = 45)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPatientStatusEffectiveDate(int $position = 46)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExpectedLOAReturnDateTime(int $position = 47)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+70
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* RGS segment class
|
||||
* Ref: http://hl7-definition.caristix.com:9010/Default.aspx?version=HL7+v2.5.1&segment=RGS
|
||||
*/
|
||||
class RGS extends Segment
|
||||
{
|
||||
/**
|
||||
* Index of this segment. Incremented for every new segment of this class created
|
||||
*/
|
||||
protected static int $setId = 1;
|
||||
|
||||
public function __construct(?array $fields = null, bool $autoIncrementIndices = true)
|
||||
{
|
||||
parent::__construct('RGS', $fields);
|
||||
if ($autoIncrementIndices) {
|
||||
$this->setID($this::$setId++);
|
||||
}
|
||||
}
|
||||
|
||||
public function __destruct()
|
||||
{
|
||||
$this->setID($this::$setId--);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setID(int $value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSegmentActionCode($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setResourceGroupID($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSegmentActionCode(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getResourceGroupID(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+282
@@ -0,0 +1,282 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* The ORC must have the filler order number and the order control code RE. As a site-specific variant,
|
||||
* the RXO and associated RXCs and/or the RXE (and associated RXCs) may be present if the receiving
|
||||
* application needs any of their data. The RXA carries the administration data.
|
||||
*
|
||||
* @link https://hl7-definition.caristix.com/v2/HL7v2.5.1/Segments/RXA
|
||||
*/
|
||||
class RXA extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('RXA', $fields);
|
||||
}
|
||||
|
||||
public function setGiveSubIdCounter(int $value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministrationSubIdCounter(int $value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeStartAdministration(string|array $value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDateTimeEndAdministration(string|array $value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredCode(array $value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredAmount(string $value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredUnits(array|null $value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredDosageForm(array|null $value, int $position = 8): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministrationNotes(array|null $value, int $position = 9): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeringProvider(array|null $value, int $position = 10): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredAtLocation(array|null $value, int $position = 11): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredPerTimeUnit(string|null $value, int $position = 12): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredStrength(string|null $value, int $position = 13): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredStrengthUnits(array|null $value, int $position = 14): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSubstanceLotNumber(string|null $value, int $position = 15): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSubstanceExpirationDate(string|array|null $value, int $position = 16): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSubstanceManufacturerName(array|null $value, int $position = 17): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSubstanceTreatmentRefusalReason(array|null $value, int $position = 18): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setIndication(array|null $value, int $position = 19): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCompletionStatus(string|null $value, int $position = 20): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setActionCode(string|null $value, int $position = 21): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSystemEntryDateTime(string|array|null $value, int $position = 22): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredDrugStrengthVolume(string|null $value, int $position = 23): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredDrugStrengthVolumeUnits(array|null $value, int $position = 24): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministeredBarcodeIdentifier(array|null $value, int $position = 25): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPharmacyOrderType(string|null $value, int $position = 26): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getGiveSubIdCounter(int $position = 1): int
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministrationSubIdCounter(int $position = 2): int
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeStartAdministration(int $position = 3): string|array
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDateTimeEndAdministration(int $position = 4): string|array
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredCode(int $position = 5): array
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredAmount(int $position = 6): string
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredUnits(int $position = 7): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredDosageForm(int $position = 8): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministrationNotes(int $position = 9): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeringProvider(int $position = 10): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredAtLocation(int $position = 11): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredPerTimeUnit(int $position = 12): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredStrength(int $position = 13): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredStrengthUnits(int $position = 14): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSubstanceLotNumber(int $position = 15): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSubstanceExpirationDate(int $position = 16): string|array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSubstanceManufacturerName(int $position = 17): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSubstanceTreatmentRefusalReason(int $position = 18): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getIndication(int $position = 19): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCompletionStatus(int $position = 20): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getActionCode(int $position = 21): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSystemEntryDateTime(int $position = 22): string|array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredDrugStrengthVolume(int $position = 23): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredDrugStrengthVolumeUnits(int $position = 24): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministeredBarcodeIdentifier(int $position = 25): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPharmacyOrderType(int $position = 26): string|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* The Pharmacy/Treatment Route segment contains the alternative combination of route, site, administration device,
|
||||
* and administration method that are prescribed as they apply to a particular order. The pharmacy, treatment
|
||||
* staff and/or nursing staff has a choice between the routes based on either their professional judgment
|
||||
* or administration instructions provided by the physician.
|
||||
*
|
||||
* @link https://hl7-definition.caristix.com/v2/HL7v2.8/Segments/RXR
|
||||
*/
|
||||
class RXR extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('RXR', $fields);
|
||||
}
|
||||
|
||||
public function setRoute(array $value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministrationSite(array $value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministrationDevice(array $value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministrationMethod(array $value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRoutingInstruction(array $value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdministrationSiteModifier(array $value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getRoute(int $position = 1): array
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministrationSite(int $position = 2): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministrationDevice(int $position = 3): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministrationMethod(int $position = 4): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRoutingInstruction(int $position = 5): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdministrationSiteModifier(int $position = 6): array|null
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+486
@@ -0,0 +1,486 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* SAC segment class
|
||||
* Ref: https://www.interfaceware.com/hl7-standard/hl7-segment-SAC.html
|
||||
*/
|
||||
class SAC 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('SAC', $fields);
|
||||
}
|
||||
|
||||
/**
|
||||
* Reset index of this segment
|
||||
*/
|
||||
public static function resetIndex(int $index = 1): void
|
||||
{
|
||||
self::$setId = $index;
|
||||
}
|
||||
|
||||
public function setExternalAccessionIdentifier(int $value, int $position = 1)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAccessionIdentifier($value, int $position = 2)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContainerIdentifier($value, int $position = 3)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPrimaryContainerIdentifier($value, int $position = 4)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEquipmentContainerIdentifier($value, int $position = 5)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSpecimenSource($value, int $position = 6)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRegistrationDateTime($value, int $position = 7)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*
|
||||
* value:
|
||||
* I : Identified
|
||||
* P : In Position
|
||||
* O : In Process
|
||||
* R : Process Completed
|
||||
* L : Left Equipment
|
||||
* M : Missing
|
||||
* X : Container Unavailable
|
||||
* U : Unknown
|
||||
*/
|
||||
public function setContainerStatus($value, int $position = 8)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCarrierType($value, int $position = 9)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCarrierIdentifier($value, int $position = 10)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPositionInCarrier($value, int $position = 11)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTrayTypeSAC($value, int $position = 12)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTrayIdentifier($value, int $position = 13)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPositionInTray($value, int $position = 14)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLocation($value, int $position = 15)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContainerHeight($value, int $position = 16)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContainerDiameter($value, int $position = 17)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setBarrierDelta($value, int $position = 18)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setBottomDelta($value, int $position = 19)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContainerSizeUnits($value, int $position = 20)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setContainerVolume($value, int $position = 21)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAvailableSpecimenVolume($value, int $position = 22)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setInitialSpecimenVolume($value, int $position = 23)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setVolumeUnits($value, int $position = 24)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSeparatorType($value, int $position = 25)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setCapType($value, int $position = 26)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAdditive($value, int $position = 27)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSpecimenComponent($value, int $position = 28)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDilutionFactor($value, int $position = 29)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTreatment($value, int $position = 30)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTemperature($value, int $position = 31)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setHemolysisIndex($value, int $position = 32)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setHemolysisIndexUnits($value, int $position = 33)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLepemiaIndex($value, int $position = 34)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setLepemiaIndexUnits($value, int $position = 35)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setIcterusIndex($value, int $position = 36)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setIcterusIndexUnits($value, int $position = 37)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFibrinIndex($value, int $position = 38)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFibrinIndexUnits($value, int $position = 39)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSystemInducedContaminants($value, int $position = 40)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setDrugInterference($value, int $position = 41)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setArtificialBlood($value, int $position = 42)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setSpecialHandlingCode($value, int $position = 43)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOtherEnvironmentalFactors($value, int $position = 44)
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getExternalAccessionIdentifier(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAccessionIdentifier(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContainerIdentifier(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPrimaryContainerIdentifier(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEquipmentContainerIdentifier(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSpecimenSource(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRegistrationDateTime(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContainerStatus(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCarrierType(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCarrierIdentifier(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPositionInCarrier(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTrayTypeSAC(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTrayIdentifier(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPositionInTray(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLocation(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContainerHeight(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContainerDiameter(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBarrierDelta(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getBottomDelta(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContainerSizeUnits(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getContainerVolume(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAvailableSpecimenVolume(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getInitialSpecimenVolume(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getVolumeUnits(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSeparatorType(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getCapType(int $position = 26)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAdditive(int $position = 27)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSpecimenComponent(int $position = 28)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDilutionFactor(int $position = 29)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTreatment(int $position = 30)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTemperature(int $position = 31)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getHemolysisIndex(int $position = 32)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getHemolysisIndexUnits(int $position = 33)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLepemiaIndex(int $position = 34)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getLepemiaIndexUnits(int $position = 35)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getIcterusIndex(int $position = 36)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getIcterusIndexUnits(int $position = 37)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFibrinIndex(int $position = 38)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFibrinIndexUnits(int $position = 39)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSystemInducedContaminants(int $position = 40)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getDrugInterference(int $position = 41)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getArtificialBlood(int $position = 42)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getSpecialHandlingCode(int $position = 43)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOtherEnvironmentalFactors(int $position = 44)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+270
@@ -0,0 +1,270 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* SCH segment class
|
||||
* Ref: https://corepointhealth.com/resource-center/hl7-resources/hl7-siu-message
|
||||
* http://hl7-definition.caristix.com:9010/HL7%20v2.3.1/segment/SCH
|
||||
*/
|
||||
class SCH extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('SCH', $fields);
|
||||
}
|
||||
|
||||
public function setPlacerAppointmentID($value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerAppointmentID($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOccurrenceNumber($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerGroupNumber($value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setScheduleID($value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEventReason($value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAppointmentReason($value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAppointmentType($value, int $position = 8): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAppointmentDuration($value, int $position = 9): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAppointmentDurationUnits($value, int $position = 10): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setAppointmentTimingQuantity($value, int $position = 11): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerContactPerson($value, int $position = 12): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerContactPhoneNumber($value, int $position = 13): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerContactAddress($value, int $position = 14): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPlacerContactLocation($value, int $position = 15): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerContactPerson($value, int $position = 16): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerContactPhoneNumber($value, int $position = 17): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerContactAddress($value, int $position = 18): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerContactLocation($value, int $position = 19): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEnteredbyPerson($value, int $position = 20): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEnteredbyPhoneNumber($value, int $position = 21): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEnteredbyLocation($value, int $position = 22): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setParentPlacerAppointmentID($value, int $position = 23): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setParentFillerAppointmentID($value, int $position = 24): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setFillerStatusCode($value, int $position = 25): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getPlacerAppointmentID(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerAppointmentID(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOccurrenceNumber(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerGroupNumber(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getScheduleID(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEventReason(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAppointmentReason(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAppointmentType(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAppointmentDuration(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAppointmentDurationUnits(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getAppointmentTimingQuantity(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerContactPerson(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerContactPhoneNumber(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerContactAddress(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPlacerContactLocation(int $position = 15)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerContactPerson(int $position = 16)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerContactPhoneNumber(int $position = 17)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerContactAddress(int $position = 18)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerContactLocation(int $position = 19)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEnteredbyPerson(int $position = 20)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEnteredbyPhoneNumber(int $position = 21)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEnteredbyLocation(int $position = 22)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getParentPlacerAppointmentID(int $position = 23)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getParentFillerAppointmentID(int $position = 24)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getFillerStatusCode(int $position = 25)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
+159
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Aranyasen\HL7\Segments;
|
||||
|
||||
use Aranyasen\HL7\Segment;
|
||||
|
||||
/**
|
||||
* TQ1 segment class
|
||||
* Ref: http://hl7-definition.caristix.com:9010/HL7%20v2.5.1/dataType/Default.aspx?version=HL7+v2.5.1&dataType=TQ1
|
||||
*/
|
||||
class TQ1 extends Segment
|
||||
{
|
||||
public function __construct(?array $fields = null)
|
||||
{
|
||||
parent::__construct('TQ1', $fields);
|
||||
}
|
||||
|
||||
public function setSetIdTQ1($value, int $position = 1): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setQuantity($value, int $position = 2): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRepeatPattern($value, int $position = 3): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setExplicitTime($value, int $position = 4): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setRelativeTimeAndUnits($value, int $position = 5): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setServiceDuration($value, int $position = 6): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setStartDateTime($value, int $position = 7): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setEndDateTime($value, int $position = 8): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setPriority($value, int $position = 9): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setConditionText($value, int $position = 10): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTextInstruction($value, int $position = 11): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setConjunction($value, int $position = 12): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setOccurrenceDuration($value, int $position = 13): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function setTotalOccurrences($value, int $position = 14): bool
|
||||
{
|
||||
return $this->setField($position, $value);
|
||||
}
|
||||
|
||||
public function getSetIdTQ1(int $position = 1)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getQuantity(int $position = 2)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRepeatPattern(int $position = 3)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getExplicitTime(int $position = 4)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getRelativeTimeAndUnits(int $position = 5)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getServiceDuration(int $position = 6)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getStartDateTime(int $position = 7)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getEndDateTime(int $position = 8)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getPriority(int $position = 9)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getConditionText(int $position = 10)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTextInstruction(int $position = 11)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getConjunction(int $position = 12)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getOccurrenceDuration(int $position = 13)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
|
||||
public function getTotalOccurrences(int $position = 14)
|
||||
{
|
||||
return $this->getField($position);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user