1Net::HL7::Segments::MSHU(s3e)r Contributed Perl DocumentaNteito:n:HL7::Segments::MSH(3)
2
3
4
6 Net::HL7::Segments::MSH
7
9 my $seg = new Net::HL7::Segments::MSH();
10
11 $seg->setField(9, "ADT^A24"); print $seg->getField(1);
12
14 The Net::HL7::Segments::MSH is an implementation of the
15 Net::HL7::Segment class. The MSH segment is a bit different from other
16 segments, in that the first field is the field separator after the
17 segment name. Other fields thus start counting from 2! The setting for
18 the field separator for a whole message can be changed by the setField
19 method on index 1 of the MSH for that message. The MSH segment also
20 contains the default settings for field 2, COMPONENT_SEPARATOR,
21 REPETITION_SEPARATOR, ESCAPE_CHARACTER and SUBCOMPONENT_SEPARATOR.
22 These fields default to ^, ~, \ and & respectively.
23
25 $msh = new Net::HL7::Segments::MSH([$fields])
26 Create an instance of the MSH segment. If a reference to an array
27 is given, all fields will be filled from that array. Note that for
28 composed fields and subcomponents, the array may hold subarrays and
29 subsubarrays. If the reference is not given, the MSH segment will
30 be created with the MSH 1,2,7,10 and 12 fields filled in for
31 convenience.
32
33 setField($index, $value)
34 Set the field specified by index to value. Indices start at 1, to
35 stay with the HL7 standard. Trying to set the value at index 0 has
36 no effect. Setting the value on index 1, will effectively change
37 the value of Net::HL7::Message::FIELD_SEPARATOR for the message
38 containing this segment, if the value has length 1; setting the
39 field on index 2 will change the values of COMPONENT_SEPARATOR,
40 REPETITION_SEPARATOR, ESCAPE_CHARACTER and SUBCOMPONENT_SEPARATOR
41 for the message, if the string is of length 4.
42
44 D.A.Dokter <dokter@wyldebeast-wunderliebe.com>
45
47 Copyright (c) 2002 D.A.Dokter. All rights reserved. This program is
48 free software; you can redistribute it and/or modify it under the same
49 terms as Perl itself.
50
51
52
53perl v5.30.1 2020-01-30 Net::HL7::Segments::MSH(3)