Net_HL7
[ class tree: Net_HL7 ] [ index: Net_HL7 ] [ all elements ]

Class: Net_HL7_Segments_MSH

Source Location: /Net_HL7-0.1.1/Net/HL7/Segments/MSH.php

Class Overview

Net_HL7_Segment
   |
   --Net_HL7_Segments_MSH

MSH (message header) segment class


Author(s):

Version:

  • $Revision: 1.8 $

Methods


Inherited Variables

Inherited Methods

Class: Net_HL7_Segment

Net_HL7_Segment::Net_HL7_Segment()
Create an instance of this segment. A segment may be created with just
Net_HL7_Segment::getField()
Get the field at index. If the field is a composed field, you might
Net_HL7_Segment::getFields()
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.
Net_HL7_Segment::getName()
Get the name of the segment. This is basically the value at index 0
Net_HL7_Segment::setField()
Set the field specified by index to value, and return some true value
Net_HL7_Segment::size()
Get the number of fields for this segment, not including the name

Class Details

[line 53]
MSH (message header) segment class

Usage:

  1.  $seg =new Net_HL7_Segments_MSH();
  2.  
  3.  $seg->setField(9"ADT^A24");
  4.  echo $seg->getField(1);

The Net_HL7_Segments_MSH is an implementation of the Net_HL7_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.



[ Top ]


Method Detail

Net_HL7_Segments_MSH (Constructor)   [line 65]

Net_HL7_Segments_MSH Net_HL7_Segments_MSH( [ $fields = NULL], [ $hl7Globals = NULL])

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 subcomponents, the array may hold subarrays and subsubarrays. 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.


Parameters:

   $fields   — 
   $hl7Globals   — 

[ Top ]

setField   [line 119]

boolean setField( int $index, mixed $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. 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.

  • Access: public

Overrides Net_HL7_Segment::setField() (Set the field specified by index to value, and return some true value)

Parameters:

int   $index   —  Index of field
mixed   $value   —  Value

[ Top ]


Documentation generated on Mon, 11 Mar 2019 15:32:35 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.