Skip to content

Commit

Permalink
Merge pull request #2097 from hbz/disambiguateSuppressedLocations
Browse files Browse the repository at this point in the history
Include current library when looking up Alma suppressed location.
  • Loading branch information
blackwinter authored Nov 21, 2024
2 parents 7605172 + 115107b commit f90adce
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
10 changes: 4 additions & 6 deletions src/main/resources/alma/fix/item.fix
Original file line number Diff line number Diff line change
@@ -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")
Expand All @@ -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")
Expand Down
13 changes: 13 additions & 0 deletions src/main/resources/alma/fix/macros.fix
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down

0 comments on commit f90adce

Please sign in to comment.