package uk.ac.ebi.phenotype.data.cda;

import uk.ac.ebi.phenotype.enumeration.BatchClassification;

import java.util.HashSet;
import java.util.Set;
import com.google.common.collect.Sets;

/**
 * Created by jmason on 30/03/2015.
 */
public class DataBatchesBySex {
	private Set<String> maleBatches = new HashSet<>();
	private Set<String> femaleBatches = new HashSet<>();

	public void addMaleBatch(String batch) { maleBatches.add(batch); }
	public void addFemaleBatch(String batch) { femaleBatches.add(batch); }

	public Integer getMaleBatchCount() { return maleBatches.size(); }
	public Integer getFemaleBatchCount() { return maleBatches.size(); }

	public BatchClassification getBatchClassification() {


		if (maleBatches.size()==0 && femaleBatches.size()>0 ||)
		if (maleBatches.size()==1 && femaleBatches.size()==1 &&
			Sets.intersection(maleBatches, femaleBatches).size()==1) {
			return BatchClassification.one_batch;
		}

	}
}

@@ -638,24 +638,439 @@
 .size(); %7D%0A%0A
+%09/*%0A%09    if male_batches == 0 or female_batches == 0:%0A%09        batch = %22One sex only%22%0A%09    elif both_batches == 1:%0A%09        batch = %22One batch%22%0A%09    elif both_batches %3C= 3:%0A%09        batch = %22Low batch%22%0A%09    elif male_batches %3E= 3 and female_batches %3E= 2:%0A%09        batch = %22Multi batch%22%0A%09    elif female_batches %3E= 3 and male_batches %3E= 2:%0A%09        batch = %22Multi batch%22%0A%09    else:%0A%09        batch = %22Low batch%22%0A%09 */%0A
 %09public Batc

add pseudocode for batch classification