From 0a8e3e2bdc130635b65087f88cbc6c41b249bcfd Mon Sep 17 00:00:00 2001 From: Pedro Amorim Date: Tue, 29 Aug 2023 15:11:54 +0000 Subject: [PATCH] Bug 34587: SushiCounter tests Signed-off-by: Jessica Zairo Signed-off-by: Michaela Sieber Signed-off-by: Nick Clemens Signed-off-by: Tomas Cohen Arazi --- .../Koha/BackgroundJob/ErmSushiHarvester.t | 62 ++ .../Koha/BackgroundJobs/ErmSushiHarvester.t | 238 +++++ t/db_dependent/Koha/ERM/EUsage/CounterFile.t | 129 +++ t/db_dependent/Koha/ERM/EUsage/SushiCounter.t | 830 ++++++++++++++++++ .../Koha/ERM/EUsage/UsageDataProvider.t | 75 ++ t/db_dependent/data/erm/eusage/TR_B3.json | 541 ++++++++++++ t/db_dependent/data/erm/eusage/TR_J1.json | 287 ++++++ t/db_dependent/data/erm/eusage/TR_J2.json | 362 ++++++++ t/db_dependent/data/erm/eusage/TR_J3.json | 354 ++++++++ t/db_dependent/data/erm/eusage/TR_J4.json | 599 +++++++++++++ 10 files changed, 3477 insertions(+) create mode 100755 t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t create mode 100755 t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t create mode 100755 t/db_dependent/Koha/ERM/EUsage/CounterFile.t create mode 100755 t/db_dependent/Koha/ERM/EUsage/SushiCounter.t create mode 100755 t/db_dependent/Koha/ERM/EUsage/UsageDataProvider.t create mode 100644 t/db_dependent/data/erm/eusage/TR_B3.json create mode 100644 t/db_dependent/data/erm/eusage/TR_J1.json create mode 100644 t/db_dependent/data/erm/eusage/TR_J2.json create mode 100644 t/db_dependent/data/erm/eusage/TR_J3.json create mode 100644 t/db_dependent/data/erm/eusage/TR_J4.json diff --git a/t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t b/t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t new file mode 100755 index 0000000000..150a642f66 --- /dev/null +++ b/t/db_dependent/Koha/BackgroundJob/ErmSushiHarvester.t @@ -0,0 +1,62 @@ +#!/usr/bin/perl + +# This file is part of Koha +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Test::More tests => 1; + +use Koha::Database; +use Koha::BackgroundJobs; +use Koha::BackgroundJob::ErmSushiHarvester; + +use File::Basename qw( dirname ); +use File::Slurp; + +use t::lib::Mocks; +use t::lib::TestBuilder; +use Test::MockModule; + +my $schema = Koha::Database->new->schema; +my $builder = t::lib::TestBuilder->new; + +subtest 'enqueue() tests' => sub { + + plan tests => 3; + + $schema->storage->txn_begin; + + my $usage_data_provider = $builder->build_object( + { class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } ); + + my $job_id = Koha::BackgroundJob::ErmSushiHarvester->new->enqueue( + { + ud_provider_id => $usage_data_provider->erm_usage_data_provider_id, + report_type => 'TR_J1', + begin_date => '2023-08-01', + end_date => '2023-09-30', + ud_provider_name => $usage_data_provider->name, + } + ); + + my $job = Koha::BackgroundJobs->find($job_id)->_derived_class; + + is( $job->size, 1, 'Size is correct' ); + is( $job->status, 'new', 'Initial status set correctly' ); + is( $job->queue, 'long_tasks', 'ErmSushiHarvester should use the long_tasks queue' ); + + $schema->storage->txn_rollback; +}; diff --git a/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t b/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t new file mode 100755 index 0000000000..dde89a0b16 --- /dev/null +++ b/t/db_dependent/Koha/BackgroundJobs/ErmSushiHarvester.t @@ -0,0 +1,238 @@ +#!/usr/bin/perl + +# This file is part of Koha +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Test::More tests => 2; + +use Koha::Database; +use Koha::BackgroundJobs; +use Koha::BackgroundJob::ErmSushiHarvester; + +use JSON qw( decode_json ); +use File::Basename qw( dirname ); +use File::Slurp; + +use t::lib::Mocks; +use t::lib::TestBuilder; +use Test::MockModule; + +my $schema = Koha::Database->new->schema; +my $builder = t::lib::TestBuilder->new; + +my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); + +my $sushi_response_file_TR_J1 = dirname(__FILE__) . "/../../data/erm/eusage/TR_J1.json"; +my $sushi_counter_5_response_TR_J1 = read_file($sushi_response_file_TR_J1); +my $sushi_counter_report_TR_J1 = + Koha::ERM::EUsage::SushiCounter->new( { response => decode_json($sushi_counter_5_response_TR_J1) } ); + +my $usage_data_provider_module = Test::MockModule->new('Koha::ERM::EUsage::UsageDataProvider'); + +# Mock harvest_sushi to have data coming from TR_J1.json act as a SUSHI response +$usage_data_provider_module->mock( + 'harvest_sushi', + sub { + my ( $self, $args ) = @_; + + # Set class wide vars + $self->{report_type} = $args->{report_type}; + $self->{begin_date} = $args->{begin_date}; + $self->{end_date} = $args->{end_date}; + my $response = $sushi_counter_5_response_TR_J1; + + my $decoded_response = decode_json($response); + + return if $self->_sushi_errors($decoded_response); + + # Parse the SUSHI response + my $sushi_counter = Koha::ERM::EUsage::SushiCounter->new( { response => $decoded_response } ); + my $counter_file = $sushi_counter->get_COUNTER_from_SUSHI; + + return if $self->_counter_file_size_too_large($counter_file); + + $self->counter_files( + [ + { + usage_data_provider_id => $self->erm_usage_data_provider_id, + file_content => $counter_file, + date_uploaded => POSIX::strftime( "%Y%m%d%H%M%S", localtime ), + + #TODO: add ".csv" to end of filename here + filename => $self->name . "_" . $self->{report_type}, + } + ] + ); + } +); + +subtest 'enqueue_sushi_harvest_jobs' => sub { + + plan tests => 16; + + $schema->storage->txn_begin; + + my $usage_data_provider = $builder->build_object( + { class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } ); + + my $job = Koha::BackgroundJob::ErmSushiHarvester->new( + { + status => 'new', + size => 1, + type => 'erm_sushi_harvester' + } + )->store; + + $job = Koha::BackgroundJobs->find( $job->id ); + $job->process( + { + job_id => $job->id, + ud_provider_id => $usage_data_provider->erm_usage_data_provider_id, + report_type => 'TR_J1', + begin_date => '2023-08-01', + end_date => '2023-09-30', + ud_provider_name => $usage_data_provider->name, + } + ); + + my $report = decode_json( $job->get_from_storage->data )->{report}; + + is( $report->{ud_provider_id}, $usage_data_provider->erm_usage_data_provider_id ); + is( $report->{report_type}, 'TR_J1' ); + is( $report->{ud_provider_name}, $usage_data_provider->name ); + is( $report->{us_report_info}->{skipped_mus}, 0 ); + is( $report->{us_report_info}->{skipped_yus}, 0 ); + is( $report->{us_report_info}->{added_yus}, 6 ); + is( $report->{us_report_info}->{added_mus}, 22 ); + is( $report->{us_report_info}->{added_usage_objects}, 2 ); + + # Subsequent job + my $another_job = Koha::BackgroundJob::ErmSushiHarvester->new( + { + status => 'new', + size => 1, + type => 'erm_sushi_harvester' + } + )->store; + + $another_job = Koha::BackgroundJobs->find( $another_job->id ); + + $another_job->process( + { + job_id => $job->id, + ud_provider_id => $usage_data_provider->erm_usage_data_provider_id, + report_type => 'TR_J1', + begin_date => '2023-08-01', + end_date => '2023-09-30', + ud_provider_name => $usage_data_provider->name, + } + ); + + my $another_report = decode_json( $another_job->get_from_storage->data )->{report}; + + is( $another_report->{ud_provider_id}, $usage_data_provider->erm_usage_data_provider_id ); + is( $another_report->{report_type}, 'TR_J1' ); + is( $another_report->{ud_provider_name}, $usage_data_provider->name ); + is( $another_report->{us_report_info}->{skipped_mus}, 22 ); + is( $another_report->{us_report_info}->{skipped_yus}, 6 ); + is( $another_report->{us_report_info}->{added_yus}, 0 ); + is( $another_report->{us_report_info}->{added_mus}, 0 ); + is( $another_report->{us_report_info}->{added_usage_objects}, 0 ); + + #TODO: Test a harvest with sushi errors + #TODO: Test more report types + + $schema->storage->txn_rollback; + +}; + +subtest 'enqueue_counter_file_processing_job' => sub { + + plan tests => 16; + + $schema->storage->txn_begin; + + my $usage_data_provider = $builder->build_object( + { class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } ); + + $usage_data_provider->{report_type} = 'TR_J1'; + + my $job = Koha::BackgroundJob::ErmSushiHarvester->new( + { + status => 'new', + size => 1, + type => 'erm_sushi_harvester' + } + )->store; + + $job = Koha::BackgroundJobs->find( $job->id ); + + $job->process( + { + job_id => $job->id, + ud_provider_id => $usage_data_provider->erm_usage_data_provider_id, + file_content => $sushi_counter_report_TR_J1->get_COUNTER_from_SUSHI, + } + ); + + my $report = decode_json( $job->get_from_storage->data )->{report}; + + is( $report->{ud_provider_id}, $usage_data_provider->erm_usage_data_provider_id ); + is( $report->{report_type}, 'TR_J1' ); + is( $report->{ud_provider_name}, $usage_data_provider->name ); + is( $report->{us_report_info}->{skipped_mus}, 0 ); + is( $report->{us_report_info}->{skipped_yus}, 0 ); + is( $report->{us_report_info}->{added_yus}, 6 ); + is( $report->{us_report_info}->{added_mus}, 22 ); + is( $report->{us_report_info}->{added_usage_objects}, 2 ); + + # Subsequent job + my $another_job = Koha::BackgroundJob::ErmSushiHarvester->new( + { + status => 'new', + size => 1, + type => 'erm_sushi_harvester' + } + )->store; + + $another_job = Koha::BackgroundJobs->find( $another_job->id ); + + $another_job->process( + { + job_id => $job->id, + ud_provider_id => $usage_data_provider->erm_usage_data_provider_id, + file_content => $sushi_counter_report_TR_J1->get_COUNTER_from_SUSHI, + } + ); + + my $another_report = decode_json( $another_job->get_from_storage->data )->{report}; + + is( $another_report->{ud_provider_id}, $usage_data_provider->erm_usage_data_provider_id ); + is( $another_report->{report_type}, 'TR_J1' ); + is( $another_report->{ud_provider_name}, $usage_data_provider->name ); + is( $another_report->{us_report_info}->{skipped_mus}, 22 ); + is( $another_report->{us_report_info}->{skipped_yus}, 6 ); + is( $another_report->{us_report_info}->{added_yus}, 0 ); + is( $another_report->{us_report_info}->{added_mus}, 0 ); + is( $another_report->{us_report_info}->{added_usage_objects}, 0 ); + + #TODO: Test a big file larger than max_allowed_packets + #TODO: Test more report types + + $schema->storage->txn_rollback; + +}; diff --git a/t/db_dependent/Koha/ERM/EUsage/CounterFile.t b/t/db_dependent/Koha/ERM/EUsage/CounterFile.t new file mode 100755 index 0000000000..d088472d5b --- /dev/null +++ b/t/db_dependent/Koha/ERM/EUsage/CounterFile.t @@ -0,0 +1,129 @@ +#!/usr/bin/perl + +# This file is part of Koha +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Test::More tests => 2; + +use Koha::Database; +use Koha::ERM::EUsage::CounterFile; + +use JSON qw( decode_json ); +use File::Basename qw( dirname ); +use File::Slurp; + +use t::lib::Mocks; +use t::lib::TestBuilder; +use Test::MockModule; + +my $schema = Koha::Database->new->schema; +my $builder = t::lib::TestBuilder->new; + +my $patron = $builder->build_object( { class => 'Koha::Patrons' } ); + +my $sushi_response_file_TR_J1 = dirname(__FILE__) . "/../../../data/erm/eusage/TR_J1.json"; +my $sushi_counter_5_response_TR_J1 = read_file($sushi_response_file_TR_J1); +my $sushi_counter_report_TR_J1 = + Koha::ERM::EUsage::SushiCounter->new( { response => decode_json($sushi_counter_5_response_TR_J1) } ); + +subtest 'store' => sub { + + plan tests => 3; + + $schema->storage->txn_begin; + + my $usage_data_provider = $builder->build_object( + { class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } ); + $usage_data_provider->{report_type} = 'TR_J1'; + + my $now_time = POSIX::strftime( "%Y%m%d%H%M%S", localtime ); + + my $counter_file = Koha::ERM::EUsage::CounterFile->new( + { + usage_data_provider_id => $usage_data_provider->erm_usage_data_provider_id, + file_content => $sushi_counter_report_TR_J1->get_COUNTER_from_SUSHI, + date_uploaded => $now_time, + filename => $usage_data_provider->name . "_" . $usage_data_provider->{report_type}, + } + )->store; + + # UsageTitles are added on CounterFile->store + my $titles_rs = Koha::ERM::EUsage::UsageTitles->search( + { usage_data_provider_id => $usage_data_provider->erm_usage_data_provider_id } ); + + # MonthlyUsages are added on CounterFile->store + my $mus_rs = Koha::ERM::EUsage::MonthlyUsages->search( + { usage_data_provider_id => $usage_data_provider->erm_usage_data_provider_id } ); + + # YearlyUsages are added on CounterFile->store + my $yus_rs = Koha::ERM::EUsage::YearlyUsages->search( + { usage_data_provider_id => $usage_data_provider->erm_usage_data_provider_id } ); + + is( $titles_rs->count, 2, '2 titles were added' ); + is( $mus_rs->count, 22, '22 monthly usages were added' ); + is( $yus_rs->count, 6, '6 yearly usages were added' ); + + $schema->storage->txn_rollback; + + #TODO: Test yop + #TODO: acccess_type + +}; + +subtest '_get_rows_from_COUNTER_file' => sub { + + plan tests => 4; + + $schema->storage->txn_begin; + + my $usage_data_provider = $builder->build_object( + { class => 'Koha::ERM::EUsage::UsageDataProviders', value => { name => 'TestProvider' } } ); + $usage_data_provider->{report_type} = 'TR_J1'; + + my $now_time = POSIX::strftime( "%Y%m%d%H%M%S", localtime ); + + my $counter_file = $builder->build_object( + { + class => 'Koha::ERM::EUsage::CounterFiles', + value => { + usage_data_provider_id => $usage_data_provider->erm_usage_data_provider_id, + file_content => $sushi_counter_report_TR_J1->get_COUNTER_from_SUSHI, + date_uploaded => $now_time, + filename => $usage_data_provider->name . "_" . $usage_data_provider->{report_type}, + } + } + ); + + my $counter_file_rows = $counter_file->_get_rows_from_COUNTER_file; + + is( ref $counter_file_rows, 'ARRAY', '_get_rows_from_COUNTER_file returns array' ); + is( + scalar @{$counter_file_rows}, 4, + '_get_rows_from_COUNTER_file returns correct number of rows' + ); + is( + @{$counter_file_rows}[0]->{Title}, 'Education and Training', + 'first and second report row is about the same title' + ); + is( + @{$counter_file_rows}[1]->{Title}, 'Education and Training', + 'first and second report row is about the same title' + ); + + $schema->storage->txn_rollback; + +}; diff --git a/t/db_dependent/Koha/ERM/EUsage/SushiCounter.t b/t/db_dependent/Koha/ERM/EUsage/SushiCounter.t new file mode 100755 index 0000000000..d91ee1621f --- /dev/null +++ b/t/db_dependent/Koha/ERM/EUsage/SushiCounter.t @@ -0,0 +1,830 @@ +#!/usr/bin/perl + +# This file is part of Koha +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Test::More tests => 15; + +use Koha::ERM::EUsage::SushiCounter; +use Koha::Database; +use JSON qw( decode_json ); +use File::Basename qw( dirname ); +use File::Slurp; + +use t::lib::TestBuilder; + +my $schema = Koha::Database->new->schema; +my $builder = t::lib::TestBuilder->new; + +my $sushi_response_file_TR_J1 = dirname(__FILE__) . "/../../../data/erm/eusage/TR_J1.json"; +my $sushi_counter_5_response_TR_J1 = decode_json( read_file($sushi_response_file_TR_J1) ); +my $sushi_counter_TR_J1 = Koha::ERM::EUsage::SushiCounter->new( { response => $sushi_counter_5_response_TR_J1 } ); + +subtest 'TR_J1 _COUNTER_report_header' => sub { + + plan tests => 37; + + my @report_header = $sushi_counter_TR_J1->_COUNTER_report_header; + + # Header row #1 - Report_Name + is( $report_header[0][0], 'Report_Name', '1st row is report name' ); + is( $report_header[0][1], 'Journal Requests (Excluding OA_Gold)', '1st row is report name' ); + is( $report_header[0][2], undef, '1st row is report name' ); + + # Header row #2 - Report_ID + is( $report_header[1][0], 'Report_ID', '2nd row is report name' ); + is( $report_header[1][1], 'TR_J1', '2nd row is report name' ); + is( $report_header[1][2], undef, '2nd row is report name' ); + + # Header row #3 - Release + is( $report_header[2][0], 'Release', '3rd row is counter release' ); + is( $report_header[2][1], '5', '3rd row is counter release' ); + is( $report_header[2][2], undef, '3rd row is counter release' ); + + # Header row #4 - Institution_Name + is( $report_header[3][0], 'Institution_Name', '4th row is institution name' ); + is( $report_header[3][1], 'Test Institution', '4th row is institution name' ); + is( $report_header[3][2], undef, '4th row is institution name' ); + + # Header row #5 - Institution_ID + is( $report_header[4][0], 'Institution_ID', '5th row is institution id' ); + is( $report_header[4][1], 'Proprietary:TInsti:EALTEST001; ISNI:0000000123456789', '5th row is institution id' ); + is( $report_header[4][2], undef, '5th row is institution id' ); + + # Header row #6 - Metric_Types + is( $report_header[5][0], 'Metric_Types', '6th row is metric types' ); + is( $report_header[5][1], 'Total_Item_Requests; Unique_Item_Requests', '6th row is metric types' ); + is( $report_header[5][2], undef, '6th row is metric types' ); + + # Header row #7 - Report_Filters + is( $report_header[6][0], 'Report_Filters', '7th row is report filters' ); + is( + $report_header[6][1], + 'End_Date:2022-09-30; Access_Method:Regular; Metric_Type:Total_Item_Requests|Unique_Item_Requests; Data_Type:Journal; Begin_Date:2021-09-01; Access_Type:Controlled', + '7th row is report filters' + ); + is( $report_header[6][2], undef, '7th row is report filters' ); + + # Header row #8 - Report_Attributes + is( $report_header[7][0], 'Report_Attributes', '8th row is report attributes' ); + is( $report_header[7][1], '', '8th row is report attributes' ); + is( $report_header[7][2], undef, '8th row is report attributes' ); + + # Header row #9 - Exceptions + is( $report_header[8][0], 'Exceptions', '9th row is exceptions' ); + is( $report_header[8][1], '', '9th row is exceptions' ); + is( $report_header[8][2], undef, '9th row is exceptions' ); + + # Header row #10 - Reporting_Period + is( $report_header[9][0], 'Reporting_Period', '10th row is reporting period' ); + is( $report_header[9][1], 'Begin_Date=2021-09-01; End_Date=2022-09-30', '10th row is reporting period' ); + is( $report_header[9][2], undef, '10th row is reporting period' ); + + # Header row #11 - Created + is( $report_header[10][0], 'Created', '11th row is created' ); + is( $report_header[10][1], '2023-08-29T07:11:41Z', '11th row is created' ); + is( $report_header[10][2], undef, '11th row is created' ); + + # Header row #12 - Created + is( $report_header[11][0], 'Created_By', '12th row is created by' ); + is( $report_header[11][1], 'Test Systems Inc.', '12th row is created by' ); + is( $report_header[11][2], undef, '12th row is created by' ); + + # Header row #13 - This needs to be empty + is( $report_header[12][0], '', '13th row is empty' ); +}; + +subtest 'TR_J1 _COUNTER_report_column_headings' => sub { + + plan tests => 19; + + my @report_column_headings = $sushi_counter_TR_J1->_COUNTER_report_column_headings; + + # Standard TR_J1 column headings + is( $report_column_headings[0][0], 'Title', '1st column heading is title' ); + is( $report_column_headings[0][1], 'Publisher', '2nd column heading is publisher' ); + is( $report_column_headings[0][2], 'Publisher_ID', '3rd column heading is publisher ID' ); + is( $report_column_headings[0][3], 'Platform', '4th column heading is platform' ); + is( $report_column_headings[0][4], 'DOI', '5th column heading is DOI' ); + is( $report_column_headings[0][5], 'Proprietary_ID', '6th column heading is proprietary ID' ); + is( $report_column_headings[0][6], 'Print_ISSN', '7th column heading is print ISSN' ); + is( $report_column_headings[0][7], 'Online_ISSN', '8th column heading is online ISSN' ); + is( $report_column_headings[0][8], 'URI', '9th column heading is URI' ); + is( $report_column_headings[0][9], 'Metric_Type', '10th column heading is metric type' ); + is( $report_column_headings[0][10], 'Reporting_Period_Total', '11th column heading is reporting period total' ); + + # Months column headings + is( $report_column_headings[0][11], 'Sep 2021', '12th column is month column heading' ); + is( $report_column_headings[0][12], 'Oct 2021', '13th column is month column heading' ); + is( $report_column_headings[0][13], 'Nov 2021', '14th column is month column heading' ); + is( $report_column_headings[0][14], 'Dec 2021', '15th column is month column heading' ); + is( $report_column_headings[0][15], 'Jan 2022', '16th column is month column heading' ); + is( $report_column_headings[0][16], 'Feb 2022', '17th column is month column heading' ); + + # ... period is september 2021 to september 2022, i.e. 13 months + is( $report_column_headings[0][23], 'Sep 2022', '23rd column is the last month column heading' ); + is( $report_column_headings[0][24], undef, '24th column is empty, no more months' ); +}; + +subtest 'TR_J1 _COUNTER_report_body' => sub { + + plan tests => 16; + + my @report_body = $sushi_counter_TR_J1->_COUNTER_report_body; + + # The same title is sequential but for different metric types + is( $report_body[0][0], 'Education and Training', 'same title, different metric type' ); + is( $report_body[1][0], 'Education and Training', 'same title, different metric type' ); + is( $report_body[0][9], 'Total_Item_Requests', 'same title, different metric type' ); + is( $report_body[1][9], 'Unique_Item_Requests', 'same title, different metric type' ); + + # The data is in the correct column + is( $report_body[2][0], 'Test Journal', '1st column is title' ); + is( $report_body[2][1], 'Test Publisher', '2nd column is publisher' ); + is( $report_body[2][2], '0000000123456789', '3rd column heading is publisher ID' ); + is( $report_body[2][3], 'Unit Test Library', '4th column is platform' ); + is( $report_body[2][4], '10.1002/(ISSN)1111-2222', '5th column is DOI' ); + is( $report_body[2][5], 'TInsti:ABC1', '6th column is proprietary ID' ); + is( $report_body[2][6], '7777-8888', '7th column is print ISSN' ); + is( $report_body[2][7], '5555-6666', '8th column is online ISSN' ); + is( $report_body[2][8], '', '9th column is URI' ); + is( $report_body[2][9], 'Total_Item_Requests', '10th column is metric type' ); + is( $report_body[2][10], 2, '11th column is reporting period total' ); + + # The period total is the sum of all the month columns + my $stats_total = 0; + for ( my $i = 11 ; $i < 24 ; $i++ ) { + $stats_total += $report_body[0][$i]; + } + is( + $report_body[0][10], $stats_total, + 'Reporting period total matches the sum of all the monthly usage statistics' + ); +}; + +my $sushi_response_file_TR_J2 = dirname(__FILE__) . "/../../../data/erm/eusage/TR_J2.json"; +my $sushi_counter_5_response_TR_J2 = decode_json( read_file($sushi_response_file_TR_J2) ); +my $sushi_counter_TR_J2 = Koha::ERM::EUsage::SushiCounter->new( { response => $sushi_counter_5_response_TR_J2 } ); + +subtest 'TR_J2 _COUNTER_report_header' => sub { + + plan tests => 37; + + my @report_header = $sushi_counter_TR_J2->_COUNTER_report_header; + + # Header row #1 - Report_Name + is( $report_header[0][0], 'Report_Name', '1st row is report name' ); + is( $report_header[0][1], 'Journal Access Denied', '1st row is report name' ); + is( $report_header[0][2], undef, '1st row is report name' ); + + # Header row #2 - Report_ID + is( $report_header[1][0], 'Report_ID', '2nd row is report name' ); + is( $report_header[1][1], 'TR_J2', '2nd row is report name' ); + is( $report_header[1][2], undef, '2nd row is report name' ); + + # Header row #3 - Release + is( $report_header[2][0], 'Release', '3rd row is counter release' ); + is( $report_header[2][1], '5', '3rd row is counter release' ); + is( $report_header[2][2], undef, '3rd row is counter release' ); + + # Header row #4 - Institution_Name + is( $report_header[3][0], 'Institution_Name', '4th row is institution name' ); + is( $report_header[3][1], 'Test Institution', '4th row is institution name' ); + is( $report_header[3][2], undef, '4th row is institution name' ); + + # Header row #5 - Institution_ID + is( $report_header[4][0], 'Institution_ID', '5th row is institution id' ); + is( $report_header[4][1], 'Proprietary:aaaa:99999999', '5th row is institution id' ); + is( $report_header[4][2], undef, '5th row is institution id' ); + + # Header row #6 - Metric_Types + is( $report_header[5][0], 'Metric_Types', '6th row is metric types' ); + is( $report_header[5][1], 'Limit_Exceeded; No_License', '6th row is metric types' ); + is( $report_header[5][2], undef, '6th row is metric types' ); + + # Header row #7 - Report_Filters + is( $report_header[6][0], 'Report_Filters', '7th row is report filters' ); + is( + $report_header[6][1], + 'Data_Type:Journal; End_Date:2023-09-30; Access_Method:Regular; Metric_Type:Limit_Exceeded|No_License; Begin_Date:2023-08-01', + '7th row is report filters' + ); + is( $report_header[6][2], undef, '7th row is report filters' ); + + # Header row #8 - Report_Attributes + is( $report_header[7][0], 'Report_Attributes', '8th row is report attributes' ); + is( $report_header[7][1], '', '8th row is report attributes' ); + is( $report_header[7][2], undef, '8th row is report attributes' ); + + # Header row #9 - Exceptions + is( $report_header[8][0], 'Exceptions', '9th row is exceptions' ); + is( $report_header[8][1], '', '9th row is exceptions' ); + is( $report_header[8][2], undef, '9th row is exceptions' ); + + # Header row #10 - Reporting_Period + is( $report_header[9][0], 'Reporting_Period', '10th row is reporting period' ); + is( $report_header[9][1], 'Begin_Date=2023-08-01; End_Date=2023-09-30', '10th row is reporting period' ); + is( $report_header[9][2], undef, '10th row is reporting period' ); + + # Header row #11 - Created + is( $report_header[10][0], 'Created', '11th row is created' ); + is( $report_header[10][1], '2023-10-23T07:27:10Z', '11th row is created' ); + is( $report_header[10][2], undef, '11th row is created' ); + + # Header row #12 - Created + is( $report_header[11][0], 'Created_By', '12th row is created by' ); + is( $report_header[11][1], 'Test Systems Inc.', '12th row is created by' ); + is( $report_header[11][2], undef, '12th row is created by' ); + + # Header row #13 - This needs to be empty + is( $report_header[12][0], '', '13th row is empty' ); +}; + +subtest 'TR_J2 _COUNTER_report_column_headings' => sub { + + plan tests => 14; + + my @report_column_headings = $sushi_counter_TR_J2->_COUNTER_report_column_headings; + + # Standard TR_J2 column headings + is( $report_column_headings[0][0], 'Title', '1st column heading is title' ); + is( $report_column_headings[0][1], 'Publisher', '2nd column heading is publisher' ); + is( $report_column_headings[0][2], 'Publisher_ID', '3rd column heading is publisher ID' ); + is( $report_column_headings[0][3], 'Platform', '4th column heading is platform' ); + is( $report_column_headings[0][4], 'DOI', '5th column heading is DOI' ); + is( $report_column_headings[0][5], 'Proprietary_ID', '6th column heading is proprietary ID' ); + is( $report_column_headings[0][6], 'Print_ISSN', '7th column heading is print ISSN' ); + is( $report_column_headings[0][7], 'Online_ISSN', '8th column heading is online ISSN' ); + is( $report_column_headings[0][8], 'URI', '9th column heading is URI' ); + is( $report_column_headings[0][9], 'Metric_Type', '10th column heading is metric type' ); + is( $report_column_headings[0][10], 'Reporting_Period_Total', '11th column heading is reporting period total' ); + + # Months column headings + is( $report_column_headings[0][11], 'Aug 2023', '12th column is month column heading' ); + is( $report_column_headings[0][12], 'Sep 2023', '13th column is the last month column heading' ); + is( $report_column_headings[0][13], undef, '14th column is empty, no more months' ); +}; + +subtest 'TR_J2 _COUNTER_report_body' => sub { + + plan tests => 16; + + my @report_body = $sushi_counter_TR_J2->_COUNTER_report_body; + + # The same title is sequential but for different metric types + is( $report_body[0][0], 'ACS Applied Materials & Interfaces', 'different title, same metric type' ); + is( $report_body[1][0], 'ACS Chemical Biology', 'different title, same metric type' ); + is( $report_body[0][9], 'No_License', '1st title, same metric_type because there is only one' ); + is( $report_body[1][9], 'No_License', '2nd title, same metric_type because there is only one' ); + + # The data is in the correct column + is( $report_body[2][0], 'ACS Chemical Health & Safety', '1st column is title' ); + is( $report_body[2][1], 'Test Publisher', '2nd column is publisher' ); + is( $report_body[2][2], '', '3rd column heading is publisher ID' ); + is( $report_body[2][3], 'Unit Test Library', '4th column is platform' ); + is( $report_body[2][4], '10.1021/aaaac5', '5th column is DOI' ); + is( $report_body[2][5], 'aaaa:aaaac5', '6th column is proprietary ID' ); + is( $report_body[2][6], '', '7th column is print ISSN' ); + is( $report_body[2][7], '1878-0504', '8th column is online ISSN' ); + is( $report_body[2][8], '', '9th column is URI' ); + is( $report_body[2][9], 'No_License', '10th column is metric type' ); + is( $report_body[2][10], 2, '11th column is reporting period total' ); + + # The period total is the sum of all the month columns + my $stats_total = 0; + for ( my $i = 11 ; $i < 13 ; $i++ ) { + $stats_total += $report_body[0][$i]; + } + is( + $report_body[0][10], $stats_total, + 'Reporting period total matches the sum of all the monthly usage statistics' + ); +}; + +my $sushi_response_file_TR_J3 = dirname(__FILE__) . "/../../../data/erm/eusage/TR_J3.json"; +my $sushi_counter_5_response_TR_J3 = decode_json( read_file($sushi_response_file_TR_J3) ); +my $sushi_counter_TR_J3 = Koha::ERM::EUsage::SushiCounter->new( { response => $sushi_counter_5_response_TR_J3 } ); + +subtest 'TR_J3 _COUNTER_report_header' => sub { + + plan tests => 37; + + my @report_header = $sushi_counter_TR_J3->_COUNTER_report_header; + + # Header row #1 - Report_Name + is( $report_header[0][0], 'Report_Name', '1st row is report name' ); + is( $report_header[0][1], 'Journal Usage by Access Type', '1st row is report name' ); + is( $report_header[0][2], undef, '1st row is report name' ); + + # Header row #2 - Report_ID + is( $report_header[1][0], 'Report_ID', '2nd row is report name' ); + is( $report_header[1][1], 'TR_J3', '2nd row is report name' ); + is( $report_header[1][2], undef, '2nd row is report name' ); + + # Header row #3 - Release + is( $report_header[2][0], 'Release', '3rd row is counter release' ); + is( $report_header[2][1], '5', '3rd row is counter release' ); + is( $report_header[2][2], undef, '3rd row is counter release' ); + + # Header row #4 - Institution_Name + is( $report_header[3][0], 'Institution_Name', '4th row is institution name' ); + is( $report_header[3][1], 'Test Institution', '4th row is institution name' ); + is( $report_header[3][2], undef, '4th row is institution name' ); + + # Header row #5 - Institution_ID + is( $report_header[4][0], 'Institution_ID', '5th row is institution id' ); + is( $report_header[4][1], 'Proprietary:aaaa:99999999', '5th row is institution id' ); + is( $report_header[4][2], undef, '5th row is institution id' ); + + # Header row #6 - Metric_Types + is( $report_header[5][0], 'Metric_Types', '6th row is metric types' ); + is( + $report_header[5][1], + 'Total_Item_Investigations; Total_Item_Requests; Unique_Item_Investigations; Unique_Item_Requests', + '6th row is metric types' + ); + is( $report_header[5][2], undef, '6th row is metric types' ); + + # Header row #7 - Report_Filters + is( $report_header[6][0], 'Report_Filters', '7th row is report filters' ); + is( + $report_header[6][1], + 'Metric_Type:Total_Item_Investigations|Total_Item_Requests|Unique_Item_Investigations|Unique_Item_Requests; Access_Method:Regular; End_Date:2023-09-30; Data_Type:Journal; Begin_Date:2023-08-01', + '7th row is report filters' + ); + is( $report_header[6][2], undef, '7th row is report filters' ); + + # Header row #8 - Report_Attributes + is( $report_header[7][0], 'Report_Attributes', '8th row is report attributes' ); + is( $report_header[7][1], '', '8th row is report attributes' ); + is( $report_header[7][2], undef, '8th row is report attributes' ); + + # Header row #9 - Exceptions + is( $report_header[8][0], 'Exceptions', '9th row is exceptions' ); + is( $report_header[8][1], '', '9th row is exceptions' ); + is( $report_header[8][2], undef, '9th row is exceptions' ); + + # Header row #10 - Reporting_Period + is( $report_header[9][0], 'Reporting_Period', '10th row is reporting period' ); + is( $report_header[9][1], 'Begin_Date=2023-08-01; End_Date=2023-09-30', '10th row is reporting period' ); + is( $report_header[9][2], undef, '10th row is reporting period' ); + + # Header row #11 - Created + is( $report_header[10][0], 'Created', '11th row is created' ); + is( $report_header[10][1], '2023-10-23T07:59:08Z', '11th row is created' ); + is( $report_header[10][2], undef, '11th row is created' ); + + # Header row #12 - Created + is( $report_header[11][0], 'Created_By', '12th row is created by' ); + is( $report_header[11][1], 'Test Systems Inc.', '12th row is created by' ); + is( $report_header[11][2], undef, '12th row is created by' ); + + # Header row #13 - This needs to be empty + is( $report_header[12][0], '', '13th row is empty' ); +}; + +subtest 'TR_J3 _COUNTER_report_column_headings' => sub { + + plan tests => 15; + + my @report_column_headings = $sushi_counter_TR_J3->_COUNTER_report_column_headings; + + # Standard TR_J3 column headings + is( $report_column_headings[0][0], 'Title', '1st column heading is title' ); + is( $report_column_headings[0][1], 'Publisher', '2nd column heading is publisher' ); + is( $report_column_headings[0][2], 'Publisher_ID', '3rd column heading is publisher ID' ); + is( $report_column_headings[0][3], 'Platform', '4th column heading is platform' ); + is( $report_column_headings[0][4], 'DOI', '5th column heading is DOI' ); + is( $report_column_headings[0][5], 'Proprietary_ID', '6th column heading is proprietary ID' ); + is( $report_column_headings[0][6], 'Print_ISSN', '7th column heading is print ISSN' ); + is( $report_column_headings[0][7], 'Online_ISSN', '8th column heading is online ISSN' ); + is( $report_column_headings[0][8], 'URI', '9th column heading is URI' ); + is( $report_column_headings[0][9], 'Access_Type', '10th column heading is access type' ); + is( $report_column_headings[0][10], 'Metric_Type', '11th column heading is access type' ); + is( $report_column_headings[0][11], 'Reporting_Period_Total', '12th column heading is reporting period total' ); + + # Months column headings + is( $report_column_headings[0][12], 'Aug 2023', '12th column is month column heading' ); + is( $report_column_headings[0][13], 'Sep 2023', '13th column is the last month column heading' ); + is( $report_column_headings[0][24], undef, '14th column is empty, no more months' ); +}; + +subtest 'TR_J3 _COUNTER_report_body' => sub { + + plan tests => 25; + + my @report_body = $sushi_counter_TR_J3->_COUNTER_report_body; + + # The same title is sequential but for different metric types + is( $report_body[0][0], 'TEST Applied Energy Materials', 'same title, different metric type' ); + is( $report_body[1][0], 'TEST Applied Energy Materials', 'same title, different metric type' ); + is( $report_body[2][0], 'TEST Applied Energy Materials', 'same title, different metric type' ); + is( $report_body[3][0], 'TEST Applied Energy Materials', 'same title, different metric type' ); + is( $report_body[0][9], 'OA_Gold', 'same title, same access_type' ); + is( $report_body[1][9], 'OA_Gold', 'same title, same access_type' ); + is( $report_body[2][9], 'OA_Gold', 'same title, same access_type' ); + is( $report_body[3][9], 'OA_Gold', 'same title, same access_type' ); + is( $report_body[0][10], 'Total_Item_Requests', 'same title, different metric type' ); + is( $report_body[1][10], 'Unique_Item_Requests', 'same title, different metric type' ); + is( $report_body[2][10], 'Unique_Item_Investigations', 'same title, different metric type' ); + is( $report_body[3][10], 'Total_Item_Investigations', 'same title, different metric type' ); + + # The data is in the correct column + is( $report_body[2][0], 'TEST Applied Energy Materials', '1st column is title' ); + is( $report_body[2][1], 'Test Publisher', '2nd column is publisher' ); + is( $report_body[2][2], '', '3rd column heading is publisher ID' ); + is( $report_body[2][3], 'TEST', '4th column is platform' ); + is( $report_body[2][4], '10.1021/aaemcq', '5th column is DOI' ); + is( $report_body[2][5], 'aaaa:aaemcq', '6th column is proprietary ID' ); + is( $report_body[2][6], '', '7th column is print ISSN' ); + is( $report_body[2][7], '2574-0962', '8th column is online ISSN' ); + is( $report_body[2][8], '', '9th column is URI' ); + is( $report_body[2][9], 'OA_Gold', '10th column is access type' ); + is( $report_body[2][10], 'Unique_Item_Investigations', '10th column is metric type' ); + is( $report_body[2][11], 3, '11th column is reporting period total' ); + + # The period total is the sum of all the month columns + my $stats_total = 0; + for ( my $i = 12 ; $i < 14 ; $i++ ) { + $stats_total += $report_body[0][$i]; + } + is( + $report_body[0][11], $stats_total, + 'Reporting period total matches the sum of all the monthly usage statistics' + ); +}; + +my $sushi_response_file_TR_J4 = dirname(__FILE__) . "/../../../data/erm/eusage/TR_J4.json"; +my $sushi_counter_5_response_TR_J4 = decode_json( read_file($sushi_response_file_TR_J4) ); +my $sushi_counter_TR_J4 = Koha::ERM::EUsage::SushiCounter->new( { response => $sushi_counter_5_response_TR_J4 } ); + +subtest 'TR_J4 _COUNTER_report_header' => sub { + + plan tests => 37; + + my @report_header = $sushi_counter_TR_J4->_COUNTER_report_header; + + # Header row #1 - Report_Name + is( $report_header[0][0], 'Report_Name', '1st row is report name' ); + is( $report_header[0][1], 'Journal Requests by YOP (Excluding OA_Gold)', '1st row is report name' ); + is( $report_header[0][2], undef, '1st row is report name' ); + + # Header row #2 - Report_ID + is( $report_header[1][0], 'Report_ID', '2nd row is report name' ); + is( $report_header[1][1], 'TR_J4', '2nd row is report name' ); + is( $report_header[1][2], undef, '2nd row is report name' ); + + # Header row #3 - Release + is( $report_header[2][0], 'Release', '3rd row is counter release' ); + is( $report_header[2][1], '5', '3rd row is counter release' ); + is( $report_header[2][2], undef, '3rd row is counter release' ); + + # Header row #4 - Institution_Name + is( $report_header[3][0], 'Institution_Name', '4th row is institution name' ); + is( $report_header[3][1], 'Test Institution', '4th row is institution name' ); + is( $report_header[3][2], undef, '4th row is institution name' ); + + # Header row #5 - Institution_ID + is( $report_header[4][0], 'Institution_ID', '5th row is institution id' ); + is( $report_header[4][1], 'Proprietary:aaaa:99999999', '5th row is institution id' ); + is( $report_header[4][2], undef, '5th row is institution id' ); + + # Header row #6 - Metric_Types + is( $report_header[5][0], 'Metric_Types', '6th row is metric types' ); + is( + $report_header[5][1], + 'Total_Item_Requests; Unique_Item_Requests', + '6th row is metric types' + ); + is( $report_header[5][2], undef, '6th row is metric types' ); + + # Header row #7 - Report_Filters + is( $report_header[6][0], 'Report_Filters', '7th row is report filters' ); + is( + $report_header[6][1], + 'Metric_Type:Total_Item_Requests|Unique_Item_Requests; Access_Method:Regular; Begin_Date:2023-08-01; Access_Type:Controlled; End_Date:2023-09-30; Data_Type:Journal', + '7th row is report filters' + ); + is( $report_header[6][2], undef, '7th row is report filters' ); + + # Header row #8 - Report_Attributes + is( $report_header[7][0], 'Report_Attributes', '8th row is report attributes' ); + is( $report_header[7][1], '', '8th row is report attributes' ); + is( $report_header[7][2], undef, '8th row is report attributes' ); + + # Header row #9 - Exceptions + is( $report_header[8][0], 'Exceptions', '9th row is exceptions' ); + is( $report_header[8][1], '', '9th row is exceptions' ); + is( $report_header[8][2], undef, '9th row is exceptions' ); + + # Header row #10 - Reporting_Period + is( $report_header[9][0], 'Reporting_Period', '10th row is reporting period' ); + is( $report_header[9][1], 'Begin_Date=2023-08-01; End_Date=2023-09-30', '10th row is reporting period' ); + is( $report_header[9][2], undef, '10th row is reporting period' ); + + # Header row #11 - Created + is( $report_header[10][0], 'Created', '11th row is created' ); + is( $report_header[10][1], '2023-10-23T08:41:45Z', '11th row is created' ); + is( $report_header[10][2], undef, '11th row is created' ); + + # Header row #12 - Created + is( $report_header[11][0], 'Created_By', '12th row is created by' ); + is( $report_header[11][1], 'Test Systems Inc.', '12th row is created by' ); + is( $report_header[11][2], undef, '12th row is created by' ); + + # Header row #13 - This needs to be empty + is( $report_header[12][0], '', '13th row is empty' ); +}; + +subtest 'TR_J4 _COUNTER_report_column_headings' => sub { + + plan tests => 15; + + my @report_column_headings = $sushi_counter_TR_J4->_COUNTER_report_column_headings; + + # Standard TR_J4 column headings + is( $report_column_headings[0][0], 'Title', '1st column heading is title' ); + is( $report_column_headings[0][1], 'Publisher', '2nd column heading is publisher' ); + is( $report_column_headings[0][2], 'Publisher_ID', '3rd column heading is publisher ID' ); + is( $report_column_headings[0][3], 'Platform', '4th column heading is platform' ); + is( $report_column_headings[0][4], 'DOI', '5th column heading is DOI' ); + is( $report_column_headings[0][5], 'Proprietary_ID', '6th column heading is proprietary ID' ); + is( $report_column_headings[0][6], 'Print_ISSN', '7th column heading is print ISSN' ); + is( $report_column_headings[0][7], 'Online_ISSN', '8th column heading is online ISSN' ); + is( $report_column_headings[0][8], 'URI', '9th column heading is URI' ); + is( $report_column_headings[0][9], 'YOP', '10th column heading is yop' ); + is( $report_column_headings[0][10], 'Metric_Type', '11th column heading is metric type' ); + is( $report_column_headings[0][11], 'Reporting_Period_Total', '12th column heading is reporting period total' ); + + # Months column headings + is( $report_column_headings[0][12], 'Aug 2023', '13th column is month column heading' ); + is( $report_column_headings[0][13], 'Sep 2023', '14th column is the last month column heading' ); + is( $report_column_headings[0][14], undef, '15th column is empty, no more months' ); +}; + +subtest 'TR_J4 _COUNTER_report_body' => sub { + + plan tests => 25; + + my @report_body = $sushi_counter_TR_J4->_COUNTER_report_body; + + # The same title is sequential but for different metric types + is( $report_body[0][0], 'TEST Infectious Diseases', 'same title, different metric type' ); + is( $report_body[1][0], 'TEST Infectious Diseases', 'same title, different metric type' ); + is( $report_body[2][0], 'TEST Infectious Diseases', 'same title, different metric type' ); + is( $report_body[3][0], 'TEST Infectious Diseases', 'same title, different metric type' ); + is( $report_body[0][10], 'Unique_Item_Requests', '1st title, same yop' ); + is( $report_body[1][10], 'Total_Item_Requests', '1st title, same yop' ); + is( $report_body[2][10], 'Unique_Item_Requests', '1st title, same yop' ); + is( $report_body[3][10], 'Total_Item_Requests', '1st title, same yop' ); + is( $report_body[0][9], '2021', '1st title, yop' ); + is( $report_body[1][9], '2021', '1st title, yop' ); + is( $report_body[2][9], '2022', '1st title,yop' ); + is( $report_body[3][9], '2022', '1st title, yop' ); + + # The data is in the correct column + is( $report_body[2][0], 'TEST Infectious Diseases', '1st column is title' ); + is( $report_body[2][1], 'Test Publisher', '2nd column is publisher' ); + is( $report_body[2][2], '', '3rd column heading is publisher ID' ); + is( $report_body[2][3], 'TEST', '4th column is platform' ); + is( $report_body[2][4], '10.1021/aidcbc', '5th column is DOI' ); + is( $report_body[2][5], 'aaaa:aidcbc', '6th column is proprietary ID' ); + is( $report_body[2][6], '', '7th column is print ISSN' ); + is( $report_body[2][7], '2373-8227', '8th column is online ISSN' ); + is( $report_body[2][8], '', '9th column is URI' ); + is( $report_body[2][9], '2022', '10th column is yop' ); + is( $report_body[2][10], 'Unique_Item_Requests', '10th column is metric type' ); + is( $report_body[2][11], 1, '11th column is reporting period total' ); + + # The period total is the sum of all the month columns + my $stats_total = 0; + for ( my $i = 12 ; $i < 14 ; $i++ ) { + $stats_total += $report_body[0][$i]; + } + is( + $report_body[0][11], $stats_total, + 'Reporting period total matches the sum of all the monthly usage statistics' + ); +}; + +my $sushi_response_file_TR_B3 = dirname(__FILE__) . "/../../../data/erm/eusage/TR_B3.json"; +my $sushi_counter_5_response_TR_B3 = decode_json( read_file($sushi_response_file_TR_B3) ); +my $sushi_counter_TR_B3 = Koha::ERM::EUsage::SushiCounter->new( { response => $sushi_counter_5_response_TR_B3 } ); + +subtest 'TR_B3 _COUNTER_report_header' => sub { + + plan tests => 37; + + my @report_header = $sushi_counter_TR_B3->_COUNTER_report_header; + + # Header row #1 - Report_Name + is( $report_header[0][0], 'Report_Name', '1st row is report name' ); + is( $report_header[0][1], 'Book Usage by Access Type', '1st row is report name' ); + is( $report_header[0][2], undef, '1st row is report name' ); + + # Header row #2 - Report_ID + is( $report_header[1][0], 'Report_ID', '2nd row is report name' ); + is( $report_header[1][1], 'TR_B3', '2nd row is report name' ); + is( $report_header[1][2], undef, '2nd row is report name' ); + + # Header row #3 - Release + is( $report_header[2][0], 'Release', '3rd row is counter release' ); + is( $report_header[2][1], '5', '3rd row is counter release' ); + is( $report_header[2][2], undef, '3rd row is counter release' ); + + # Header row #4 - Institution_Name + is( $report_header[3][0], 'Institution_Name', '4th row is institution name' ); + is( $report_header[3][1], 'Test Institution', '4th row is institution name' ); + is( $report_header[3][2], undef, '4th row is institution name' ); + + # Header row #5 - Institution_ID + is( $report_header[4][0], 'Institution_ID', '5th row is institution id' ); + is( $report_header[4][1], 'Proprietary:SN:TEST_CUSTOMER_ID', '5th row is institution id' ); + is( $report_header[4][2], undef, '5th row is institution id' ); + + # Header row #6 - Metric_Types + is( $report_header[5][0], 'Metric_Types', '6th row is metric types' ); + is( + $report_header[5][1], + 'Total_Item_Investigations; Total_Item_Requests; Unique_Item_Investigations; Unique_Item_Requests; Unique_Title_Investigations; Unique_Title_Requests', + '6th row is metric types' + ); + is( $report_header[5][2], undef, '6th row is metric types' ); + + # Header row #7 - Report_Filters + is( $report_header[6][0], 'Report_Filters', '7th row is report filters' ); + is( + $report_header[6][1], + 'Data_Type:Book; Access_Method:Regular; Metric_Type:Total_Item_Investigations|Total_Item_Requests|Unique_Item_Investigations|Unique_Item_Requests|Unique_Title_Investigations|Unique_Title_Requests; Begin_Date:2023-07-01; End_Date:2023-08-31', + '7th row is report filters' + ); + is( $report_header[6][2], undef, '7th row is report filters' ); + + # Header row #8 - Report_Attributes + is( $report_header[7][0], 'Report_Attributes', '8th row is report attributes' ); + is( $report_header[7][1], '', '8th row is report attributes' ); + is( $report_header[7][2], undef, '8th row is report attributes' ); + + # Header row #9 - Exceptions + is( $report_header[8][0], 'Exceptions', '9th row is exceptions' ); + is( $report_header[8][1], '', '9th row is exceptions' ); + is( $report_header[8][2], undef, '9th row is exceptions' ); + + # Header row #10 - Reporting_Period + is( $report_header[9][0], 'Reporting_Period', '10th row is reporting period' ); + is( $report_header[9][1], 'Begin_Date=2023-07-01; End_Date=2023-08-31', '10th row is reporting period' ); + is( $report_header[9][2], undef, '10th row is reporting period' ); + + # Header row #11 - Created + is( $report_header[10][0], 'Created', '11th row is created' ); + is( $report_header[10][1], '2023-10-26T14:43:51Z', '11th row is created' ); + is( $report_header[10][2], undef, '11th row is created' ); + + # Header row #12 - Created + is( $report_header[11][0], 'Created_By', '12th row is created by' ); + is( $report_header[11][1], 'Test Systems Inc.', '12th row is created by' ); + is( $report_header[11][2], undef, '12th row is created by' ); + + # Header row #13 - This needs to be empty + is( $report_header[12][0], '', '13th row is empty' ); +}; + +subtest 'TR_B3 _COUNTER_report_column_headings' => sub { + + plan tests => 17; + + my @report_column_headings = $sushi_counter_TR_B3->_COUNTER_report_column_headings; + + # Standard TR_J4 column headings + is( $report_column_headings[0][0], 'Title', '1st column heading is title' ); + is( $report_column_headings[0][1], 'Publisher', '2nd column heading is publisher' ); + is( $report_column_headings[0][2], 'Publisher_ID', '3rd column heading is publisher ID' ); + is( $report_column_headings[0][3], 'Platform', '4th column heading is platform' ); + is( $report_column_headings[0][4], 'DOI', '5th column heading is DOI' ); + is( $report_column_headings[0][5], 'Proprietary_ID', '6th column heading is proprietary ID' ); + is( $report_column_headings[0][6], 'ISBN', '7th column heading is ISBN' ); + is( $report_column_headings[0][7], 'Print_ISSN', '8th column heading is print ISSN' ); + is( $report_column_headings[0][8], 'Online_ISSN', '9th column heading is online ISSN' ); + is( $report_column_headings[0][9], 'URI', '10th column heading is URI' ); + is( $report_column_headings[0][10], 'YOP', '11th column heading is yop' ); + is( $report_column_headings[0][11], 'Access_Type', '12th column heading is access type' ); + is( $report_column_headings[0][12], 'Metric_Type', '13th column heading is metric type' ); + is( $report_column_headings[0][13], 'Reporting_Period_Total', '14th column heading is reporting period total' ); + + # Months column headings + is( $report_column_headings[0][14], 'Jul 2023', '15th column is month column heading' ); + is( $report_column_headings[0][15], 'Aug 2023', '16th column is the last month column heading' ); + is( $report_column_headings[0][16], undef, '17th column is empty, no more months' ); +}; + +subtest 'TR_B3 _COUNTER_report_body' => sub { + + plan tests => 51; + + my @report_body = $sushi_counter_TR_B3->_COUNTER_report_body; + + # The same title is sequential but for different metric types + is( + $report_body[0][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[1][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[2][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[3][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[4][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[5][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[6][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[7][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( + $report_body[8][0], 'Insect Cell Culture: Fundamental and Applied Aspects', + 'same title, different metric type' + ); + is( $report_body[0][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[1][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[2][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[3][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[4][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[5][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[6][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[7][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[8][11], 'Controlled', '9 rows for 1st title' ); + is( $report_body[0][12], 'Unique_Item_Investigations', '1st title, metric type' ); + is( $report_body[1][12], 'Unique_Title_Investigations', '1st title, metric type' ); + is( $report_body[2][12], 'Total_Item_Investigations', '1st title, metric type' ); + is( $report_body[3][12], 'Unique_Item_Requests', '1st title, metric type' ); + is( $report_body[4][12], 'Total_Item_Requests', '1st title, metric type' ); + is( $report_body[5][12], 'Unique_Item_Investigations', '1st title, metric type' ); + is( $report_body[6][12], 'Unique_Title_Investigations', '1st title, metric type' ); + is( $report_body[7][12], 'Total_Item_Investigations', '1st title, metric type' ); + is( $report_body[8][12], 'Unique_Title_Requests', '1st title, metric type' ); + is( $report_body[0][10], '1996', '1st title, yop' ); + is( $report_body[1][10], '1996', '1st title, yop' ); + is( $report_body[2][10], '1996', '1st title,yop' ); + is( $report_body[3][10], '2002', '1st title, 2nd yop has 6 metric types' ); + is( $report_body[4][10], '2002', '1st title, 2nd yop has 6 metric types' ); + is( $report_body[5][10], '2002', '1st title, 2nd yop has 6 metric types' ); + is( $report_body[6][10], '2002', '1st title, 2nd yop has 6 metric types' ); + is( $report_body[7][10], '2002', '1st title, 2nd yop has 6 metric types' ); + is( $report_body[8][10], '2002', '1st title, 2nd yop has 6 metric types' ); + + # The data is in the correct column + is( $report_body[2][0], 'Insect Cell Culture: Fundamental and Applied Aspects', '1st column is title' ); + is( $report_body[2][1], 'Test Publisher', '2nd column is publisher' ); + is( $report_body[2][2], '', '3rd column heading is publisher ID' ); + is( $report_body[2][3], 'Test Platform', '4th column is platform' ); + is( $report_body[2][4], '10.1007/0-306-46850-6', '5th column is DOI' ); + is( $report_body[2][5], 'aaaa:aidcbc', '6th column is proprietary ID' ); + is( $report_body[2][6], '978-0-306-46850-6', '7th column is ISBN' ); + is( $report_body[2][7], '1386-2928', '8th column is print ISSN' ); + is( $report_body[2][8], '', '9th column is online ISSN' ); + is( $report_body[2][9], '', '10th column is URI' ); + is( $report_body[2][10], '1996', '11th column is yop' ); + is( $report_body[2][11], 'Controlled', '12th column is access type' ); + is( $report_body[2][12], 'Total_Item_Investigations', '13th column is metric type' ); + is( $report_body[2][13], 1, '14th column is reporting period total' ); + + # The period total is the sum of all the month columns + my $stats_total = 0; + for ( my $i = 14 ; $i < 16 ; $i++ ) { + $stats_total += $report_body[0][$i]; + } + is( + $report_body[0][14], $stats_total, + 'Reporting period total matches the sum of all the monthly usage statistics' + ); +}; diff --git a/t/db_dependent/Koha/ERM/EUsage/UsageDataProvider.t b/t/db_dependent/Koha/ERM/EUsage/UsageDataProvider.t new file mode 100755 index 0000000000..cf06ae0b56 --- /dev/null +++ b/t/db_dependent/Koha/ERM/EUsage/UsageDataProvider.t @@ -0,0 +1,75 @@ +#!/usr/bin/perl + +# This file is part of Koha +# +# Koha is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 3 of the License, or +# (at your option) any later version. +# +# Koha is distributed in the hope that it will be useful, but +# WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with Koha; if not, see . + +use Modern::Perl; + +use Test::More tests => 1; + +use Koha::ERM::EUsage::UsageDataProvider; +use Koha::Database; + +use t::lib::TestBuilder; + +my $schema = Koha::Database->new->schema; +my $builder = t::lib::TestBuilder->new; + +subtest '_build_url_query' => sub { + + plan tests => 1; + + $schema->storage->txn_begin; + + my $service_url = 'https://service_url.com'; + my $api_key = 'APIKEY'; + my $requestor_id = 'REQID123'; + my $customer_id = 'ID123'; + my $name = 'TestProvider'; + + my $usage_data_provider = $builder->build_object( + { + class => 'Koha::ERM::EUsage::UsageDataProviders', + value => { + service_url => $service_url, api_key => $api_key, requestor_id => $requestor_id, + customer_id => $customer_id, name => $name + } + } + ); + + $usage_data_provider->{report_type} = 'TR_J1'; + $usage_data_provider->{begin_date} = '2023-08-01'; + $usage_data_provider->{end_date} = '2023-09-30'; + + is( + $usage_data_provider->_build_url_query, + $service_url + . '/reports/' + . lc( $usage_data_provider->{report_type} ) + . '?customer_id=' + . $customer_id + . '&requestor_id=' + . $requestor_id + . '&api_key=' + . $api_key + . '&begin_date=' + . substr( $usage_data_provider->{begin_date}, 0, 7 ) + . '&end_date=' + . substr( $usage_data_provider->{end_date}, 0, 7 ) + ); + + $schema->storage->txn_rollback; + +}; diff --git a/t/db_dependent/data/erm/eusage/TR_B3.json b/t/db_dependent/data/erm/eusage/TR_B3.json new file mode 100644 index 0000000000..804f017c1b --- /dev/null +++ b/t/db_dependent/data/erm/eusage/TR_B3.json @@ -0,0 +1,541 @@ +{ + "Report_Header": { + "Created": "2023-10-26T14:43:51Z", + "Created_By": "Test Systems Inc.", + "Customer_ID": "TEST_CUSTOMER_ID", + "Report_ID": "TR_B3", + "Release": "5", + "Report_Name": "Book Usage by Access Type", + "Institution_Name": "Test Institution", + "Institution_ID": [{ "Type": "Proprietary", "Value": "SN:TEST_CUSTOMER_ID" }], + "Report_Filters": [ + { "Name": "Data_Type", "Value": "Book" }, + { "Name": "Access_Method", "Value": "Regular" }, + { + "Name": "Metric_Type", + "Value": "Total_Item_Investigations|Total_Item_Requests|Unique_Item_Investigations|Unique_Item_Requests|Unique_Title_Investigations|Unique_Title_Requests" + }, + { "Name": "Begin_Date", "Value": "2023-07-01" }, + { "Name": "End_Date", "Value": "2023-08-31" } + ] + }, + "Report_Items": [ + { + "Title": "Insect Cell Culture: Fundamental and Applied Aspects", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/0-306-46850-6" }, + { "Type": "ISBN", "Value": "978-0-306-46850-6" }, + { "Type": "Print_ISSN", "Value": "1386-2928" }, + { "Type": "Proprietary", "Value": "aaaa:aidcbc" } + ], + "Platform": "Test Platform", + "Publisher": "Test Publisher", + "YOP": "1996", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ] + }, + { + "Title": "Insect Cell Culture: Fundamental and Applied Aspects", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/0-306-46850-6" }, + { "Type": "ISBN", "Value": "978-0-306-46850-6" }, + { "Type": "Print_ISSN", "Value": "1386-2928" }, + { "Type": "Proprietary", "Value": "aaaa:aidcbc" } + ], + "Platform": "Test Platform", + "Publisher": "Test Publisher", + "YOP": "2002", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "The Prokaryotes", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/0-387-30743-5" }, + { "Type": "ISBN", "Value": "978-0-387-30743-5" }, + { "Type": "Proprietary", "Value": "SN:10.1007/0-387-30743-5" } + ], + "Platform": "Test Platform", + "Publisher": "Springer New York", + "YOP": "2006", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "The Prokaryotes", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/0-387-30745-1" }, + { "Type": "ISBN", "Value": "978-0-387-30745-9" }, + { "Type": "Proprietary", "Value": "SN:10.1007/0-387-30745-1" } + ], + "Platform": "Test Platform", + "Publisher": "Springer New York", + "YOP": "2006", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "The Prokaryotes", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/0-387-30746-X" }, + { "Type": "ISBN", "Value": "978-0-387-30746-6" }, + { "Type": "Proprietary", "Value": "SN:10.1007/0-387-30746-X" } + ], + "Platform": "Test Platform", + "Publisher": "Springer New York", + "YOP": "2006", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Updates in Diagnostic Pathology", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/0-387-32025-3" }, + { "Type": "ISBN", "Value": "978-0-387-32025-0" }, + { "Type": "Print_ISSN", "Value": "0065-2598" }, + { "Type": "Proprietary", "Value": "SN:10.1007/0-387-32025-3" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2005", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 2 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 } + ] + } + ] + }, + { + "Title": "Radiation Risk Estimates in Normal and Emergency Situations", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/1-4020-4956-0" }, + { "Type": "ISBN", "Value": "978-1-4020-4956-9" }, + { "Type": "Proprietary", "Value": "SN:10.1007/1-4020-4956-0" } + ], + "Platform": "Test Platform", + "Publisher": "Test Publisher", + "YOP": "2006", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Dynamic Population Models", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/1-4020-5230-8" }, + { "Type": "ISBN", "Value": "978-1-4020-5230-9" }, + { "Type": "Print_ISSN", "Value": "1877-2560" }, + { "Type": "Online_ISSN", "Value": "2215-1990" }, + { "Type": "Proprietary", "Value": "SN:10.1007/1-4020-5230-8" } + ], + "Platform": "Test Platform", + "Publisher": "Test Publisher", + "YOP": "2006", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ] + }, + { + "Title": "Strategische Unternehmungsplanung — Strategische Unternehmungsführung", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/3-540-30763-X" }, + { "Type": "ISBN", "Value": "978-3-540-30763-1" }, + { "Type": "Proprietary", "Value": "SN:10.1007/3-540-30763-X" } + ], + "Platform": "Test Platform", + "Publisher": "Springer Berlin Heidelberg", + "YOP": "2006", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ] + }, + { + "Title": "Mass Vaccination: Global Aspects — Progress and Obstacles", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/3-540-36583-4" }, + { "Type": "ISBN", "Value": "978-3-540-36583-9" }, + { "Type": "Print_ISSN", "Value": "0070-217X" }, + { "Type": "Proprietary", "Value": "SN:10.1007/3-540-36583-4" } + ], + "Platform": "Test Platform", + "Publisher": "Springer Berlin Heidelberg", + "YOP": "2006", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Reviews of Environmental Contamination and Toxicology", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-0-387-09647-6" }, + { "Type": "ISBN", "Value": "978-0-387-09647-6" }, + { "Type": "Print_ISSN", "Value": "0179-5953" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-0-387-09647-6" } + ], + "Platform": "Test Platform", + "Publisher": "Springer New York", + "YOP": "2008", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 4 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 4 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 4 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 4 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 4 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 4 } + ] + } + ] + }, + { + "Title": "The Concise Encyclopedia of Statistics", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-0-387-32833-1" }, + { "Type": "ISBN", "Value": "978-0-387-32833-1" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-0-387-32833-1" } + ], + "Platform": "Test Platform", + "Publisher": "Springer New York", + "YOP": "2008", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ] + }, + { + "Title": "International Encyclopedia of Civil Society", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-0-387-93996-4" }, + { "Type": "ISBN", "Value": "978-0-387-93996-4" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-0-387-93996-4" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2010", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Statistical Population Genomics", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-1-0716-0199-0" }, + { "Type": "ISBN", "Value": "978-1-0716-0199-0" }, + { "Type": "Print_ISSN", "Value": "1064-3745" }, + { "Type": "Online_ISSN", "Value": "1940-6029" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-1-0716-0199-0" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2020", + "Access_Type": "OA_Gold", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Animal Influenza Virus", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-1-0716-0346-8" }, + { "Type": "ISBN", "Value": "978-1-0716-0346-8" }, + { "Type": "Print_ISSN", "Value": "1064-3745" }, + { "Type": "Online_ISSN", "Value": "1940-6029" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-1-0716-0346-8" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2020", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + }, + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 } + ] + } + ] + }, + { + "Title": "Stem Cells and Tissue Repair", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-1-0716-0655-1" }, + { "Type": "ISBN", "Value": "978-1-0716-0655-1" }, + { "Type": "Print_ISSN", "Value": "1064-3745" }, + { "Type": "Online_ISSN", "Value": "1940-6029" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-1-0716-0655-1" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2020", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Deep Sequencing Data Analysis", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-1-0716-1103-6" }, + { "Type": "ISBN", "Value": "978-1-0716-1103-6" }, + { "Type": "Print_ISSN", "Value": "1064-3745" }, + { "Type": "Online_ISSN", "Value": "1940-6029" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-1-0716-1103-6" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2021", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-07-01", "End_Date": "2023-07-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Mass Spectrometry of Glycoproteins", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-1-0716-1241-5" }, + { "Type": "ISBN", "Value": "978-1-0716-1241-5" }, + { "Type": "Print_ISSN", "Value": "1064-3745" }, + { "Type": "Online_ISSN", "Value": "1940-6029" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-1-0716-1241-5" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2021", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + }, + { + "Title": "Metastasis", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-1-0716-1350-4" }, + { "Type": "ISBN", "Value": "978-1-0716-1350-4" }, + { "Type": "Print_ISSN", "Value": "1064-3745" }, + { "Type": "Online_ISSN", "Value": "1940-6029" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-1-0716-1350-4" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2021", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 2 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 2 } + ] + } + ] + }, + { + "Title": "Cytotoxic T-Cells", + "Item_ID": [ + { "Type": "DOI", "Value": "10.1007/978-1-0716-1507-2" }, + { "Type": "ISBN", "Value": "978-1-0716-1507-2" }, + { "Type": "Print_ISSN", "Value": "1064-3745" }, + { "Type": "Online_ISSN", "Value": "1940-6029" }, + { "Type": "Proprietary", "Value": "SN:10.1007/978-1-0716-1507-2" } + ], + "Platform": "Test Platform", + "Publisher": "Springer US", + "YOP": "2021", + "Access_Type": "Controlled", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Title_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Unique_Title_Requests", "Count": 1 } + ] + } + ] + } + ] +} diff --git a/t/db_dependent/data/erm/eusage/TR_J1.json b/t/db_dependent/data/erm/eusage/TR_J1.json new file mode 100644 index 0000000000..b47834d2e6 --- /dev/null +++ b/t/db_dependent/data/erm/eusage/TR_J1.json @@ -0,0 +1,287 @@ +{ + "Report_Header": { + "Institution_Name": "Test Institution", + "Customer_ID": "EALTEST001", + "Institution_ID": [ + { + "Type": "Proprietary", + "Value": "TInsti:EALTEST001" + }, + { + "Type": "ISNI", + "Value": "0000000123456789" + } + ], + "Report_Filters": [ + { + "Name": "End_Date", + "Value": "2022-09-30" + }, + { + "Name": "Access_Method", + "Value": "Regular" + }, + { + "Name": "Metric_Type", + "Value": "Total_Item_Requests|Unique_Item_Requests" + }, + { + "Name": "Data_Type", + "Value": "Journal" + }, + { + "Name": "Begin_Date", + "Value": "2021-09-01" + }, + { + "Name": "Access_Type", + "Value": "Controlled" + } + ], + "Created": "2023-08-29T07:11:41Z", + "Created_By": "Test Systems Inc.", + "Release": "5", + "Report_ID": "TR_J1", + "Report_Name": "Journal Requests (Excluding OA_Gold)" + }, + "Report_Items": [ + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2021-10-01", + "End_Date": "2021-10-31" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2021-11-01", + "End_Date": "2021-11-30" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-01-01", + "End_Date": "2022-01-31" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-02-01", + "End_Date": "2022-02-28" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 3 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 2 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-04-01", + "End_Date": "2022-04-30" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-05-01", + "End_Date": "2022-05-31" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 3 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-06-01", + "End_Date": "2022-06-30" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-08-01", + "End_Date": "2022-08-31" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 2 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-09-01", + "End_Date": "2022-09-30" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1002/(ISSN)2472-5390" + }, + { + "Type": "Proprietary", + "Value": "TInsti:ABC1" + }, + { + "Type": "Online_ISSN", + "Value": "1111-2222" + }, + { + "Type": "Print_ISSN", + "Value": "3333-4444" + } + ], + "Title": "Education and Training", + "Publisher_ID": [ + { + "Type": "ISNI", + "Value": "0000000123456789" + } + ], + "Publisher": "Test Publisher" + }, + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2022-01-01", + "End_Date": "2022-01-31" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + }, + { + "Period": { + "Begin_Date": "2022-06-01", + "End_Date": "2022-06-30" + }, + "Instance": [ + { + "Metric_Type": "Total_Item_Requests", + "Count": 1 + }, + { + "Metric_Type": "Unique_Item_Requests", + "Count": 1 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1002/(ISSN)1111-2222" + }, + { + "Type": "Proprietary", + "Value": "TInsti:ABC1" + }, + { + "Type": "Online_ISSN", + "Value": "5555-6666" + }, + { + "Type": "Print_ISSN", + "Value": "7777-8888" + } + ], + "Title": "Test Journal", + "Publisher_ID": [ + { + "Type": "ISNI", + "Value": "0000000123456789" + } + ], + "Publisher": "Test Publisher" + } + ] +} diff --git a/t/db_dependent/data/erm/eusage/TR_J2.json b/t/db_dependent/data/erm/eusage/TR_J2.json new file mode 100644 index 0000000000..3450e721c3 --- /dev/null +++ b/t/db_dependent/data/erm/eusage/TR_J2.json @@ -0,0 +1,362 @@ +{ + "Report_Header": { + "Institution_Name": "Test Institution", + "Customer_ID": "99999999", + "Institution_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:99999999" + } + ], + "Report_Filters": [ + { + "Name": "Data_Type", + "Value": "Journal" + }, + { + "Name": "End_Date", + "Value": "2023-09-30" + }, + { + "Name": "Access_Method", + "Value": "Regular" + }, + { + "Name": "Metric_Type", + "Value": "Limit_Exceeded|No_License" + }, + { + "Name": "Begin_Date", + "Value": "2023-08-01" + } + ], + "Created": "2023-10-23T07:27:10Z", + "Created_By": "Test Systems Inc.", + "Release": "5", + "Report_Name": "Journal Access Denied", + "Report_ID": "TR_J2" + }, + "Report_Items": [ + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2023-08-01", + "End_Date": "2023-08-31" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 3 + } + ] + }, + { + "Period": { + "Begin_Date": "2023-09-01", + "End_Date": "2023-09-30" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 2 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1021/aamick" + }, + { + "Type": "Proprietary", + "Value": "aaaa:aamick" + }, + { + "Type": "Online_ISSN", + "Value": "1944-8252" + }, + { + "Type": "Print_ISSN", + "Value": "1944-8244" + } + ], + "Title": "ACS Applied Materials & Interfaces", + "Publisher_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:aaa" + } + ], + "Publisher": "Test Publisher" + }, + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2023-08-01", + "End_Date": "2023-08-31" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 5 + } + ] + }, + { + "Period": { + "Begin_Date": "2023-09-01", + "End_Date": "2023-09-30" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 3 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1021/acbcct" + }, + { + "Type": "Proprietary", + "Value": "aaaa:acbcct" + }, + { + "Type": "Online_ISSN", + "Value": "1554-8937" + }, + { + "Type": "Print_ISSN", + "Value": "1554-8929" + } + ], + "Title": "ACS Chemical Biology", + "Publisher_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:aaa" + } + ], + "Publisher": "Test Publisher" + }, + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2023-08-01", + "End_Date": "2023-08-31" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 2 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1021/aaaac5" + }, + { + "Type": "Proprietary", + "Value": "aaaa:aaaac5" + }, + { + "Type": "Online_ISSN", + "Value": "1878-0504" + } + ], + "Title": "ACS Chemical Health & Safety", + "Publisher_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:aaa" + } + ], + "Publisher": "Test Publisher" + }, + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2023-09-01", + "End_Date": "2023-09-30" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 1 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1021/afsthl" + }, + { + "Type": "Proprietary", + "Value": "aaaa:afsthl" + }, + { + "Type": "Online_ISSN", + "Value": "2692-1944" + } + ], + "Title": "ACS Food Science & Technology", + "Publisher_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:aaa" + } + ], + "Publisher": "Test Publisher" + }, + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2023-09-01", + "End_Date": "2023-09-30" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 6 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1021/amlccd" + }, + { + "Type": "Proprietary", + "Value": "aaaa:amlccd" + }, + { + "Type": "Online_ISSN", + "Value": "2161-1653" + } + ], + "Title": "ACS Macro Letters", + "Publisher_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:aaa" + } + ], + "Publisher": "Test Publisher" + }, + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2023-08-01", + "End_Date": "2023-08-31" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 16 + } + ] + }, + { + "Period": { + "Begin_Date": "2023-09-01", + "End_Date": "2023-09-30" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 6 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1021/ancac3" + }, + { + "Type": "Proprietary", + "Value": "aaaa:ancac3" + }, + { + "Type": "Online_ISSN", + "Value": "1936-086X" + }, + { + "Type": "Print_ISSN", + "Value": "1936-0851" + } + ], + "Title": "ACS Nano", + "Publisher_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:aaa" + } + ], + "Publisher": "Test Publisher" + }, + { + "Platform": "Unit Test Library", + "Performance": [ + { + "Period": { + "Begin_Date": "2023-08-01", + "End_Date": "2023-08-31" + }, + "Instance": [ + { + "Metric_Type": "No_License", + "Count": 2 + } + ] + } + ], + "Item_ID": [ + { + "Type": "DOI", + "Value": "10.1021/ascefj" + }, + { + "Type": "Proprietary", + "Value": "aaaa:ascefj" + }, + { + "Type": "Online_ISSN", + "Value": "2379-3694" + } + ], + "Title": "ACS Sensors", + "Publisher_ID": [ + { + "Type": "Proprietary", + "Value": "aaaa:aaa" + } + ], + "Publisher": "Test Publisher" + } + ] +} diff --git a/t/db_dependent/data/erm/eusage/TR_J3.json b/t/db_dependent/data/erm/eusage/TR_J3.json new file mode 100644 index 0000000000..6816605068 --- /dev/null +++ b/t/db_dependent/data/erm/eusage/TR_J3.json @@ -0,0 +1,354 @@ +{ + "Report_Header": { + "Institution_Name": "Test Institution", + "Customer_ID": "99999999", + "Institution_ID": [{ "Type": "Proprietary", "Value": "aaaa:99999999" }], + "Report_Filters": [ + { + "Name": "Metric_Type", + "Value": "Total_Item_Investigations|Total_Item_Requests|Unique_Item_Investigations|Unique_Item_Requests" + }, + { "Name": "Access_Method", "Value": "Regular" }, + { "Name": "End_Date", "Value": "2023-09-30" }, + { "Name": "Data_Type", "Value": "Journal" }, + { "Name": "Begin_Date", "Value": "2023-08-01" } + ], + "Created": "2023-10-23T07:59:08Z", + "Created_By": "Test Systems Inc.", + "Release": "5", + "Report_Name": "Journal Usage by Access Type", + "Report_ID": "TR_J3" + }, + "Report_Items": [ + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 4 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 3 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 3 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 4 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aaemcq" }, + { "Type": "Proprietary", "Value": "aaaa:aaemcq" }, + { "Type": "Online_ISSN", "Value": "2574-0962" } + ], + "Access_Type": "OA_Gold", + "Title": "TEST Applied Energy Materials", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 3 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 3 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aamick" }, + { "Type": "Proprietary", "Value": "aaaa:aamick" }, + { "Type": "Online_ISSN", "Value": "1944-8252" }, + { "Type": "Print_ISSN", "Value": "1944-8244" } + ], + "Access_Type": "Controlled", + "Title": "TEST Applied Materials & Interfaces", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/accacs" }, + { "Type": "Proprietary", "Value": "aaaa:accacs" }, + { "Type": "Online_ISSN", "Value": "2155-5435" } + ], + "Access_Type": "OA_Gold", + "Title": "TEST Catalysis", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/acscii" }, + { "Type": "Proprietary", "Value": "aaaa:acscii" }, + { "Type": "Online_ISSN", "Value": "2374-7951" }, + { "Type": "Print_ISSN", "Value": "2374-7943" } + ], + "Access_Type": "OA_Gold", + "Title": "TEST Central Science", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 4 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 4 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 3 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 3 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/acbcct" }, + { "Type": "Proprietary", "Value": "aaaa:acbcct" }, + { "Type": "Online_ISSN", "Value": "1554-8937" }, + { "Type": "Print_ISSN", "Value": "1554-8929" } + ], + "Access_Type": "Controlled", + "Title": "TEST Chemical Biology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aaaac5" }, + { "Type": "Proprietary", "Value": "aaaa:aaaac5" }, + { "Type": "Online_ISSN", "Value": "1878-0504" } + ], + "Access_Type": "Controlled", + "Title": "TEST Chemical Health & Safety", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 3 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 2 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 3 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aewcaa" }, + { "Type": "Proprietary", "Value": "aaaa:aewcaa" }, + { "Type": "Online_ISSN", "Value": "2690-0637" } + ], + "Access_Type": "OA_Gold", + "Title": "TEST ES&T Water", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 3 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 3 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 3 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 3 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aeacc4" }, + { "Type": "Proprietary", "Value": "aaaa:aeacc4" }, + { "Type": "Online_ISSN", "Value": "2694-2518" } + ], + "Access_Type": "OA_Gold", + "Title": "TEST Environmental Au", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/afsthl" }, + { "Type": "Proprietary", "Value": "aaaa:afsthl" }, + { "Type": "Online_ISSN", "Value": "2692-1944" } + ], + "Access_Type": "Controlled", + "Title": "TEST Food Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 5 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 3 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 3 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 5 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aidcbc" }, + { "Type": "Proprietary", "Value": "aaaa:aidcbc" }, + { "Type": "Online_ISSN", "Value": "2373-8227" } + ], + "Access_Type": "Controlled", + "Title": "TEST Infectious Diseases", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 2 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 1 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 2 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Total_Item_Requests", "Count": 6 }, + { "Metric_Type": "Unique_Item_Requests", "Count": 5 }, + { "Metric_Type": "Unique_Item_Investigations", "Count": 5 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 6 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aidcbc" }, + { "Type": "Proprietary", "Value": "aaaa:aidcbc" }, + { "Type": "Online_ISSN", "Value": "2373-8227" } + ], + "Access_Type": "OA_Gold", + "Title": "TEST Infectious Diseases", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 3 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 3 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/amlccd" }, + { "Type": "Proprietary", "Value": "aaaa:amlccd" }, + { "Type": "Online_ISSN", "Value": "2161-1653" } + ], + "Access_Type": "Controlled", + "Title": "TEST Macro Letters", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 11 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 15 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Investigations", "Count": 3 }, + { "Metric_Type": "Total_Item_Investigations", "Count": 5 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/ancac3" }, + { "Type": "Proprietary", "Value": "aaaa:ancac3" }, + { "Type": "Online_ISSN", "Value": "1936-086X" }, + { "Type": "Print_ISSN", "Value": "1936-0851" } + ], + "Access_Type": "Controlled", + "Title": "TEST Nano", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:acs" }], + "Publisher": "Test Publisher" + } + ] +} diff --git a/t/db_dependent/data/erm/eusage/TR_J4.json b/t/db_dependent/data/erm/eusage/TR_J4.json new file mode 100644 index 0000000000..8cd9eb09be --- /dev/null +++ b/t/db_dependent/data/erm/eusage/TR_J4.json @@ -0,0 +1,599 @@ +{ + "Report_Header": { + "Institution_Name": "Test Institution", + "Customer_ID": "99999999", + "Institution_ID": [{ "Type": "Proprietary", "Value": "aaaa:99999999" }], + "Report_Filters": [ + { + "Name": "Metric_Type", + "Value": "Total_Item_Requests|Unique_Item_Requests" + }, + { "Name": "Access_Method", "Value": "Regular" }, + { "Name": "Begin_Date", "Value": "2023-08-01" }, + { "Name": "Access_Type", "Value": "Controlled" }, + { "Name": "End_Date", "Value": "2023-09-30" }, + { "Name": "Data_Type", "Value": "Journal" } + ], + "Created": "2023-10-23T08:41:45Z", + "Created_By": "Test Systems Inc.", + "Release": "5", + "Report_ID": "TR_J4", + "Report_Name": "Journal Requests by YOP (Excluding OA_Gold)" + }, + "Report_Items": [ + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 3 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aidcbc" }, + { "Type": "Proprietary", "Value": "aaaa:aidcbc" }, + { "Type": "Online_ISSN", "Value": "2373-8227" } + ], + "YOP": "2021", + "Title": "TEST Infectious Diseases", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aidcbc" }, + { "Type": "Proprietary", "Value": "aaaa:aidcbc" }, + { "Type": "Online_ISSN", "Value": "2373-8227" } + ], + "YOP": "2022", + "Title": "TEST Infectious Diseases", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/aidcbc" }, + { "Type": "Proprietary", "Value": "aaaa:aidcbc" }, + { "Type": "Online_ISSN", "Value": "2373-8227" } + ], + "YOP": "2023", + "Title": "TEST Infectious Diseases", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/ancham" }, + { "Type": "Proprietary", "Value": "aaaa:ancham" }, + { "Type": "Online_ISSN", "Value": "1520-6882" }, + { "Type": "Print_ISSN", "Value": "0003-2700" } + ], + "YOP": "2016", + "Title": "Analytical Chemistry", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/cgeabj" }, + { "Type": "Proprietary", "Value": "aaaa:cgeabj" }, + { "Type": "Online_ISSN", "Value": "2474-7408" } + ], + "YOP": "2016", + "Title": "C&EN Global Enterprise", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "1977", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 2 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2002", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 2 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2004", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 3 }, + { "Metric_Type": "Total_Item_Requests", "Count": 4 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2006", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2007", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 2 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2008", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 3 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2009", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 6 }, + { "Metric_Type": "Total_Item_Requests", "Count": 9 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2010", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 5 }, + { "Metric_Type": "Total_Item_Requests", "Count": 7 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2011", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2012", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2013", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2015", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2018", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 2 }, + { "Metric_Type": "Total_Item_Requests", "Count": 8 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2019", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 1 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 3 }, + { "Metric_Type": "Total_Item_Requests", "Count": 3 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2020", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 2 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2021", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 3 }, + { "Metric_Type": "Total_Item_Requests", "Count": 4 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2022", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 5 }, + { "Metric_Type": "Total_Item_Requests", "Count": 8 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "2023", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-08-01", "End_Date": "2023-08-31" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 7 }, + { "Metric_Type": "Total_Item_Requests", "Count": 8 } + ] + }, + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 5 }, + { "Metric_Type": "Total_Item_Requests", "Count": 8 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/esthag" }, + { "Type": "Proprietary", "Value": "aaaa:esthag" }, + { "Type": "Online_ISSN", "Value": "1520-5851" }, + { "Type": "Print_ISSN", "Value": "0013-936X" } + ], + "YOP": "9999", + "Title": "Environmental Science & Technology", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + }, + { + "Platform": "TEST", + "Performance": [ + { + "Period": { "Begin_Date": "2023-09-01", "End_Date": "2023-09-30" }, + "Instance": [ + { "Metric_Type": "Unique_Item_Requests", "Count": 1 }, + { "Metric_Type": "Total_Item_Requests", "Count": 2 } + ] + } + ], + "Item_ID": [ + { "Type": "DOI", "Value": "10.1021/jTESTat" }, + { "Type": "Proprietary", "Value": "aaaa:jTESTat" }, + { "Type": "Online_ISSN", "Value": "1520-5126" }, + { "Type": "Print_ISSN", "Value": "0002-7863" } + ], + "YOP": "2020", + "Title": "Journal of the Test Publisher", + "Publisher_ID": [{ "Type": "Proprietary", "Value": "aaaa:TEST" }], + "Publisher": "Test Publisher" + } + ] +} -- 2.39.5