diff --git a/src/main/resources/alma/fix/describedBy.fix b/src/main/resources/alma/fix/describedBy.fix index fbfb78885..3e77b6161 100644 --- a/src/main/resources/alma/fix/describedBy.fix +++ b/src/main/resources/alma/fix/describedBy.fix @@ -34,14 +34,12 @@ prepend("describedBy.resultOf.object.id","https://lobid.org/marcxml/") # 008/00-05 has the initial cataloguing date. We use MNG info as fallback. # MNG is a ALMA-specific element (MNG .b only states the indexing date into ALMA.) -copy_field("008","@initialCataloguingDate") -if any_match("@initialCataloguingDate", "^\\d{8}.*") # Due to cataloguing errors there seem to be year not represented by two but by four digits. The first step is a workaround. - substring("@initialCataloguingDate","2","6") -elsif any_match("@initialCataloguingDate", "^\\d{6}.*") # 008/00-05 is the correct form for the cataloguing date in MARC. +if any_match("008", "^\\d{6}\\D.*") # 008/00-05 is the correct form for the cataloguing date in MARC. + copy_field("008","@initialCataloguingDate") substring("@initialCataloguingDate","0","6") end -if any_match("@initialCataloguingDate","^[0-4].*") +if any_match("@initialCataloguingDate","^[0-4]\\d*") prepend("@initialCataloguingDate","20") elsif any_match("@initialCataloguingDate","\\d*") prepend("@initialCataloguingDate","19") diff --git a/src/test/resources/alma-fix/99374515437806441.json b/src/test/resources/alma-fix/99374515437806441.json index cf6b072b4..c7fe304c8 100644 --- a/src/test/resources/alma-fix/99374515437806441.json +++ b/src/test/resources/alma-fix/99374515437806441.json @@ -36,7 +36,7 @@ }, "object" : { "id" : "https://lobid.org/marcxml/99374515437806441", - "dateCreated" : "2024-08-16", + "dateCreated" : "2024-08-19", "dateModified" : "2024-10-30", "type" : [ "DataFeedItem" ], "label" : "hbz-Ressource 99374515437806441 im Exportformat MARC21 XML",