From 9dff30bc213c930361c02693abaf137d44265994 Mon Sep 17 00:00:00 2001 From: TobiasNx Date: Thu, 14 Nov 2024 15:09:44 +0100 Subject: [PATCH] Do not overwrite existing hbzId with mapped ones #2095 --- src/main/resources/alma/fix/identifiers.fix | 14 ++++++++------ .../resources/alma-fix/990217879290206441.json | 4 ++-- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/src/main/resources/alma/fix/identifiers.fix b/src/main/resources/alma/fix/identifiers.fix index 42917e5ed..e818a0198 100644 --- a/src/main/resources/alma/fix/identifiers.fix +++ b/src/main/resources/alma/fix/identifiers.fix @@ -158,11 +158,13 @@ do list(path:"028??", "var":"$i") copy_field("$i.a", "stockNumber[].$append") end -if exists("@inNZ") - copy_field("zdbId","@hbzId") - lookup("@hbzId","zdbId2oldHbzId",delete:"true") - if exists("@hbzId") - paste("deprecatedUri", "~http://lobid.org/resources/", "@hbzId", "~#!", join_char: "") +unless exists("hbzId") + if exists("@inNZ") + copy_field("zdbId","@hbzId") + lookup("@hbzId","zdbId2oldHbzId",delete:"true") + if exists("@hbzId") + paste("deprecatedUri", "~http://lobid.org/resources/", "@hbzId", "~#!", join_char: "") + end + copy_field("@hbzId","hbzId") end - copy_field("@hbzId","hbzId") end diff --git a/src/test/resources/alma-fix/990217879290206441.json b/src/test/resources/alma-fix/990217879290206441.json index 7800b0c68..29892017c 100644 --- a/src/test/resources/alma-fix/990217879290206441.json +++ b/src/test/resources/alma-fix/990217879290206441.json @@ -8,8 +8,8 @@ } ], "title" : "The history of Oriental studies", "almaMmsId" : "990217879290206441", - "hbzId" : "HT018628300", - "deprecatedUri" : "http://lobid.org/resources/HT018628300#!", + "hbzId" : "HT019286510", + "deprecatedUri" : "http://lobid.org/resources/HT019286510#!", "issn" : [ "24054488" ], "oclcNumber" : [ "909716357" ], "zdbId" : "2819760-4",