Skip to content

Commit

Permalink
Merge pull request #6738 from ORCID/8378-anonymizeqa-script-to-anonym…
Browse files Browse the repository at this point in the history
…ize-data-identifier-relationship-types-should-persist-as-per-origi

Fixed the relationship for the same external identifiers with different relationships for various works
  • Loading branch information
amontenegro authored Feb 23, 2023
2 parents f1bc33f + 1b9097a commit 70964ce
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 70964ce

Please sign in to comment.