MSH (message header) segment class
Usage:
$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
Aranyasen\HL7\Segment
Name | Description |
---|---|
getDateTimeOfMessage | |
getMessageControlId | |
getMessageType | ORM / ORU etc. |
getProcessingId | |
getReceivingApplication | |
getReceivingFacility | |
getSendingApplication | |
getSendingFacility | |
getTriggerEvent | |
getVersionId | Get HL7 version, e.g. 2.1, 2.3, 3.0 etc. |
setAcceptAcknowledgementType | |
setApplicationAcknowledgementType | |
setCharacterSet | |
setContinuationPointer | |
setCountryCode | |
setDateTimeOfMessage | |
setMessageControlId | |
setMessageType | Sets message type to MSH segment. |
setPrincipalLanguage | |
setProcessingId | |
setReceivingApplication | |
setReceivingFacility | |
setSecurity | |
setSendingApplication | |
setSendingFacility | |
setSequenceNumber | |
setTriggerEvent | Sets trigger event to MSH segment. |
setVersionId |
Name | Description |
---|---|
__construct | Create a segment. |
getField | Get the field at index. |
getFields | Get fields from a segment |
getName | Get the name of the segment. This is basically the value at index 0 |
setField | Set the field specified by index to value. |
size | Get the number of fields for this segment, not including the name |
Description
public getDateTimeOfMessage (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getMessageControlId (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getMessageType (int $position)
ORM / ORU etc.
Parameters
(int) $position
Return Values
string
Description
public getProcessingId (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getReceivingApplication (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getReceivingFacility (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getSendingApplication (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getSendingFacility (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getTriggerEvent (void)
Parameters
This function has no parameters.
Return Values
void
Description
public getVersionId (int $position)
Get HL7 version, e.g. 2.1, 2.3, 3.0 etc.
Parameters
(int) $position
Return Values
array|null|string
Description
public setAcceptAcknowledgementType (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setApplicationAcknowledgementType (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setCharacterSet (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setContinuationPointer (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setCountryCode (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setDateTimeOfMessage (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setMessageControlId (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setMessageType (string $value, int $position)
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.
Parameters
(string) $value
(int) $position
Return Values
bool
Description
public setPrincipalLanguage (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setProcessingId (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setReceivingApplication (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setReceivingFacility (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setSecurity (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setSendingApplication (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setSendingFacility (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setSequenceNumber (void)
Parameters
This function has no parameters.
Return Values
void
Description
public setTriggerEvent (string $value, int $position)
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.
Parameters
(string) $value
(int) $position
Return Values
bool
Description
public setVersionId (void)
Parameters
This function has no parameters.
Return Values
void