From 72b6800148a8c7d07aae1b047e3f1d1f72723958 Mon Sep 17 00:00:00 2001 From: Peter Mangiafico Date: Fri, 18 Mar 2022 11:28:21 -0700 Subject: [PATCH] add new field for orcid work source to pub_hash --- lib/orcid/work_mapper.rb | 3 ++- pub_hash_schema.yml | 3 +++ spec/lib/orcid/work_mapper_spec.rb | 9 +++++++++ 3 files changed, 14 insertions(+), 1 deletion(-) diff --git a/lib/orcid/work_mapper.rb b/lib/orcid/work_mapper.rb index ff1de8c00..a701bc63b 100644 --- a/lib/orcid/work_mapper.rb +++ b/lib/orcid/work_mapper.rb @@ -38,7 +38,8 @@ def map conference: map_conference, series: map_series, pages: work.pages, - publisher: work.publisher + publisher: work.publisher, + orcid_work_source: work.work_source }.compact end # rubocop:enable Metrics/AbcSize diff --git a/pub_hash_schema.yml b/pub_hash_schema.yml index 394451fd3..9711a3796 100644 --- a/pub_hash_schema.yml +++ b/pub_hash_schema.yml @@ -70,6 +70,9 @@ properties: $ref: '#/$defs/MeshHeading' mla_citation: # Automatically added type: string + orcid_work_source: + description: For ORCID harvested records, the original source of the record provided to ORCID + type: string pages: type: string pmid: diff --git a/spec/lib/orcid/work_mapper_spec.rb b/spec/lib/orcid/work_mapper_spec.rb index f8b49f640..a8c48b3e8 100644 --- a/spec/lib/orcid/work_mapper_spec.rb +++ b/spec/lib/orcid/work_mapper_spec.rb @@ -14,6 +14,11 @@ value: 'Elephants Don\'t Play Chess' } }, + source: { + 'source-name': { + value: 'Crossref' + } + }, 'external-ids': { 'external-id': [ { @@ -85,6 +90,10 @@ expect(pub_hash[:type]).to eq('article') end + it 'maps work source' do + expect(pub_hash[:orcid_work_source]).to eq('Crossref') + end + it 'maps provenance' do expect(pub_hash[:provenance]).to eq('orcid') end