return undef;
}
+# Returns true if the thesaurus controlling the bib field is "fast".
+sub is_fast_heading {
+ my $bib_field = shift;
+
+ if ($bib_field->tag() =~ /^65[015]/) {
+ my $ind2 = $bib_field->indicator(2) || '';
+
+ if ($ind2 eq '7') { # field controlled by "other"
+ my $thesaurus = $bib_field->subfield('2') || '';
+ return $thesaurus eq 'fast';
+ }
+ }
+
+ return 0;
+}
+
foreach my $rec_id (@records) {
announce("processing bib record $rec_id");
# Get the MARCXML from the record and check for controlled fields/subfields
my @bib_fields = ($marc->field($c_tag));
foreach my $bib_field (@bib_fields) {
- # print $_->as_formatted();
- if ($refresh and defined(scalar($bib_field->subfield('0')))) {
+ my $sf0 = $bib_field->subfield('0') || '';
+
+ if (is_fast_heading($bib_field)) {
+ # Ignore all 'fast' headings.
+ announce("Skipping FAST on rec=$rec_id and tag=$c_tag \$0 $sf0");
+ next;
+ }
+
+ if ($sf0 && $refresh) {
+ announce("Removing \$0 $sf0 for rec=$rec_id and tag=$c_tag");
$bib_field->delete_subfield(code => '0');
$changed = 1;
}
-
+
my %match_subfields;
my $match_tag;
my @searches;