NAME
Net::HL7::Message
SYNOPSIS
my $request = new Net::HL7::Request(); my $conn = new Net::HL7::Connection('localhost', 8089);
my $seg1 = new Net::HL7::Segment("PID");
$seg1->setField(1, "foo");
$request->addSegment($seg1);
my $response = $conn->send($request);
DESCRIPTION
In general one needn't create an instance of the Net::HL7::Message class directly, but use the Net::HL7::Request class. The Message will be created with a MSH segment as it's first segment.
METHODS
- $m = new Net::HL7::Message()
-
The constructor takes an optional string argument that is a string representation of a HL7 message. This makes it easy for the Net::HL7::Connection object to return new HL7 messages from a server.
- addSegment($segment, $index)
-
Set the segment at index to segment. The segment should be an instance of Net::HL7::Segment. If the idnex is not given, the segment is added to the end of the message.
- getSegmentByIndex($index)
-
Return the segment specified by $index.
- toString($pretty)
-
Return a string representation of this message. This can be used to send over a Net::HL7::Connection. To print to other output, use provide the $pretty argument as some true value. This will skip the HL7 control characters, and use '\n' instead.
AUTHOR
D.A.Dokter <dokter@wyldebeast-wunderliebe.com>
LICENSE
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.