lib/Convert/Pheno/Utils/Default.pm

filter: Statementstmt 100% 21 / 21 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 0.0% 0 / 1 totaltotal 96.3% 26 / 27 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« api/perl/worker.pl ↑ Summary lib/Convert/Pheno/OMOP/Definitions.pm »
1 package Convert::Pheno::Utils::Default;
2  
3 143 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 143 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 143 ▶use Hash::Util qw(lock_hash_recurse);
Subroutine BEGIN: called CC=1 SCAR=0.0
6 143 ▶use Exporter 'import';
Subroutine BEGIN: called CC=1 SCAR=0.0
7 143 our @EXPORT_OK = qw(get_defaults);
8  
9 # Define your default values
10 143 my %DEFAULT = (
11 ontology_term => { id => 'NCIT:C126101', label => 'Not Available' },
12 sex => {
13 male => { id => 'NCIT:C20197', label => 'Male' },
14 female => { id => 'NCIT:C16576', label => 'Female' },
15 other => { id => 'NCIT:C17998', label => 'Other' },
16 unknown => { id => 'NCIT:C46109', label => 'Unknown' },
17 },
18 date => '1900-01-01',
19 duration => 'P999Y',
20 duration_OMOP => 'P0Y',
21 value => -1,
22 age => { age => { iso8601duration => 'P999Y' } },
23 timestamp => '1900-01-01T00:00:00Z',
24 year => 1900,
25 concept_id => 0
26 );
27  
28 143 $DEFAULT{iso8601duration} = { iso8601duration => $DEFAULT{duration} };
29 $DEFAULT{interval} =
30 143 { start => $DEFAULT{timestamp}, end => $DEFAULT{timestamp} };
31 $DEFAULT{referenceRange} =
32 143 { low => -1, high => -1, unit => $DEFAULT{ontology_term} };
33 $DEFAULT{quantity} = {
34 unit => $DEFAULT{ontology_term},
35 value => $DEFAULT{value},
36 referenceRange => $DEFAULT{referenceRange}
37 143 };
38  
39 # Lock the hash recursively to make it read-only
40 143 lock_hash_recurse(%DEFAULT);
41  
42 # Function to get a reference to the locked default values
43 2053 ▶sub get_defaults {
Subroutine get_defaults: called CC=1 SCAR=0.0
Pod undocumented
44 2053 return \%DEFAULT;
45 }
46  
47 143 1;
« api/perl/worker.pl ↑ Summary lib/Convert/Pheno/OMOP/Definitions.pm »