From: Jason Stephenson Date: Thu, 18 Dec 2014 19:58:16 +0000 (-0500) Subject: Modify NCIP::ILS::Evergreen->requestitem. X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=d7ebe5d28c81ffcad93c17070cf1db58f793916a;p=NCIPServer.git Modify NCIP::ILS::Evergreen->requestitem. We now return AgencyId in the ItemId response field when returning a database id and not barcode. If we can't figure out the AgencyId to return, we set the ItemId/ItemIdentifierType to SYSNUMBER. There's room for improvement here, but no time right now. Signed-off-by: Jason Stephenson --- diff --git a/lib/NCIP/ILS/Evergreen.pm b/lib/NCIP/ILS/Evergreen.pm index 70fe5fb..de56fbb 100644 --- a/lib/NCIP/ILS/Evergreen.pm +++ b/lib/NCIP/ILS/Evergreen.pm @@ -1053,8 +1053,14 @@ sub requestitem { } else { $data->{ItemId} = NCIP::Item::Id->new({ ItemIdentifierValue => $item->id(), - ItemIdentifierType => 'SYSNUMBER' - }) + }); + # if we have an $ou, we return the AgencyId, else set + # ItemIdentifierType. + if ($ou) { + $data->{ItemId}->AgencyId($ou->shortname()); + } else { + $data->{ItemId}->ItemIdentifierType('SYSNUMBER'); + } } # Look for UserElements requested and add it to the response: