| 1 | package oEdtk::Infinite; | ||||||||||
| 2 | |||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 1 | our $VERSION = 2.1126; | |||||||||
| 7 | |||||||||||
| 8 | 1 | our @ISA = qw(Exporter); | |||||||||
| 9 | 1 | our @EXPORT_OK = qw( import_cobol_X import_cobol_S9V9 | |||||||||
| 10 | is_entete is_flux is_ligne is_option | ||||||||||
| 11 | id_ligne is_asspri record_values | ||||||||||
| 12 | extract_options | ||||||||||
| 13 | ); | ||||||||||
| 14 | |||||||||||
| 15 | # The Infinite record import is corporate data (it decodes the Infinite COBOL | ||||||||||
| 16 | # flow and cleans addresses through oEUser::Lib) and now lives in | ||||||||||
| 17 | # oEUser::Infinite. This generic module is a thin delegate so callers using the | ||||||||||
| 18 | # old oEdtk::Infinite name keep working. oEUser is an optional companion | ||||||||||
| 19 | # distribution: it is loaded on demand, and a missing one fails cleanly rather | ||||||||||
| 20 | # than breaking the oEdtk load. | ||||||||||
| 21 | 0 | ▶ | sub _delegate { | ||||||||
|
Subroutine
_delegate: not called CC=2 SCAR=17.9
| |||||||||||
| 22 | 0 | my ( $sub, @args ) = @_; | |||||||||
| 23 | 0 | my $loaded; | |||||||||
| 24 | { | ||||||||||
| 25 | 0 | local $SIG{__DIE__}; # a caught die must not reach oEdtk::Tracking's handler | |||||||||
| 26 | 0 | $loaded = eval { require oEUser::Infinite; 1 }; | |||||||||
| 27 | } | ||||||||||
| 28 | 0 | ▶ | die "oEdtk::Infinite requires the companion distribution oEUser " | ||||||||
|
Branch: 1 branch
| |||||||||||
| 29 | . "(oEUser::Infinite is not installed): $@" | ||||||||||
| 30 | unless $loaded; | ||||||||||
| 31 | 0 | return oEUser::Infinite->can($sub)->(@args); | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | sub import_cobol_X { return _delegate( 'import_cobol_X', @_ ) } | ||||||||
|
Subroutine
import_cobol_X: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 35 | 0 | ▶ | sub import_cobol_S9V9 { return _delegate( 'import_cobol_S9V9', @_ ) } | ||||||||
|
Subroutine
import_cobol_S9V9: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 36 | 0 | ▶ | sub is_entete { return _delegate( 'is_entete', @_ ) } | ||||||||
|
Subroutine
is_entete: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 37 | 0 | ▶ | sub is_flux { return _delegate( 'is_flux', @_ ) } | ||||||||
|
Subroutine
is_flux: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 38 | 0 | ▶ | sub is_ligne { return _delegate( 'is_ligne', @_ ) } | ||||||||
|
Subroutine
is_ligne: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 39 | 0 | ▶ | sub is_option { return _delegate( 'is_option', @_ ) } | ||||||||
|
Subroutine
is_option: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 40 | 0 | ▶ | sub id_ligne { return _delegate( 'id_ligne', @_ ) } | ||||||||
|
Subroutine
id_ligne: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 41 | 0 | ▶ | sub is_asspri { return _delegate( 'is_asspri', @_ ) } | ||||||||
|
Subroutine
is_asspri: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 42 | 0 | ▶ | sub record_values { return _delegate( 'record_values', @_ ) } | ||||||||
|
Subroutine
record_values: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 43 | 0 | ▶ | sub extract_options { return _delegate( 'extract_options', @_ ) } | ||||||||
|
Subroutine
extract_options: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 44 | 0 | ▶ | sub build_address { return _delegate( 'build_address', @_ ) } | ||||||||
|
Subroutine
build_address: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 45 | 0 | ▶ | sub ED_adresse_payeur { return _delegate( 'ED_adresse_payeur', @_ ) } | ||||||||
|
Subroutine
ED_adresse_payeur: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 46 | 0 | ▶ | sub EL_adresse_souscripteur { return _delegate( 'EL_adresse_souscripteur', @_ ) } | ||||||||
|
Subroutine
EL_adresse_souscripteur: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 47 | 0 | ▶ | sub IG_adresse_cpam { return _delegate( 'IG_adresse_cpam', @_ ) } | ||||||||
|
Subroutine
IG_adresse_cpam: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 48 | 0 | ▶ | sub ED_index_variables { return _delegate( 'ED_index_variables', @_ ) } | ||||||||
|
Subroutine
ED_index_variables: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 49 | 0 | ▶ | sub ED_restitution { return _delegate( 'ED_restitution', @_ ) } | ||||||||
|
Subroutine
ED_restitution: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 50 | 0 | ▶ | sub EL_restitution { return _delegate( 'EL_restitution', @_ ) } | ||||||||
|
Subroutine
EL_restitution: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 51 | 0 | ▶ | sub EI_restitution { return _delegate( 'EI_restitution', @_ ) } | ||||||||
|
Subroutine
EI_restitution: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 52 | 0 | ▶ | sub E7_adresse { return _delegate( 'E7_adresse', @_ ) } | ||||||||
|
Subroutine
E7_adresse: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 53 | 0 | ▶ | sub E7_adresse_agence { return _delegate( 'E7_adresse_agence', @_ ) } | ||||||||
|
Subroutine
E7_adresse_agence: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 54 | 0 | ▶ | sub E7_index_variables { return _delegate( 'E7_index_variables', @_ ) } | ||||||||
|
Subroutine
E7_index_variables: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 55 | 0 | ▶ | sub compute_pic { return _delegate( 'compute_pic', @_ ) } | ||||||||
|
Subroutine
compute_pic: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 56 | 0 | ▶ | sub compute_value { return _delegate( 'compute_value', @_ ) } | ||||||||
|
Subroutine
compute_value: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 57 | 0 | ▶ | sub map_sub { return _delegate( 'map_sub', @_ ) } | ||||||||
|
Subroutine
map_sub: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 58 | 0 | ▶ | sub sub_list { return _delegate( 'sub_list', @_ ) } | ||||||||
|
Subroutine
sub_list: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 59 | |||||||||||
| 60 | 1 | 1; | |||||||||
| 61 | |||||||||||
| 62 | =head1 NAME | ||||||||||
| 63 | |||||||||||
| 64 | oEdtk::Infinite - delegate to the oEUser Infinite record import | ||||||||||
| 65 | |||||||||||
| 66 | =head1 SYNOPSIS | ||||||||||
| 67 | |||||||||||
| 68 | use oEdtk::Infinite qw(import_cobol_X); | ||||||||||
| 69 | |||||||||||
| 70 | my $val = import_cobol_X( $line, $pos, $len ); # see oEUser::Infinite | ||||||||||
| 71 | |||||||||||
| 72 | =head1 DESCRIPTION | ||||||||||
| 73 | |||||||||||
| 74 | The Infinite record import is corporate; it lives in C<oEUser::Infinite>. This | ||||||||||
| 75 | module keeps the old C<oEdtk::Infinite> name available to existing callers and | ||||||||||
| 76 | forwards every function to the companion distribution, which is loaded on | ||||||||||
| 77 | demand. When oEUser is not installed, the call fails with a clear message. | ||||||||||
| 78 | |||||||||||
| 79 | Every function below forwards its arguments to the same-named function in | ||||||||||
| 80 | C<oEUser::Infinite> and returns its result: | ||||||||||
| 81 | |||||||||||
| 82 | =over 4 | ||||||||||
| 83 | |||||||||||
| 84 | =item import_cobol_X, import_cobol_S9V9 | ||||||||||
| 85 | |||||||||||
| 86 | =item is_entete, is_flux, is_ligne, is_option | ||||||||||
| 87 | |||||||||||
| 88 | =item id_ligne, is_asspri, record_values, extract_options | ||||||||||
| 89 | |||||||||||
| 90 | =item build_address, ED_adresse_payeur, EL_adresse_souscripteur, IG_adresse_cpam | ||||||||||
| 91 | |||||||||||
| 92 | =item ED_index_variables, ED_restitution, EL_restitution, EI_restitution | ||||||||||
| 93 | |||||||||||
| 94 | =item E7_adresse, E7_adresse_agence, E7_index_variables | ||||||||||
| 95 | |||||||||||
| 96 | =item compute_pic, compute_value, map_sub, sub_list | ||||||||||
| 97 | |||||||||||
| 98 | =back | ||||||||||
| 99 | |||||||||||
| 100 | =head1 FUNCTIONS | ||||||||||
| 101 | |||||||||||
| 102 | =head2 import_cobol_X | ||||||||||
| 103 | |||||||||||
| 104 | my $value = import_cobol_X(\$line, $position, $length); | ||||||||||
| 105 | |||||||||||
| 106 | Import C<$length> characters from C<$line> at the 1-based C<$position>, with the | ||||||||||
| 107 | trailing spaces removed. | ||||||||||
| 108 | |||||||||||
| 109 | =head2 import_cobol_S9V9 | ||||||||||
| 110 | |||||||||||
| 111 | my $value = import_cobol_S9V9(\$line, $position, $int_len, $frac_len); | ||||||||||
| 112 | |||||||||||
| 113 | Import a signed decimal Cobol field, C<int_len> digits and C<frac_len> decimals, | ||||||||||
| 114 | from C<$line> at C<$position>. | ||||||||||
| 115 | |||||||||||
| 116 | =head2 is_entete | ||||||||||
| 117 | |||||||||||
| 118 | my $bool = is_entete(\$line); | ||||||||||
| 119 | |||||||||||
| 120 | True when the line is a header (C<ENTETE>) record. | ||||||||||
| 121 | |||||||||||
| 122 | =head2 is_flux | ||||||||||
| 123 | |||||||||||
| 124 | my $bool = is_flux(\$line); | ||||||||||
| 125 | |||||||||||
| 126 | True when the line is a flux (C<FLUX>) record. | ||||||||||
| 127 | |||||||||||
| 128 | =head2 is_ligne | ||||||||||
| 129 | |||||||||||
| 130 | my $bool = is_ligne(\$line); | ||||||||||
| 131 | |||||||||||
| 132 | True when the line is a detail (C<LIGNE>) record. | ||||||||||
| 133 | |||||||||||
| 134 | =head2 is_option | ||||||||||
| 135 | |||||||||||
| 136 | my $bool = is_option(\$line); | ||||||||||
| 137 | |||||||||||
| 138 | True when the line is an option record. | ||||||||||
| 139 | |||||||||||
| 140 | =head2 id_ligne | ||||||||||
| 141 | |||||||||||
| 142 | my $id = id_ligne(\$line); | ||||||||||
| 143 | |||||||||||
| 144 | Return the two-character identifier of a detail line. | ||||||||||
| 145 | |||||||||||
| 146 | =head2 is_asspri | ||||||||||
| 147 | |||||||||||
| 148 | my $flag = is_asspri(\$line); | ||||||||||
| 149 | |||||||||||
| 150 | Return the associate/insured indicator of the line. | ||||||||||
| 151 | |||||||||||
| 152 | =head2 record_values | ||||||||||
| 153 | |||||||||||
| 154 | my @errors = record_values(\%record, \%map, \$line); | ||||||||||
| 155 | |||||||||||
| 156 | Populate C<%record> by applying C<%map> to C<$line>, and return the list of | ||||||||||
| 157 | errors (empty on success). | ||||||||||
| 158 | |||||||||||
| 159 | =head2 extract_options | ||||||||||
| 160 | |||||||||||
| 161 | my $options = extract_options(\$line); | ||||||||||
| 162 | |||||||||||
| 163 | Split an option line into its option list. | ||||||||||
| 164 | |||||||||||
| 165 | Every function forwards its arguments to the same-named function of the | ||||||||||
| 166 | companion C<oEUser::Infinite>, loaded on demand; a missing oEUser fails with a | ||||||||||
| 167 | clear message. | ||||||||||
| 168 | |||||||||||
| 169 | =head1 AUTHOR | ||||||||||
| 170 | |||||||||||
| 171 | The oEdtk team. | ||||||||||
| 172 | |||||||||||
| 173 | =cut | ||||||||||