From 0a47193bf3f63d0660dbe1e88048bce0de0d5a63 Mon Sep 17 00:00:00 2001 From: "konstantina.galouni" Date: Wed, 24 Jan 2024 17:03:15 +0200 Subject: [PATCH] [develop | DONE | FIXED]: searchResearchResults.service.ts & resultLanding.service.ts & deletedByInference.service.ts: #9425 - When an author (same name & rank) has 2 instances on the same record, keep orcid information if exists in at least one instance. --- .../deletedByInference/deletedByInference.service.ts | 9 +++++++++ landingPages/result/resultLanding.service.ts | 9 +++++++++ services/searchResearchResults.service.ts | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/landingPages/result/deletedByInference/deletedByInference.service.ts b/landingPages/result/deletedByInference/deletedByInference.service.ts index 41d6e312..5b812e8f 100644 --- a/landingPages/result/deletedByInference/deletedByInference.service.ts +++ b/landingPages/result/deletedByInference/deletedByInference.service.ts @@ -145,6 +145,15 @@ export class DeletedByInferenceService { if(author.orcid_pending) { author.orcid_pending = author.orcid_pending.toUpperCase(); } + + if(result['authors'][author.rank] && results['authors'][author.rank].fullName == author.content) { + if(!author.orcid && result['authors'][author.rank].orcid) { + author.orcid = result['authors'][author.rank].orcid; + } else if(!author.orcid_pending && result['authors'][author.rank].orcid_pending) { + author.orcid_pending = result['authors'][author.rank].orcid_pending; + } + } + result['authors'][author.rank] = {"fullName": author.content, "orcid": author.orcid, "orcid_pending": author.orcid_pending}; } } diff --git a/landingPages/result/resultLanding.service.ts b/landingPages/result/resultLanding.service.ts index df6e8745..d0f7060c 100644 --- a/landingPages/result/resultLanding.service.ts +++ b/landingPages/result/resultLanding.service.ts @@ -381,6 +381,15 @@ export class ResultLandingService { if (author.orcid_pending) { author.orcid_pending = author.orcid_pending.toUpperCase(); } + + if(this.resultLandingInfo['authors'][author.rank] && this.resultLandingInfo['authors'][author.rank].fullName == author.content) { + if(!author.orcid && this.resultLandingInfo['authors'][author.rank].orcid) { + author.orcid = this.resultLandingInfo['authors'][author.rank].orcid; + } else if(!author.orcid_pending && this.resultLandingInfo['authors'][author.rank].orcid_pending) { + author.orcid_pending = this.resultLandingInfo['authors'][author.rank].orcid_pending; + } + } + this.resultLandingInfo['authors'][author.rank] = { "fullName": author.content, "orcid": author.orcid, diff --git a/services/searchResearchResults.service.ts b/services/searchResearchResults.service.ts index 4c76bf90..62329217 100644 --- a/services/searchResearchResults.service.ts +++ b/services/searchResearchResults.service.ts @@ -348,6 +348,15 @@ export class SearchResearchResultsService { if (author.orcid_pending) { author.orcid_pending = author.orcid_pending.toUpperCase(); } + + if(result['authors'][author.rank] && result['authors'][author.rank].fullName == author.content) { + if(!author.orcid && result['authors'][author.rank].orcid) { + author.orcid = result['authors'][author.rank].orcid; + } else if(!author.orcid_pending && result['authors'][author.rank].orcid_pending) { + author.orcid_pending = result['authors'][author.rank].orcid_pending; + } + } + result['authors'][author.rank] = { "fullName": author.content, "orcid": author.orcid,