1Net::HL7::Segment(3)  User Contributed Perl Documentation Net::HL7::Segment(3)
2
3
4

NAME

6       Net::HL7::Segment
7

SYNOPSIS

9       my $seg = new Net::HL7::Segment("PID");
10
11       $seg->setField(3, "12345678"); print $seg->getField(1);
12

DESCRIPTION

14       The Net::HL7::Segment class represents segments of the HL7 message.
15

METHODS

17       $seg = new Net::HL7::Segment($name, [$fields])
18           Create an instance of this segment. A segment may be created with
19           just a name or a name and a reference to an array of field values.
20           If the name is not given, no segment is created. The segment name
21           should be three characters long, and upper case. If it isn't, no
22           segment is created, and undef is returned.  If a reference to an
23           array is given, all fields will be filled from that array. Note
24           that for composed fields and subcomponents, the array may hold
25           subarrays and subsubarrays. Repeated fields can not be supported
26           the same way, since we can't distinguish between composed fields
27           and repeated fields.
28
29       setField($index, $value)
30           Set the field specified by index to value, and return some true
31           value if the operation succeeded. Indices start at 1, to stay with
32           the HL7 standard. Trying to set the value at index 0 has no effect.
33           The value may also be a reference to an array (that may itself
34           contain arrays) to support composed fields (and subcomponents).
35
36           To set a field to the HL7 null value, instead of omitting a field,
37           can be achieved with the Net::HL7::NULL type, like:
38
39             $segment->setField(8, $Net::HL7::NULL);
40
41           This will render the field as the double quote ("").  If values are
42           not provided at all, the method will just return.
43
44       getField($index)
45           Get the field at index. If the field is a composed field, you might
46           ask for the result to be an array like so:
47
48           my @subfields = $seg->getField(9)
49
50           otherwise the thing returned will be a reference to an array.
51
52       getFieldAsString()
53           Get the string representation of the field
54
55       size()
56           Get the number of fields for this segment, not including the name
57
58       getFields([$from, [$to]])
59           Get the fields in the specified range, or all if nothing specified.
60           If only the 'from' value is provided, all fields from this index
61           till the end of the segment will be returned.
62
63       getName()
64           Get the name of the segment. This is basically the value at index 0
65

AUTHOR

67       D.A.Dokter <dokter@wyldebeast-wunderliebe.com>
68

LICENSE

70       Copyright (c) 2002 D.A.Dokter. All rights reserved.  This program is
71       free software; you can redistribute it and/or modify it under the same
72       terms as Perl itself.
73
74
75
76perl v5.34.0                      2021-07-22              Net::HL7::Segment(3)
Impressum