Convert-Pheno

 view release on metacpan or  search on metacpan

lib/Convert/Pheno/Audit/Terminology.pm  view on Meta::CPAN


        if ( $NUMERIC_COLUMN{$column} && _is_number($value) ) {
            my $format =
              $column eq 'best_candidate_score' || $column eq 'score_margin'
              ? $self->{score_format}
              : undef;
            $worksheet->write_number( $xlsx_row, $index, $value, $format );
        }
        else {
            # Explicit string writes prevent source values beginning with '='
            # from being interpreted as spreadsheet formulas.
            $worksheet->write_string( $xlsx_row, $index, "$value" );
        }
    }

    $self->{next_xlsx_row}++;
    return 1;
}

sub _close_xlsx {
    my ($self) = @_;

lib/Convert/Pheno/Audit/Terminology.pm  view on Meta::CPAN

        my @rules = (
            [ unresolved => '=$P2="not_found"' ],
            [ not_searched => '=OR($P2="not_searched",$Q2="source_fallback")' ],
            [ review => '=AND($P2<>"not_found",$P2<>"not_searched",$Q2<>"source_fallback",OR($T2="similarity",$V2="one_token_relaxed"))' ],
            [ resolved => '=AND($P2<>"not_found",$P2<>"not_searched",$Q2<>"source_fallback",$T2<>"similarity",$V2<>"one_token_relaxed")' ],
        );
        for my $rule (@rules) {
            $audit->conditional_formatting(
                $range,
                {
                    type     => 'formula',
                    criteria => $rule->[1],
                    format   => $self->{row_format}{ $rule->[0] },
                }
            );
        }
    }

    $self->{workbook}->close()
      or die "Failed to finalize XLSX terminology audit '$self->{path}'\n";
    return 1;

t/21-term-audit.t  view on Meta::CPAN

            match_status           => 'matched',
            decision_reason        => 'exact_match',
            lookup_resolution      => 'exact',
            retrieval_path         => 'exact_lookup',
            best_candidate_score   => 1,
        }
    );
    $writer->close;

    my $shared_strings = slurp_zip_member( $audit_file, 'xl/sharedStrings.xml' );
    like( $shared_strings, qr/=1\+1/, 'XLSX audit preserves formula-like source text as a string' );
    my $audit_sheet = slurp_zip_member( $audit_file, 'xl/worksheets/sheet2.xml' );
    unlike( $audit_sheet, qr/<f>/, 'XLSX audit does not create formulas from source values' );
}

throws_ok(
    sub {
        local *STDERR;
        open STDERR, '>', \my $stderr
          or die "Could not capture STDERR: $!";
        build_cli_request(
            argv => [
                '-icsv', 't/csv2bff/in/csv_data.csv',

t/openehr2bff/in/ips_canonical.json  view on Meta::CPAN

                    "archetype_node_id": "at0145",
                    "value": {
                      "_type": "DV_TEXT",
                      "value": "Dose unit 64"
                    }
                  },
                  {
                    "_type": "ELEMENT",
                    "name": {
                      "_type": "DV_TEXT",
                      "value": "Dose formula"
                    },
                    "archetype_node_id": "at0135",
                    "value": {
                      "_type": "DV_TEXT",
                      "value": "Dose formula 34"
                    }
                  },
                  {
                    "_type": "ELEMENT",
                    "name": {
                      "_type": "DV_TEXT",
                      "value": "Dose description"
                    },
                    "archetype_node_id": "at0178",
                    "value": {

t/openehr2bff/out/individuals.json  view on Meta::CPAN

                                             "value" : {
                                                "_type" : "DV_TEXT",
                                                "value" : "Dose unit 64"
                                             }
                                          },
                                          {
                                             "_type" : "ELEMENT",
                                             "archetype_node_id" : "at0135",
                                             "name" : {
                                                "_type" : "DV_TEXT",
                                                "value" : "Dose formula"
                                             },
                                             "value" : {
                                                "_type" : "DV_TEXT",
                                                "value" : "Dose formula 34"
                                             }
                                          },
                                          {
                                             "_type" : "ELEMENT",
                                             "archetype_node_id" : "at0178",
                                             "name" : {
                                                "_type" : "DV_TEXT",
                                                "value" : "Dose description"
                                             },
                                             "value" : {

t/openehr2bff/out/individuals.json  view on Meta::CPAN

                                 "value" : {
                                    "_type" : "DV_TEXT",
                                    "value" : "Dose unit 64"
                                 }
                              },
                              {
                                 "_type" : "ELEMENT",
                                 "archetype_node_id" : "at0135",
                                 "name" : {
                                    "_type" : "DV_TEXT",
                                    "value" : "Dose formula"
                                 },
                                 "value" : {
                                    "_type" : "DV_TEXT",
                                    "value" : "Dose formula 34"
                                 }
                              },
                              {
                                 "_type" : "ELEMENT",
                                 "archetype_node_id" : "at0178",
                                 "name" : {
                                    "_type" : "DV_TEXT",
                                    "value" : "Dose description"
                                 },
                                 "value" : {



( run in 1.644 second using v1.01-cache-2.11-cpan-364913b4093 )