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 <jason@sigio.com>
} 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: