lib/Convert/Pheno/ClinicalCDM/Claims.pm

filter: Statementstmt 86.9% 167 / 192 Branchbran 50.0% 47 / 94 Conditioncond 45.4% 10 / 22 MC/DCmcdc 7.1% 1 / 14 Subroutinesub 100% 17 / 17 Podpod 0.0% 0 / 1 totaltotal 71.1% 242 / 340 CC 67 SCAR 23.0
CC
67
Cov
73%
_observation_measures
23.3
_map_observations
15.9
_map_medications
12.1
CRAP 9.9
« lib/Convert/Pheno/Execution/Files.pm ↑ Summary lib/Convert/Pheno/DB/Bundle.pm »
1 package Convert::Pheno::ClinicalCDM::Claims;
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 136 ▶use Storable qw(dclone);
Subroutine BEGIN: called CC=1 SCAR=0.0
8  
9 136 ▶use Convert::Pheno::ClinicalCDM::Util qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
10 coded_term
11 date_value
12 first_value
13 map_sex
14 numeric_value
15 row_visit
16 source_term
17 table_rows
18 timestamp_value
19 136 );
20 136 ▶use Convert::Pheno::Utils::Default qw(get_defaults);
Subroutine BEGIN: called CC=1 SCAR=0.0
21  
22 136 our @EXPORT_OK = qw(map_claims_individual);
23  
24 136 my $DEFAULT = get_defaults();
25  
26 22 ▶sub map_claims_individual {
Subroutine map_claims_individual: called CC=7 SCAR=20.0
Pod undocumented
27 22 my ( $self, $record ) = @_;
28 22 my $model = $record->{model};
29 22 ▶ die "Claims-CDM mapping supports Sentinel and PCORnet input\n"
Branch: 1 branch
BranchTrueFalseTotal
unless $model eq "sentinel" or $model eq "pcornet" 0 22 22
Condition66%2/3
$model eq "sentinel" or $model eq "pcornet"
l!l&&r!l&&!r
10120
MC/DC0%0/2
$model eq "sentinel" or $model eq "pcornet"
$model eq "sentinel" $model eq "pcornet"
Truth table66%2/3
A or B
A= $model eq "sentinel"B= $model eq "pcornet"
ABresult
1X1
011
000
30 unless $model eq 'sentinel' || $model eq 'pcornet';
31  
32 22 my $patient = $record->{patient};
33 22 my $individual = {
34 id => "$record->{personId}",
35 sex => map_sex( first_value( $patient, qw(SEX SEX_AT_BIRTH GENDER) ) ),
36 };
37  
38 22 _map_demographics( $individual, $patient, $model );
39 22 _map_death( $individual, $record );
40 22 _map_diagnoses( $individual, $record );
41 22 _map_procedures( $individual, $record );
42 22 _map_labs( $individual, $record );
43 22 _map_vitals( $individual, $record );
44 22 _map_medications( $individual, $record );
45 22 _map_observations( $individual, $record );
46  
47 22 ▶ if ( $self->{source_info} // 1 ) {
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"source_info"} // 1) 20 2 22
Condition50%1/2
$self->{"source_info"} // 1
l!l
220
MC/DC0%0/1
$self->{"source_info"} // 1
$self->{"source_info"}
Truth table50%1/2
A
A= $self->{"source_info"}
Aresult
11
00
48 $individual->{info}{$model} = {
49 patient => dclone($patient),
50 20 tables => dclone( $record->{tables} ),
51 };
52 }
53 $individual->{info}{convertPheno} = $self->{convertPheno}
54 22 ▶ if !$self->{test} && defined $self->{convertPheno};
Branch: 1 branch
BranchTrueFalseTotal
if not $self->{"test"} and defined $self->{"convertPheno"} 0 22 22
Condition33%1/3
not $self->{"test"} and defined $self->{"convertPheno"}
!ll&&!rl&&r
2200
MC/DC0%0/2
not $self->{"test"} and defined $self->{"convertPheno"}
not $self->{"test"} defined $self->{"convertPheno"}
Truth table33%1/3
not(A) and B
A= not $self->{"test"}B= defined $self->{"convertPheno"}
ABresult
0X0
100
111
55 22 return $individual;
56 }
57  
58 22 ▶sub _map_demographics {
Subroutine _map_demographics: called CC=4 SCAR=14.8
59 22 my ( $individual, $patient, $model ) = @_;
60 22 my $birth = timestamp_value(
61 first_value( $patient, qw(BIRTH_DATE BIRTHDATE DATE_OF_BIRTH) )
62 );
63 22 ▶ $individual->{info}{phenopacket}{dateOfBirth} = $birth
Branch: 1 branch
BranchTrueFalseTotal
if defined $birth 22 0 22
64 if defined $birth;
65  
66 22 my $ethnicity = first_value( $patient, qw(ETHNICITY ETHNIC HISPANIC) );
67 22 ▶ if ( defined $ethnicity ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $ethnicity) 22 0 22
68 22 my %label = (
69 Y => 'Hispanic or Latino',
70 N => 'Not Hispanic or Latino',
71 OT => 'Other',
72 UN => 'Unknown',
73 NI => 'No information',
74 R => 'Refused to answer',
75 );
76 $individual->{ethnicity} = source_term(
77 $model,
78 'Ethnicity',
79 $ethnicity,
80 22 ▶ $label{ uc($ethnicity) } // $ethnicity,
Condition33%1/3
$label{uc $ethnicity} // $ethnicity
l!l&&r!l&&!r
2200
MC/DC0%0/2
$label{uc $ethnicity} // $ethnicity
$label{uc $ethnicity} $ethnicity
Truth table33%1/3
A // B
A= $label{uc $ethnicity}B= $ethnicity
ABresult
1X1
011
000
81 );
82 }
83 }
84  
85 22 ▶sub _map_death {
Subroutine _map_death: called CC=3 SCAR=11.0
86 22 my ( $individual, $record ) = @_;
87 22 my $rows = table_rows( $record, qw(DEATH) );
88 22 ▶ return unless @{$rows};
Branch: 1 branch
BranchTrueFalseTotal
unless @{$rows;} 13 9 22
89  
90 9 my $status = { status => 'DECEASED' };
91 9 my $date = timestamp_value(
92 first_value( $rows->[0], qw(DEATH_DATE DOD DATE_OF_DEATH) )
93 );
94 9 ▶ $status->{timeOfDeath} = { timestamp => $date } if defined $date;
Branch: 1 branch
BranchTrueFalseTotal
if defined $date 9 0 9
95 9 $individual->{info}{phenopacket}{vitalStatus} = $status;
96 }
97  
98 22 ▶sub _map_diagnoses {
Subroutine _map_diagnoses: called CC=9 SCAR=22.5
99 22 my ( $individual, $record ) = @_;
100 22 my @diseases;
101 22 for my $table (qw(DIAGNOSIS CONDITION)) {
102 44 for my $row ( @{ table_rows( $record, $table ) } ) {
103 17 ▶ my $code = first_value(
Branch: 1 branch
BranchTrueFalseTotal
$table eq 'DIAGNOSIS' ? : 17 0 17
104 $row,
105 $table eq 'DIAGNOSIS'
106 ? qw(DX DIAGNOSIS_CODE CODE)
107 : qw(CONDITION CONDITION_CODE DX CODE)
108 );
109 17 ▶ next unless defined $code;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code 0 17 17
110 17 ▶ my $type = first_value(
Branch: 1 branch
BranchTrueFalseTotal
$table eq 'DIAGNOSIS' ? : 17 0 17
111 $row,
112 $table eq 'DIAGNOSIS'
113 ? qw(DX_TYPE DX_CODETYPE CODE_TYPE)
114 : qw(CONDITION_TYPE DX_TYPE CODE_TYPE)
115 );
116 17 my $label = first_value(
117 $row,
118 qw(DX_NAME DIAGNOSIS_NAME CONDITION_NAME DESCRIPTION)
119 );
120 my $term = coded_term(
121 model => $record->{model},
122 17 kind => 'Diagnosis',
123 code => $code,
124 type => $type,
125 label => $label,
126 );
127 17 ▶ next unless $term;
Branch: 1 branch
BranchTrueFalseTotal
unless $term 0 17 17
128 17 my $disease = { diseaseCode => $term };
129 17 my $visit = row_visit( $record, $row, model => $record->{model} );
130 17 ▶ $disease->{_visit} = $visit if $visit;
Branch: 1 branch
BranchTrueFalseTotal
if $visit 17 0 17
131 17 push @diseases, $disease;
132 }
133 }
134 22 ▶ $individual->{diseases} = \@diseases if @diseases;
Branch: 1 branch
BranchTrueFalseTotal
if @diseases 17 5 22
135 }
136  
137 22 ▶sub _map_procedures {
Subroutine _map_procedures: called CC=7 SCAR=19.7
138 22 my ( $individual, $record ) = @_;
139 22 my @procedures;
140 22 for my $row ( @{ table_rows( $record, qw(PROCEDURE PROCEDURES IMMUNIZATION) ) } ) {
141 9 my $code = first_value( $row, qw(PX PROCEDURE_CODE VX_CODE CODE) );
142 9 ▶ next unless defined $code;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code 0 9 9
143 9 my $type = first_value(
144 $row,
145 qw(PX_TYPE PX_CODETYPE PROCEDURE_CODE_TYPE VX_CODE_TYPE CODE_TYPE)
146 );
147 9 my $label = first_value(
148 $row,
149 qw(PX_NAME PROCEDURE_NAME VX_NAME DESCRIPTION)
150 );
151 my $term = coded_term(
152 model => $record->{model},
153 9 kind => 'Procedure',
154 code => $code,
155 type => $type,
156 label => $label,
157 );
158 9 ▶ next unless $term;
Branch: 1 branch
BranchTrueFalseTotal
unless $term 0 9 9
159 9 my $procedure = { procedureCode => $term };
160 9 my $date = date_value(
161 first_value( $row, qw(PX_DATE PROCEDURE_DATE VX_DATE ADMIN_DATE) )
162 );
163 9 ▶ $procedure->{dateOfProcedure} = $date if defined $date;
Branch: 1 branch
BranchTrueFalseTotal
if defined $date 9 0 9
164 9 my $visit = row_visit( $record, $row, model => $record->{model} );
165 9 ▶ $procedure->{_visit} = $visit if $visit;
Branch: 1 branch
BranchTrueFalseTotal
if $visit 9 0 9
166 9 push @procedures, $procedure;
167 }
168 22 ▶ $individual->{interventionsOrProcedures} = \@procedures if @procedures;
Branch: 1 branch
BranchTrueFalseTotal
if @procedures 9 13 22
169 }
170  
171 22 ▶sub _map_labs {
Subroutine _map_labs: called CC=10 SCAR=24.3
172 22 my ( $individual, $record ) = @_;
173 22 my @measures;
174 22 for my $row ( @{ table_rows( $record, qw(LAB_RESULT LAB_RESULT_CM) ) } ) {
175 9 my $loinc = first_value( $row, qw(LAB_LOINC LOINC) );
176 9 ▶ my $code = $loinc // first_value(
Condition33%1/3
$loinc // first_value($row, ("LAB_NAME", "TEST_NAME", "RAW_LAB_NAME", "LAB_TEST_CODE"))
l!l&&r!l&&!r
900
MC/DC0%0/2
$loinc // first_value($row, ("LAB_NAME", "TEST_NAME", "RAW_LAB_NAME", "LAB_TEST_CODE"))
$loinc first_value($row, ("LAB_NAME", "TEST_NAME", "RAW_LAB_NAME", "LAB_TEST_CODE"))
Truth table33%1/3
A // B
A= $loincB= first_value($row, ("LAB_NAME", "TEST_NAME", "RAW_LAB_NAME", "LAB_TEST_CODE"))
ABresult
1X1
011
000
177 $row,
178 qw(LAB_NAME TEST_NAME RAW_LAB_NAME LAB_TEST_CODE)
179 );
180 9 ▶ next unless defined $code;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code 0 9 9
181 9 my $label = first_value(
182 $row,
183 qw(RAW_LAB_NAME TEST_NAME LAB_NAME DESCRIPTION)
184 );
185 my $assay = coded_term(
186 model => $record->{model},
187 9 ▶ kind => 'Laboratory',
Branch: 1 branch
BranchTrueFalseTotal
defined $loinc ? : 9 0 9
188 code => $code,
189 type => defined $loinc ? 'LOINC' : undef,
190 label => $label,
191 );
192 9 my $value = _measurement_value($record, $row);
193 9 ▶ next unless $assay && $value;
Branch: 1 branch
BranchTrueFalseTotal
unless $assay and $value 0 9 9
Condition33%1/3
$assay and $value
!ll&&!rl&&r
009
MC/DC0%0/2
$assay and $value
$assay $value
Truth table33%1/3
A and B
A= $assayB= $value
ABresult
0X0
100
111
194  
195 9 my $measure = {
196 assayCode => $assay,
197 measurementValue => $value,
198 };
199 9 my $date = date_value(
200 first_value(
201 $row,
202 qw(RESULT_DATE SPECIMEN_DATE LAB_DATE ORDER_DATE)
203 )
204 );
205 9 ▶ $measure->{date} = $date if defined $date;
Branch: 1 branch
BranchTrueFalseTotal
if defined $date 9 0 9
206 9 my $visit = row_visit( $record, $row, model => $record->{model} );
207 9 ▶ $measure->{_visit} = $visit if $visit;
Branch: 1 branch
BranchTrueFalseTotal
if $visit 9 0 9
208 9 push @measures, $measure;
209 }
210 22 push @measures, @{ _observation_measures($record) };
211 22 ▶ $individual->{measures} = \@measures if @measures;
Branch: 1 branch
BranchTrueFalseTotal
if @measures 9 13 22
212 }
213  
214 9 ▶sub _measurement_value {
Subroutine _measurement_value: called CC=6 SCAR=22.0
215 9 my ( $record, $row ) = @_;
216 9 my $number = numeric_value(
217 $row,
218 qw(RESULT_NUM RESULT_NUMERIC RESULT_VALUE_NUM NVAL_NUM NUMERIC_RESULT OBSCLIN_RESULT_NUM OBSCLIN_RESULT_NUMERIC)
219 );
220 9 ▶ if ( defined $number ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $number) 9 0 9
221 9 my $unit_label = first_value(
222 $row,
223 qw(RESULT_UNIT UNITS_CD UNIT NUMERIC_MODIFIER_UNIT OBSCLIN_RESULT_UNIT)
224 );
225 my $unit = defined $unit_label
226 ? source_term( $record->{model}, 'Unit', $unit_label, $unit_label )
227 9 ▶ : dclone( $DEFAULT->{ontology_term} );
Branch: 1 branch
BranchTrueFalseTotal
defined $unit_label ? : 9 0 9
228 9 my $quantity = { value => $number, unit => $unit };
229 9 my $low = numeric_value( $row, qw(NORM_RANGE_LOW NORMAL_LOW_C RANGE_LOW) );
230 9 my $high = numeric_value( $row, qw(NORM_RANGE_HIGH NORMAL_HIGH_C RANGE_HIGH) );
231 9 ▶ if ( defined $low && defined $high ) {
Branch: 1 branch
BranchTrueFalseTotal
if (defined $low and defined $high) 0 9 9
Condition33%1/3
defined $low and defined $high
!ll&&!rl&&r
900
MC/DC0%0/2
defined $low and defined $high
defined $low defined $high
Truth table33%1/3
A and B
A= defined $lowB= defined $high
ABresult
0X0
100
111
232 $quantity->{referenceRange} = {
233 0 low => $low,
234 high => $high,
235 unit => dclone($unit),
236 };
237 }
238 9 return { quantity => $quantity };
239 }
240  
241 0 my $text = first_value(
242 $row,
243 qw(RESULT_QUAL RESULT_CHAR RESULT_TEXT TVAL_CHAR RAW_RESULT OBSCLIN_RESULT_TEXT OBSCLIN_RESULT_QUAL)
244 );
245 0 ▶ return unless defined $text;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $text 0 0 0
246 0 return source_term( $record->{model}, 'Result', $text, $text );
247 }
248  
249 22 ▶sub _map_vitals {
Subroutine _map_vitals: called CC=9 SCAR=22.0
250 22 my ( $individual, $record ) = @_;
251 22 ▶ my @measures = @{ $individual->{measures} || [] };
Condition100%2/2
$individual->{'measures'} || []
l!l
913
MC/DC100%1/1
$individual->{'measures'} || []
$individual->{'measures'}
Truth table100%2/2
A
A= $individual->{'measures'}
Aresult
11
00
252 22 my @definition = (
253 [ [qw(HT HEIGHT)], 'LOINC:8302-2', 'Body height', qw(HT_UNIT HEIGHT_UNIT) ],
254 [ [qw(WT WEIGHT)], 'LOINC:29463-7', 'Body weight', qw(WT_UNIT WEIGHT_UNIT) ],
255 [ [qw(BMI)], 'LOINC:39156-5', 'Body mass index', qw(BMI_UNIT) ],
256 [ [qw(SYSTOLIC SBP)], 'LOINC:8480-6', 'Systolic blood pressure', qw(BP_UNIT) ],
257 [ [qw(DIASTOLIC DBP)], 'LOINC:8462-4', 'Diastolic blood pressure', qw(BP_UNIT) ],
258 );
259  
260 22 for my $row ( @{ table_rows( $record, qw(VITAL VITAL_SIGNS) ) } ) {
261 9 for my $definition (@definition) {
262 45 my ( $fields, $code, $label, @unit_fields ) = @{$definition};
263 45 my $value = numeric_value( $row, @{$fields} );
264 45 ▶ next unless defined $value;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $value 9 36 45
265 36 my $unit_label = first_value( $row, @unit_fields );
266 my $unit = defined $unit_label
267 ? source_term( $record->{model}, 'Unit', $unit_label, $unit_label )
268 36 ▶ : dclone( $DEFAULT->{ontology_term} );
Branch: 1 branch
BranchTrueFalseTotal
defined $unit_label ? : 36 0 36
269 my $measure = {
270 assayCode => coded_term(
271 36 model => $record->{model}, kind => 'Vital',
272 code => $code, label => $label,
273 ),
274 measurementValue => { quantity => { value => $value, unit => $unit } },
275 };
276 36 my $date = date_value(
277 first_value( $row, qw(MEASURE_DATE VITAL_DATE OBS_DATE) )
278 );
279 36 ▶ $measure->{date} = $date if defined $date;
Branch: 1 branch
BranchTrueFalseTotal
if defined $date 36 0 36
280 36 my $visit = row_visit( $record, $row, model => $record->{model} );
281 36 ▶ $measure->{_visit} = $visit if $visit;
Branch: 1 branch
BranchTrueFalseTotal
if $visit 36 0 36
282 36 push @measures, $measure;
283 }
284 }
285 22 ▶ $individual->{measures} = \@measures if @measures;
Branch: 1 branch
BranchTrueFalseTotal
if @measures 9 13 22
286 }
287  
288 22 ▶sub _map_medications {
Subroutine _map_medications: called CC=10 SCAR=25.0
289 22 my ( $individual, $record ) = @_;
290 22 my @treatments;
291 22 for my $table (qw(PRESCRIBING DISPENSING MED_ADMIN INPATIENT_PHARMACY EXTERNAL_MEDS)) {
292 110 for my $row ( @{ table_rows( $record, $table ) } ) {
293 9 my ( $code, $type );
294 9 ▶ if ( defined( $code = first_value( $row, qw(RXNORM_CUI RXCUI) ) ) ) {
Branch: 2 branches
BranchTrueFalseTotal
if (defined($code = first_value($row, ('RXNORM_CUI', 'RXCUI')))) { } 9 0 9
elsif (defined($code = first_value($row, 'NDC'))) { } 0 0 0
295 9 $type = 'RxNorm';
296 }
297 elsif ( defined( $code = first_value( $row, qw(NDC) ) ) ) {
298 0 $type = 'NDC';
299 }
300 else {
301 0 $code = first_value( $row, qw(RX MEDADMIN_CODE DRUG_CODE) );
302 0 $type = first_value(
303 $row,
304 qw(RX_CODETYPE RX_TYPE MEDADMIN_TYPE DRUG_CODE_TYPE)
305 );
306 }
307 9 ▶ next unless defined $code;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code 0 9 9
308 9 my $label = first_value(
309 $row,
310 qw(RAW_RX_MED_NAME RX_NAME MEDICATION_NAME DRUG_NAME DESCRIPTION)
311 );
312 my $term = coded_term(
313 model => $record->{model},
314 9 kind => 'Medication',
315 code => $code,
316 type => $type,
317 label => $label,
318 );
319 9 ▶ next unless $term;
Branch: 1 branch
BranchTrueFalseTotal
unless $term 0 9 9
320 9 my $treatment = { treatmentCode => $term };
321 9 my $route = first_value(
322 $row,
323 qw(RX_ROUTE DISPENSE_ROUTE MEDADMIN_ROUTE ROUTE)
324 );
325 $treatment->{routeOfAdministration} = source_term(
326 9 ▶ $record->{model}, 'Route', $route, $route,
Branch: 1 branch
BranchTrueFalseTotal
if defined $route 9 0 9
327 ) if defined $route;
328 9 my $visit = row_visit( $record, $row, model => $record->{model} );
329 9 ▶ $treatment->{_visit} = $visit if $visit;
Branch: 1 branch
BranchTrueFalseTotal
if $visit 9 0 9
330 9 push @treatments, $treatment;
331 }
332 }
333 22 ▶ $individual->{treatments} = \@treatments if @treatments;
Branch: 1 branch
BranchTrueFalseTotal
if @treatments 9 13 22
334 }
335  
336 22 ▶sub _map_observations {
Subroutine _map_observations: called CC=6 SCAR=27.7
337 22 my ( $individual, $record ) = @_;
338 22 my @features;
339 22 for my $table (qw(OBS_GEN FEATURE_ENGINEERING)) {
340 44 for my $row ( @{ table_rows( $record, $table ) } ) {
341 0 my $code = first_value(
342 $row,
343 qw(OBSGEN_CODE FEATURE_CODE FEATURE CODE)
344 );
345 0 ▶ next unless defined $code;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code 0 0 0
346 0 my $type = first_value(
347 $row,
348 qw(OBSGEN_TYPE FE_CODETYPE FEATURE_CODE_TYPE CODE_TYPE)
349 );
350 0 my $label = first_value(
351 $row,
352 qw(OBSGEN_NAME FEATURE_NAME DESCRIPTION)
353 );
354 my $feature = {
355 featureType => coded_term(
356 0 model => $record->{model}, kind => 'Observation',
357 code => $code, type => $type, label => $label,
358 ),
359 };
360 0 my $visit = row_visit( $record, $row, model => $record->{model} );
361 0 ▶ $feature->{_visit} = $visit if $visit;
Branch: 1 branch
BranchTrueFalseTotal
if $visit 0 0 0
362 0 push @features, $feature;
363 }
364 }
365 22 ▶ $individual->{phenotypicFeatures} = \@features if @features;
Branch: 1 branch
BranchTrueFalseTotal
if @features 0 22 22
366 }
367  
368 22 ▶sub _observation_measures {
Subroutine _observation_measures: called CC=6 SCAR=31.5
369 22 my ($record) = @_;
370 22 my @measures;
371 22 for my $row ( @{ table_rows( $record, qw(OBS_CLIN) ) } ) {
372 0 my $code = first_value( $row, qw(OBSCLIN_CODE CODE) );
373 0 ▶ next unless defined $code;
Branch: 1 branch
BranchTrueFalseTotal
unless defined $code 0 0 0
374 0 my $value = _measurement_value($record, $row);
375 0 ▶ next unless $value;
Branch: 1 branch
BranchTrueFalseTotal
unless $value 0 0 0
376 my $measure = {
377 assayCode => coded_term(
378 0 model => $record->{model}, kind => 'ClinicalObservation',
379 code => $code,
380 type => first_value( $row, qw(OBSCLIN_TYPE CODE_TYPE) ),
381 label => first_value( $row, qw(OBSCLIN_NAME DESCRIPTION) ),
382 ),
383 measurementValue => $value,
384 };
385 0 my $date = date_value(
386 first_value( $row, qw(OBSCLIN_START_DATE OBS_DATE) )
387 );
388 0 ▶ $measure->{date} = $date if defined $date;
Branch: 1 branch
BranchTrueFalseTotal
if defined $date 0 0 0
389 0 my $visit = row_visit( $record, $row, model => $record->{model} );
390 0 ▶ $measure->{_visit} = $visit if $visit;
Branch: 1 branch
BranchTrueFalseTotal
if $visit 0 0 0
391 0 push @measures, $measure;
392 }
393 22 return \@measures;
394 }
395  
396 136 1;
« lib/Convert/Pheno/Execution/Files.pm ↑ Summary lib/Convert/Pheno/DB/Bundle.pm »