my $seg = new Net::HL7::Segments::MSH();
$seg->setField(9, ``ADT^A24''); print $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.
Copyright (c) 2002 D.A.Dokter. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.