File Coverage

lib/Net/HL7.pm
Criterion Covered Total %
statement 3 3 100.0
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 4 4 100.0


line stmt bran cond sub pod time code
1             package Net::HL7;
2              
3 7     7   35 use strict;
  7         13  
  7         754  
4              
5             our $VERSION = "0.82";
6              
7             =pod
8              
9             =head1 NAME
10              
11             Net::HL7
12              
13             =head1 DESCRIPTION
14              
15             The Net-HL7 package is a simple Perl API for creating, parsing sending
16             and receiving HL7 messages. To create an empty HL7 message object, do:
17              
18             =begin text
19              
20             use Net::HL7::Message;
21              
22             my $msg = new Net::HL7::Message();
23              
24             =end text
25              
26             and add segments like:
27              
28             =begin text
29              
30             my $msh = new Net::HL7::Segments::MSH();
31             my $pid = new Net::HL7::Segment("PID");
32              
33             $pid->setField(3, "1231313");
34              
35             $msg->addSegment($msh);
36             $msg->addSegment($pid);
37              
38             =end text
39              
40             For details, please consult the man pages of each specific class, or
41             consult the generated API docs on
42             I. You might also check the test files
43             in the 't' directory for examples.
44              
45             The Net::HL7 class is only used for documentation purposes (the stuff
46             you're reading right now), to set HL7 configuration properties such as
47             control characters on a global level and to provide a version number
48             of the package to the Perl installation process. This can be used in a
49             'require' statement, or to create a dependency from another Perl
50             package.
51              
52             =head1 PROPERTIES
53              
54             Some HL7 properties may be altered on a global level. Altering the
55             variable makes it changed for this remainder of the lifetime of this
56             Perl process. All HL7 messages will use the values provided here,
57             unless something is changed in the MSH segment concerning these
58             properties.
59              
60             =over 4
61              
62             =item B
63              
64             Separator for segments within a message. Usually this is \015.
65              
66             =cut
67              
68             our $SEGMENT_SEPARATOR = "\015";
69              
70             =pod
71              
72             =item B
73              
74             Field separator for this message. In general '|' is used.
75              
76             =cut
77              
78             our $FIELD_SEPARATOR = "|";
79              
80             =pod
81              
82             =item B
83              
84             HL7 NULL field, defaults to "". This is therefore different from not
85             setting the fields at all.
86              
87             =cut
88              
89             our $NULL = "\"\"";
90              
91             =pod
92              
93             =item B
94              
95             Separator used in fields supporting components. Usually this is the
96             '^' character.
97              
98             =cut
99              
100             our $COMPONENT_SEPARATOR = "^";
101              
102             =pod
103              
104             =item B
105              
106             Separator for fields that may be repeated. Defaults to '~'.
107              
108             =cut
109              
110             our $REPETITION_SEPARATOR = "~";
111              
112             =pod
113              
114             =item B
115              
116             Escape character for escaping special characters. Defaults to '\'.
117              
118             =cut
119              
120             our $ESCAPE_CHARACTER = "\\";
121              
122             =pod
123              
124             =item B
125              
126             Separator used in fields supporting subcomponents. Usually this is
127             the '&' character.
128              
129             =cut
130              
131             our $SUBCOMPONENT_SEPARATOR = "&";
132              
133             =pod
134              
135             =item B
136              
137             This is the version used in the MSH(12) field. Defaults to 2.2.
138              
139             =back
140              
141             =cut
142              
143             our $HL7_VERSION = "2.2";
144              
145             1;