electronic => $request->{$message}->{ItemOptionalFields}->{BibliographicDescription}->{ElectronicResource}
};
+ # Add a "dummy" call_number if call_number is not set to something usable.
+ if (!$item_info->{call_number} || (ref($item_info->{call_number}) eq 'HASH' && !%{$item_info->{call_number}})) {
+ # We'll concatenate the FromAgenyId and the RequestId, and
+ # if that doesn't work, use the barcode.
+ my $from_agy = $request->{$message}->{InitiationHeader}->{FromAgencyId}->{AgencyId};
+ my $request_id = $request->{$message}->{RequestId}->{RequestIdentifierValue};
+ # Being a little overcautious here.
+ if ($from_agy && !ref($from_agy)) {
+ $from_agy =~ s/^.*://;
+ } else {
+ undef($from_agy);
+ }
+ # And here.
+ if ($from_agy && $request_id && !ref($request_id)) {
+ $item_info->{call_number} = $from_agy . " " . $request_id;
+ } else {
+ $item_info->{call_number} = $item_info->{barcode};
+ }
+ }
+
if ($self->{config}->{items}->{use_precats}) {
# We only need to create a precat copy.
$item = $self->create_precat_copy($item_info);
} else {
- # We have to create a "partial" bib record, a call number and a copy.
+ # We have to create a "partial" bib record, a call number, and a copy.
$item = $self->create_fuller_copy($item_info);
}