Skip to content

Commit

Permalink
add new field for orcid work source to pub_hash
Browse files Browse the repository at this point in the history
  • Loading branch information
peetucket committed Jul 26, 2023
1 parent 4663cab commit 72b6800
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/orcid/work_mapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
3 changes: 3 additions & 0 deletions pub_hash_schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 9 additions & 0 deletions spec/lib/orcid/work_mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,11 @@
value: 'Elephants Don\'t Play Chess'
}
},
source: {
'source-name': {
value: 'Crossref'
}
},
'external-ids': {
'external-id': [
{
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 72b6800

Please sign in to comment.