From 7907d8cc2dc2d9c63baa14dc75fc46584136e3ea Mon Sep 17 00:00:00 2001 From: Jason Stephenson Date: Wed, 10 Dec 2014 21:39:36 -0500 Subject: [PATCH] Add ItemId to RequestItem output in NCIP::ILS::Evergreen. Signed-off-by: Jason Stephenson --- lib/NCIP/ILS/Evergreen.pm | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 0d89fe8..37ea5b0 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -1020,6 +1020,19 @@ sub requestitem { RequestType => $request->{$message}->{RequestType}, RequestScopeType => ($hold->hold_type() eq 'V') ? "item" : "bibliographic item" }; + # Fill in the ItemId based on what we have. + if ($item_barcode && ref($item_barcode) ne 'NCIP::Problem') { + $data->{ItemId} = NCIP::Item::Id->new({ + ItemIdentifierValue => $item_barcode, + ItemIdentifierType => 'Barcode' + }); + } else { + $data->{ItemId} = NCIP::Item::Id->new({ + ItemIdentifierValue => $item->id(), + ItemIdentifierType => 'SYSNUMBER' + }) + } + # Look for UserElements requested and add it to the response: my $elements = $request->{$message}->{UserElementType}; if ($elements) { -- 2.43.2