JBAS-980 repair ind2=z remapping logic (lcgft)
authorBill Erickson <berickxx@gmail.com>
Wed, 30 Dec 2015 23:16:08 +0000 (15:16 -0800)
committerBill Erickson <berickxx@gmail.com>
Thu, 21 Mar 2019 19:46:23 +0000 (15:46 -0400)
Signed-off-by: Bill Erickson <berickxx@gmail.com>
KCLS/linking/authority_control_fields.pl

index bce6a37..9743dd2 100755 (executable)
@@ -562,17 +562,16 @@ my %AUTH_TO_BIB_IND2 = (
     'n' => '4', # Source not specified
     'k' => '5', # Canadian Subject Headings
     'v' => '6', # Répertoire de vedettes-matière 
-    'n' => '7', # Source specified in subfield $2
-    'z' => '8'  # Other
+    'z' => '7'  # Source specified in subfield $2 / Other
 );
 
-# Maps 6XX subfield $2 values to their equivalent authority leader/11 value.
-# These occur when the indicator 2 == 7 ("Source specified in subfield $2")
-my %BIB_SF2_TO_AUTH = (
-    lcsh => 'a',
-    mesh => 'c',
-    nal  => 'd',
-    rvm  => 'v'
+# Produces a new 6XX ind2 value for values found in subfield $2 when the
+# original ind2 value is 7 ("Source specified in subfield $2").
+my %REMAP_BIB_SF2_TO_IND2 = (
+    lcsh  => '0',
+    mesh  => '2',
+    nal   => '3',
+    rvm   => '6'
 );
 
 my $start_time = localtime();
@@ -601,14 +600,9 @@ sub find_matching_auth_for_thesaurus {
         my $thesaurus = $bib_field->subfield('2') || '';
         announce("Found local thesaurus value $thesaurus");
 
-        $cfield_ind2 = $BIB_SF2_TO_AUTH{$thesaurus};
-
-        if (defined $cfield_ind2) {
-            announce("Mapped local thesaurus '$thesaurus' to '$cfield_ind2'");
-        } else {
-            announce("No mapping found for local thesaurus '$thesaurus'");
-            return undef;
-        }
+        # if no remapping is found, use 7 == Other.
+        $cfield_ind2 = $REMAP_BIB_SF2_TO_IND2{$thesaurus} || '7';
+        announce("Local thesaurus '$thesaurus' mapped to ind2 value '$cfield_ind2'");
     }
 
     my $auth_leaders = $e->json_query({