##################################
#Function to be used by select_sdf to select real drugs from the WDI database by
# checking the presence of some fields

sub is_sdf_record_kept
{
        my $sdf_entry = shift ;    #retrieve first argument: pointer to the current sdf entry
        my $record_number = shift ; #retrieve second argument: record number
        
        #Check the validity of the first argument
        defined $sdf_entry || die "Assertion failed" ;
        
		printf STDERR "%d\t", $record_number ;
       
	   return
	   #indications&usage
	   	defined($sdf_entry->data_for_field_name("IU"))      ||
		
		#trade name
		defined($sdf_entry->data_for_field_name("TRADE"))   ||
		
		#Approved name
		defined($sdf_entry->data_for_field_name("APP"))     ||
		
		#US approved name
		defined($sdf_entry->data_for_field_name("USAN"))    ||
		
		#International name
		defined($sdf_entry->data_for_field_name("INN")) ;

}
1;
##################################
