File tree Expand file tree Collapse file tree
orcid-core/src/main/java/org/orcid/core/cli/anonymize Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -107,7 +107,11 @@ public ExternalID anonymizeWorkExternalIdentifier(JSONObject original) throws Ma
107107 ExternalID wExtId = new ExternalID ();
108108 if (extIdKey != null ) {
109109 if (extIdsAnonymized .get (extIdKey ) != null ) {
110- return extIdsAnonymized .get (extIdKey );
110+ wExtId = extIdsAnonymized .get (extIdKey );
111+ if (original .has (KEY_RELATIONSHIP )) {
112+ wExtId .setRelationship (Relationship .valueOf (original .getString (KEY_RELATIONSHIP )));
113+ }
114+ return wExtId ;
111115 }
112116 }
113117 if (workIdentifierType != null ) {
@@ -154,7 +158,11 @@ public ExternalID anonymizeWorkExternalIdentifier(ExternalID original) throws Ma
154158 ExternalID wExtId = new ExternalID ();
155159 if (extIdKey != null ) {
156160 if (extIdsAnonymized .get (extIdKey ) != null ) {
157- return extIdsAnonymized .get (extIdKey );
161+ wExtId = extIdsAnonymized .get (extIdKey );
162+ if (original .getRelationship () != null ) {
163+ wExtId .setRelationship (original .getRelationship ());
164+ }
165+ return wExtId ;
158166 }
159167 }
160168
You can’t perform that action at this time.
0 commit comments