lib/Convert/Pheno/ClinicalCDM/ToBFF.pm

filter: Statementstmt 100% 31 / 31 Branchbran 75.0% 3 / 4 Conditioncond 28.5% 4 / 14 MC/DCmcdc 0.0% 0 / 7 Subroutinesub 100% 8 / 8 Podpod 0.0% 0 / 1 totaltotal 70.7% 46 / 65 CC 8 SCAR 19.9
CC
8
Cov
78%
run_clinical_cdm_to_bundle
12.8
BEGIN
1.0
BEGIN
1.0
CRAP 7.3
« lib/Convert/Pheno/Emit/OMOP.pm ↑ Summary lib/Convert/Pheno/Audit/Terminology.pm »
1 package Convert::Pheno::ClinicalCDM::ToBFF;
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::ClinicalCDM::Claims qw(map_claims_individual);
Subroutine BEGIN: called CC=1 SCAR=0.0
9 136 ▶use Convert::Pheno::ClinicalCDM::I2B2 qw(map_i2b2_individual);
Subroutine BEGIN: called CC=1 SCAR=0.0
10 136 ▶use Convert::Pheno::Context;
Subroutine BEGIN: called CC=1 SCAR=0.0
11 136 ▶use Convert::Pheno::Model::Bundle;
Subroutine BEGIN: called CC=1 SCAR=0.0
12  
13 136 our @EXPORT_OK = qw(run_clinical_cdm_to_bundle);
14  
15 36 ▶sub run_clinical_cdm_to_bundle {
Subroutine run_clinical_cdm_to_bundle: called CC=8 SCAR=25.5
Pod undocumented
16 36 my ( $self, $record, $context ) = @_;
17 die "Normalized clinical CDM input must contain a patient-scoped object\n"
18 unless ref($record) eq 'HASH'
19 && defined $record->{model}
20 && defined $record->{personId}
21 36 ▶ && ref( $record->{patient} ) eq 'HASH';
Branch: 1 branch
BranchTrueFalseTotal
unless ref $record eq "HASH" and defined $record->{"model"} and defined $record->{"personId"} and ref $record->{"patient"} eq "HASH" 0 36 36
Condition33%3/9
ref $record eq "HASH" and defined $record->{"model"} and defined $record->{"personId"} and ref $record->{"patient"} eq "HASH"
!ll&&!rl&&r
0036
ref $record eq "HASH" and defined $record->{"model"} and defined $record->{"personId"}
!ll&&!rl&&r
0036
ref $record eq "HASH" and defined $record->{"model"}
!ll&&!rl&&r
0036
MC/DC0%0/4
ref $record eq "HASH" and defined $record->{"model"} and defined $record->{"personId"} and ref $record->{"patient"} eq "HASH"
ref $record eq "HASH" defined $record->{"model"} defined $record->{"personId"} ref $record->{"patient"} eq "HASH"
Truth table20%1/5
A and B and C and D
A= ref $record eq "HASH"B= defined $record->{"model"}C= defined $record->{"personId"}D= ref $record->{"patient"} eq "HASH"
ABCDresult
0XXX0
10XX0
110X0
11100
11111
22  
23 36 my $model = $record->{model};
24 $context ||= Convert::Pheno::Context->from_self(
25 $self,
26 {
27 source_format => $model,
28 target_format => 'beacon',
29 36 ▶ entities => $self->{entities} || ['individuals'],
Condition20%1/5
$context ||= "Convert::Pheno::Context"->from_self($self, {"source_format", $model, "target_format", "beacon", "entities", $self->{"entities"} || ["individuals"]})
l!l&&r!l&&!r
3600
$self->{'entities'} || ['individuals']
l!l
00
MC/DC0%0/2
$context ||= "Convert::Pheno::Context"->from_self($self, {"source_format", $model, "target_format", "beacon", "entities", $self->{"entities"} || ["individuals"]})
$context "Convert::Pheno::Context"->from_self($self, {"source_format", $model, "target_format", "beacon", "entities", $self->{"entities"} || ["individuals"]})
MC/DC0%0/1
$self->{'entities'} || ['individuals']
$self->{'entities'}
Truth table33%1/3
A ||= B
A= $contextB= "Convert::Pheno::Context"->from_self($self, {"source_format", $model, "target_format", "beacon", "entities", $self->{"entities"} || ["individuals"]})
ABresult
1X1
011
000
Truth table0%0/2
A
A= $self->{'entities'}
Aresult
11
00
30 }
31 );
32 36 my $bundle = Convert::Pheno::Model::Bundle->new(
33 {
34 context => $context,
35 entities => $context->entities,
36 }
37 );
38  
39 36 ▶ my $individual = $model eq 'i2b2'
Branch: 1 branch
BranchTrueFalseTotal
$model eq 'i2b2' ? : 14 22 36
40 ? map_i2b2_individual( $self, $record )
41 : map_claims_individual( $self, $record );
42 36 $bundle->add_entity( individuals => $individual );
43 36 return $bundle;
44 }
45  
46 136 1;
« lib/Convert/Pheno/Emit/OMOP.pm ↑ Summary lib/Convert/Pheno/Audit/Terminology.pm »