line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package App::HL7::Compare::Parser::Message; |
2
|
|
|
|
|
|
|
$App::HL7::Compare::Parser::Message::VERSION = '0.002'; |
3
|
4
|
|
|
4
|
|
51
|
use v5.10; |
|
4
|
|
|
|
|
19
|
|
4
|
4
|
|
|
4
|
|
22
|
use strict; |
|
4
|
|
|
|
|
8
|
|
|
4
|
|
|
|
|
79
|
|
5
|
4
|
|
|
4
|
|
42
|
use warnings; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
136
|
|
6
|
|
|
|
|
|
|
|
7
|
4
|
|
|
4
|
|
41
|
use Moo; |
|
4
|
|
|
|
|
9
|
|
|
4
|
|
|
|
|
22
|
|
8
|
4
|
|
|
4
|
|
1340
|
use Mooish::AttributeBuilder -standard; |
|
4
|
|
|
|
|
29
|
|
|
4
|
|
|
|
|
26
|
|
9
|
4
|
|
|
4
|
|
3120
|
use Types::Standard qw(Bool); |
|
4
|
|
|
|
|
483463
|
|
|
4
|
|
|
|
|
47
|
|
10
|
|
|
|
|
|
|
|
11
|
4
|
|
|
4
|
|
11967
|
use App::HL7::Compare::Parser::Segment; |
|
4
|
|
|
|
|
20
|
|
|
4
|
|
|
|
|
170
|
|
12
|
4
|
|
|
4
|
|
1948
|
use App::HL7::Compare::Parser::MessageConfig; |
|
4
|
|
|
|
|
15
|
|
|
4
|
|
|
|
|
1657
|
|
13
|
|
|
|
|
|
|
|
14
|
|
|
|
|
|
|
has param 'skip_MSH' => ( |
15
|
|
|
|
|
|
|
isa => Bool, |
16
|
|
|
|
|
|
|
default => sub { 1 }, |
17
|
|
|
|
|
|
|
); |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
with qw( |
20
|
|
|
|
|
|
|
App::HL7::Compare::Parser::Role::PartOfMessage |
21
|
|
|
|
|
|
|
App::HL7::Compare::Parser::Role::Partible |
22
|
|
|
|
|
|
|
App::HL7::Compare::Parser::Role::RequiresInput |
23
|
|
|
|
|
|
|
); |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
sub part_separator |
26
|
|
|
|
|
|
|
{ |
27
|
10
|
|
|
10
|
0
|
24
|
my ($self) = @_; |
28
|
|
|
|
|
|
|
|
29
|
10
|
|
|
|
|
310
|
return $self->msg_config->segment_separator; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
sub _build_parts |
33
|
|
|
|
|
|
|
{ |
34
|
10
|
|
|
10
|
|
256
|
my ($self) = @_; |
35
|
|
|
|
|
|
|
|
36
|
10
|
|
|
|
|
34
|
my $input = $self->consume_input; |
37
|
10
|
|
|
|
|
63
|
$self->msg_config->from_MSH($input); |
38
|
|
|
|
|
|
|
|
39
|
10
|
|
|
|
|
311
|
my $parts = $self->split_and_build($input, 'App::HL7::Compare::Parser::Segment'); |
40
|
10
|
100
|
|
|
|
315
|
@{$parts} = grep { $_->name ne 'MSH' } @{$parts} |
|
9
|
|
|
|
|
47
|
|
|
39
|
|
|
|
|
97
|
|
|
9
|
|
|
|
|
32
|
|
41
|
|
|
|
|
|
|
if $self->skip_MSH; |
42
|
|
|
|
|
|
|
|
43
|
10
|
|
|
|
|
24
|
my %last_seen; |
44
|
10
|
|
|
|
|
21
|
foreach my $item (@{$parts}) { |
|
10
|
|
|
|
|
24
|
|
45
|
45
|
|
|
|
|
1499
|
$item->set_number(++$last_seen{$item->name}); |
46
|
|
|
|
|
|
|
} |
47
|
|
|
|
|
|
|
|
48
|
10
|
|
|
|
|
460
|
return $parts; |
49
|
|
|
|
|
|
|
} |
50
|
|
|
|
|
|
|
|
51
|
|
|
|
|
|
|
sub _build_msg_config |
52
|
|
|
|
|
|
|
{ |
53
|
10
|
|
|
10
|
|
26
|
my ($self) = @_; |
54
|
|
|
|
|
|
|
|
55
|
10
|
|
|
|
|
167
|
return App::HL7::Compare::Parser::MessageConfig->new; |
56
|
|
|
|
|
|
|
} |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
1; |
59
|
|
|
|
|
|
|
|