diff --git a/src/main/resources/alma/fix/item.fix b/src/main/resources/alma/fix/item.fix index 6ba64ce60..8f39a3fb3 100644 --- a/src/main/resources/alma/fix/item.fix +++ b/src/main/resources/alma/fix/item.fix @@ -1,9 +1,8 @@ set_array("hasItem[]") set_array("@ITM-H") # Helper element for creating Holding from HOL ("PhysikalischerTitel") do list(path:"ITM ", "var": "$i") - paste("$i.supressedLocation", "$i.M", "~+", "$i.x",join_char:"") - lookup("$i.supressedLocation","suppressedLocations",delete:"true") - unless exists("$i.supressedLocation") # Test if location is suppressed with mapping provided by the libraries. + call_macro("suppressedLocation", targetField: "$i", libraryCodeSubfield: "w", locationCodeSubfield: "x") + unless exists("$i.suppressedLocation") # Test if location is suppressed with mapping provided by the libraries. set_hash( "hasItem[].$append") add_field("hasItem[].$last.label", "lobid Bestandsressource") set_array("hasItem[].$last.type[]", "Item","PhysicalObject") @@ -29,9 +28,8 @@ do list(path: "HOL ", "var": "$i") do list(path:"H52??", "var": "$H52") if in("$i.8", "$H52.8") if exists("$H52.b") - paste("$H52.supressedLocation", "$i.M", "~+", "$H52.c",join_char:"") - lookup("$H52.supressedLocation","suppressedLocations",delete:"true") - unless exists("$H52.supressedLocation") # Test if location is suppressed with mapping provided by the libraries. + call_macro("suppressedLocation", targetField: "$H52", libraryCodeSubfield: "b", locationCodeSubfield: "c") + unless exists("$H52.suppressedLocation") # Test if location is suppressed with mapping provided by the libraries. set_hash( "hasItem[].$append") add_field("hasItem[].$last.label", "lobid Bestandsressource") set_array("hasItem[].$last.type[]", "Item","PhysikalischerTitel") diff --git a/src/main/resources/alma/fix/macros.fix b/src/main/resources/alma/fix/macros.fix index 8756b8100..d2422922a 100644 --- a/src/main/resources/alma/fix/macros.fix +++ b/src/main/resources/alma/fix/macros.fix @@ -294,6 +294,19 @@ do put_macro("provenanceLinks") end +# suppressed location + +do put_macro("suppressedLocation") + # MemberCode+LibraryCode+LocationCode + paste("$[targetField].suppressedLocation", "$i.M", "$[targetField].$[libraryCodeSubfield]", "$[targetField].$[locationCodeSubfield]", join_char: "+") + lookup("$[targetField].suppressedLocation", "suppressedLocations", delete: "true") + unless exists("$[targetField].suppressedLocation") + # MemberCode+LocationCode + paste("$[targetField].suppressedLocation", "$i.M", "$[targetField].$[locationCodeSubfield]", join_char: "+") + lookup("$[targetField].suppressedLocation", "suppressedLocations", delete: "true") + end +end + # holding institution differentiating between library and sublibrary (libraryCode) and adding opacLink do put_macro("holdingLibrary+opacLink")