#
# isis_sf($isis_row,'isis_field'[,'subfield'])
#
# e.g. isis_sf($row,'700','a')
#
sub isis_sf {
	my $row = shift @_;
	my $isis_id = shift @_;
	my $subfield = shift @_;

	if ($row->{$isis_id}->[0]) {
		my $sf = OpenIsis::subfields($row->{$isis_id}->[0]);
		if (! defined $subfield || length($subfield) == 0) {
			# subfield list undef, empty or no defined subfields for this record
			my $all_sf = $row->{$isis_id}->[0];
			$all_sf =~ s/\^./ /g;	nuke definirions
			return $all_sf;
		} elsif ($sf->{$subfield}) {
			return $sf->{$subfield};
		}
	}
}

1;

