Skip to content

Commit

Permalink
Fixed the relationship for the same external identifiers with differe…
Browse files Browse the repository at this point in the history
…nt relationships for works
  • Loading branch information
Camelia-Orcid committed Feb 23, 2023
1 parent 0f1106b commit 1b9097a
Showing 1 changed file with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,11 @@ public ExternalID anonymizeWorkExternalIdentifier(JSONObject original) throws Ma
ExternalID wExtId = new ExternalID();
if (extIdKey != null) {
if (extIdsAnonymized.get(extIdKey) != null) {
return extIdsAnonymized.get(extIdKey);
wExtId = extIdsAnonymized.get(extIdKey);
if (original.has(KEY_RELATIONSHIP)) {
wExtId.setRelationship(Relationship.valueOf(original.getString(KEY_RELATIONSHIP)));
}
return wExtId;
}
}
if (workIdentifierType != null) {
Expand Down Expand Up @@ -154,7 +158,11 @@ public ExternalID anonymizeWorkExternalIdentifier(ExternalID original) throws Ma
ExternalID wExtId = new ExternalID();
if (extIdKey != null) {
if (extIdsAnonymized.get(extIdKey) != null) {
return extIdsAnonymized.get(extIdKey);
wExtId = extIdsAnonymized.get(extIdKey);
if (original.getRelationship() != null) {
wExtId.setRelationship(original.getRelationship());
}
return wExtId;
}
}

Expand Down

0 comments on commit 1b9097a

Please sign in to comment.