diff --git a/claims/claim-utils/service/searchOrcid.service.ts b/claims/claim-utils/service/searchOrcid.service.ts index 3bf17c00..761b9b59 100644 --- a/claims/claim-utils/service/searchOrcid.service.ts +++ b/claims/claim-utils/service/searchOrcid.service.ts @@ -25,7 +25,7 @@ export class SearchOrcidService { .pipe(map(res => res['person'])) .pipe(map(res => [res['name']['given-names'], res['name']['family-name'], - res['name']])) + res['name'], res['name']['institution-name']])) .pipe(map(res => SearchOrcidService.parseOrcidAuthor(res, authorIds, authors, addId))); } @@ -42,7 +42,7 @@ export class SearchOrcidService { .pipe(map(res => res['person'])) .pipe(map(res => [res['name']['given-names'], res['name']['family-name'], - res['name']])) + res['name'], res['name']['institution-name']])) .pipe(map(res => { let authors = [] @@ -86,6 +86,7 @@ export class SearchOrcidService { author['id'] = auth_result['orcid-id']; author['authorGivenName'] = auth_result['given-names']; author['authorFamilyName'] = auth_result['family-names']; + author['institutions'] = auth_result['institution-name']; authors.push(author); } } @@ -104,6 +105,7 @@ export class SearchOrcidService { static parseOrcidAuthor(data: any, authorIds: string[], authors, addId): any { + console.log(data) if (data[2] != null) { if (addId) { authorIds.push(data[2].path); @@ -120,7 +122,12 @@ export class SearchOrcidService { } else { author['authorFamilyName'] = ""; } + if (data[3] != null) { + author['institution'] = data[3]; + } + console.log(author['institution']) authors.push(author); + return true; } return false;