Fix nonexistent variables in ItemReceivedResponse
authorJeff Godin <jgodin@tadl.org>
Tue, 30 Jul 2013 17:46:31 +0000 (13:46 -0400)
committerJeff Godin <jgodin@tadl.org>
Tue, 30 Jul 2013 17:46:31 +0000 (13:46 -0400)
When creating an NCIP ItemReceivedResponse message, nonexistent
variables were being referenced, resulting in warnings and empty
values for the following elements in ResponseHeader:

FromAgencyId/UniqueAgencyId/Scheme
ToAgencyId/UniqueAgencyId/Scheme
ToAgencyId/UniqueAgencyId/Value

This commit populates the variables $faidScheme, $taidScheme, and
$taidValie in a manner similar to other locations in the code,
silencing the warnings and causing the elements in question to
contain data.

Signed-off-by: Jeff Godin <jgodin@tadl.org>
iNCIPit.cgi

index 2f402c6..035a11f 100644 (file)
@@ -267,7 +267,12 @@ ACCEPTITEM
 }
 
 sub item_received {
+    my $faidSchemeX = $doc->findvalue('/NCIPMessage/ItemReceived/InitiationHeader/FromAgencyId/UniqueAgencyId/Scheme');
+    my $faidScheme = HTML::Entities::encode($faidSchemeX);
     my $faidValue = $doc->find('/NCIPMessage/ItemReceived/InitiationHeader/FromAgencyId/UniqueAgencyId/Value');
+    my $taidSchemeX = $doc->findvalue('/NCIPMessage/ItemReceived/InitiationHeader/ToAgencyId/UniqueAgencyId/Scheme');
+    my $taidScheme = HTML::Entities::encode($taidSchemeX);
+    my $taidValue  = $doc->find('/NCIPMessage/ItemReceived/InitiationHeader/ToAgencyId/UniqueAgencyId/Value');
     my $visid = $doc->findvalue('/NCIPMessage/ItemReceived/ItemOptionalFields/ItemDescription/VisibleItemId/VisibleItemIdentifier') . $faidValue;
     my $copy = copy_from_barcode($visid);
     fail( $copy->{textcode} . " $visid" ) unless ( blessed $copy);