lib/Convert/Pheno/Pipeline.pm

filter: Statementstmt 100% 39 / 39 Branchbran 80.0% 8 / 10 Conditioncond 66.6% 4 / 6 MC/DCmcdc 50.0% 2 / 4 Subroutinesub 100% 6 / 6 Podpod 0.0% 0 / 1 totaltotal 89.3% 59 / 66 CC 8 SCAR 16.8
CC
8
Cov
93%
run_conversion_pipeline
8.1
BEGIN
1.0
BEGIN
1.0
CRAP 5.4
« lib/Convert/Pheno/OMOP/ParticipantStream.pm ↑ Summary lib/Convert/Pheno/Model/Bundle.pm »
1 package Convert::Pheno::Pipeline;
2  
3 136 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 136 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 136 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 136 ▶use Convert::Pheno::ConversionRequest;
Subroutine BEGIN: called CC=1 SCAR=0.0
9 136 ▶use Convert::Pheno::ExecutionContext;
Subroutine BEGIN: called CC=1 SCAR=0.0
10  
11 136 our @EXPORT_OK = qw(run_conversion_pipeline);
12  
13 49 ▶sub run_conversion_pipeline {
Subroutine run_conversion_pipeline: called CC=8 SCAR=20.9
Pod undocumented
14 49 my ($converter) = @_;
15 49 my $request = Convert::Pheno::ConversionRequest->from_converter($converter);
16 49 my $spec = $request->spec;
17  
18 die "Conversion <$spec->{name}> is not a compound pipeline\n"
19 49 ▶ unless $spec->{operation} eq 'pipeline';
Branch: 1 branch
BranchTrueFalseTotal
unless $spec->{"operation"} eq "pipeline" 0 49 49
20 die "Conversion <$spec->{name}> does not support streaming\n"
21 49 ▶ if $converter->{stream} && !$spec->{streaming};
Branch: 1 branch
BranchTrueFalseTotal
if $converter->{"stream"} and not $spec->{"streaming"} 0 49 49
Condition33%1/3
$converter->{"stream"} and not $spec->{"streaming"}
!ll&&!rl&&r
4900
MC/DC0%0/2
$converter->{"stream"} and not $spec->{"streaming"}
$converter->{"stream"} not $spec->{"streaming"}
Truth table33%1/3
A and not(B)
A= $converter->{"stream"}B= not $spec->{"streaming"}
ABresult
0X0
100
111
22  
23 49 my $execution = Convert::Pheno::ExecutionContext->new(
24 { request => $request }
25 );
26 49 delete $converter->{_term_audit_review};
27  
28 # OMOP file input is already emitted one participant at a time. Preserve
29 # that bounded-memory path while applying the downstream BFF-to-PXF stage
30 # in the output sink rather than materializing the full BFF intermediate.
31 49 ▶ if ( $spec->{name} eq 'omop2pxf' && !$request->has_data ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($spec->{"name"} eq "omop2pxf" and not $request->has_data) 2 47 49
Condition100%3/3
$spec->{"name"} eq "omop2pxf" and not $request->has_data
!ll&&!rl&&r
4342
MC/DC100%2/2
$spec->{"name"} eq "omop2pxf" and not $request->has_data
$spec->{"name"} eq "omop2pxf" not $request->has_data
Truth table100%3/3
A and not(B)
A= $spec->{"name"} eq "omop2pxf"B= not $request->has_data
ABresult
0X0
100
111
32 2 my ( $stage, $arguments ) = $execution->begin_next_stage;
33 2 my $stage_converter = Convert::Pheno->new($arguments);
34 2 $stage_converter->{method_ori} = $spec->{name};
35 2 my $result = $stage_converter->$stage();
36 2 $converter->{_term_audit_review} = $stage_converter->term_audit_review;
37 2 return $execution->complete_stage($result);
38 }
39  
40 47 ▶ while ( $execution->has_next_stage ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($execution->has_next_stage) 94 47 141
41 94 my ( $stage, $arguments ) = $execution->begin_next_stage;
42 94 my $stage_converter = Convert::Pheno->new($arguments);
43 94 my $result = $stage_converter->$stage();
44 # Stages own their audit writers; callers need the review associated
45 # with the last written report, not an intermediate mapping decision.
46 94 ▶ if (my $review = $stage_converter->term_audit_review) {
Branch: 1 branch
BranchTrueFalseTotal
if (my $review = $stage_converter->term_audit_review) 2 92 94
47 2 $converter->{_term_audit_review} = $review;
48 }
49 94 $execution->complete_stage($result);
50 }
51  
52 47 return $execution->result;
53 }
54  
55 136 1;
« lib/Convert/Pheno/OMOP/ParticipantStream.pm ↑ Summary lib/Convert/Pheno/Model/Bundle.pm »