SiLeBAT/FSK-Lab

View on GitHub
de.bund.bfr.knime.fsklab.metadata.model/src/metadata/SwaggerOtherModelSheetImporter.java

Summary

Maintainability
F
2 wks
Test Coverage
package metadata;

import java.math.BigDecimal;
import java.util.Arrays;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import org.apache.poi.ss.usermodel.Cell;
import org.apache.poi.ss.usermodel.Row;
import org.apache.poi.ss.usermodel.Sheet;
import org.threeten.bp.LocalDate;

import de.bund.bfr.metadata.swagger.Assay;
import de.bund.bfr.metadata.swagger.Contact;
import de.bund.bfr.metadata.swagger.DietaryAssessmentMethod;
import de.bund.bfr.metadata.swagger.Hazard;
import de.bund.bfr.metadata.swagger.Laboratory;
import de.bund.bfr.metadata.swagger.ModelCategory;
import de.bund.bfr.metadata.swagger.OtherModelDataBackground;
import de.bund.bfr.metadata.swagger.OtherModelGeneralInformation;
import de.bund.bfr.metadata.swagger.OtherModelModelMath;
import de.bund.bfr.metadata.swagger.OtherModelScope;
import de.bund.bfr.metadata.swagger.Parameter;
import de.bund.bfr.metadata.swagger.PopulationGroup;
import de.bund.bfr.metadata.swagger.Product;
import de.bund.bfr.metadata.swagger.QualityMeasures;
import de.bund.bfr.metadata.swagger.Reference;
import de.bund.bfr.metadata.swagger.Study;
import de.bund.bfr.metadata.swagger.StudySample;

@Deprecated
public class SwaggerOtherModelSheetImporter {
     protected int A = 0;
     protected int B = 1;
     protected int C = 2;
     protected int D = 3;
     protected int E = 4;
     protected int F = 5;
     protected int G = 6;
     protected int H = 7;
     protected int I = 8;
     protected int J = 9;
     protected int K = 10;
     protected int L = 11;
     protected int M = 12;
     protected int N = 13;
     protected int O = 14;
     protected int P = 15;
     protected int Q = 16;
     protected int R = 17;
     protected int S = 18;
     protected int T = 19;
     protected int U = 20;
     protected int V = 21;
     protected int W = 22;
     protected int X = 23;
     protected int Y = 24;
     protected int Z = 25;
     protected int AA = 26;
     protected int AB = 27;
     protected int AC = 28;
     protected int AD = 29;
     protected int AE = 30;
     protected int AF = 31;
     protected int AG = 32;
     protected int AH = 33;
     protected int AI = 34;
     protected int AJ = 35;
     protected int AK = 36;
     protected int AL = 37;
     protected int AM = 38;
     protected int AN = 39;
     protected int AO = 40;
     protected int AP = 41;
     protected int AQ = 42;
     protected int AR = 43;
     protected int AS = 44;
     protected int AT = 45;
     protected int AU = 46;
     protected int AV = 47;
     protected int AW = 48;
     
     protected int GENERAL_INFORMATION__NAME = 1;
     protected int GENERAL_INFORMATION__SOURCE = 2;
     protected int GENERAL_INFORMATION__IDENTIFIER = 3;
     protected int GENERAL_INFORMATION_CREATION_DATE = 6;
     protected int GENERAL_INFORMATION__RIGHTS = 8;
     protected int GENERAL_INFORMATION__AVAILABLE = 9;
     protected int GENERAL_INFORMATION__URL = 10;
     protected int GENERAL_INFORMATION__FORMAT = 11;
     protected int GENERAL_INFORMATION__LANGUAGE = 24;
     protected int GENERAL_INFORMATION__SOFTWARE = 25;
     protected int GENERAL_INFORMATION__LANGUAGE_WRITTEN_IN = 26;
     protected int GENERAL_INFORMATION__STATUS = 32;
     protected int GENERAL_INFORMATION__OBJECTIVE = 33;
     protected int GENERAL_INFORMATION__DESCRIPTION = 34;

     protected int MODEL_CATEGORY__MODEL_CLASS = 27;
     protected int MODEL_CATEGORY__MODEL_SUB_CLASS = 28;
     protected int MODEL_CATEGORY__CLASS_COMMENT = 29;
     protected int MODEL_CATEGORY__BASIC_PROCESS = 30;

     protected int QUALITY_MEASURES__SSE = 117;
    protected int QUALITY_MEASURES__MSE = 118;
    protected int QUALITY_MEASURES__RMSE = 119;
    protected int QUALITY_MEASURES__RSQUARE = 120;
    protected int QUALITY_MEASURES__AIC = 121;
    protected int QUALITY_MEASURES__BIC = 122;
    protected int SCOPE__GENERAL_COMMENT = 73;
     protected int SCOPE__TEMPORAL_INFORMATION = 74;

     protected int STUDY__STUDY_IDENTIFIER = 77;
     protected int STUDY__STUDY_TITLE = 78;
     protected int STUDY__STUDY_DESCRIPTION = 79;
     protected int STUDY__STUDY_DESIGN_TYPE = 80;
     protected int STUDY__STUDY_ASSAY_MEASUREMENT_TYPE = 81;
     protected int STUDY__STUDY_ASSAY_TECHNOLOGY_TYPE = 82;
     protected int STUDY__STUDY_ASSAY_TECHNOLOGY_PLATFORM = 83;
     protected int STUDY__ACCREDITATION_PROCEDURE_FOR_THE_ASSAY_TECHNOLOGY = 84;
     protected int STUDY__STUDY_PROTOCOL_NAME = 85;
     protected int STUDY__STUDY_PROTOCOL_TYPE = 86;
     protected int STUDY__STUDY_PROTOCOL_DESCRIPTION = 87;
     protected int STUDY__STUDY_PROTOCOL_URI = 88;
     protected int STUDY__STUDY_PROTOCOL_VERSION = 89;
     protected int STUDY__STUDY_PROTOCOL_PARAMETERS_NAME = 90;
     protected int STUDY__STUDY_PROTOCOL_COMPONENTS_NAME = 91;
     protected int STUDY__STUDY_PROTOCOL_COMPONENTS_TYPE = 92;
    
    protected int GI_CREATOR_ROW = 3;
    protected int GI_REFERENCE_ROW = 14;
    protected int SCOPE_PRODHAZPOP_ROW = 38;
    protected int BG_STUDY_SAMPLE_ROW = 96;
    protected int BG_DIET_ASSESS_ROW = 102;
    protected int BG_EVENT_ROW = 108;
    protected int BG_LABORATORY_ROW = 103;
    protected int BG_ASSAY_ROW = 109;
    protected int BG_QUALITY_MEAS_ROW = 117;
    protected int BG_Model_EQ_ROW = 117;
    
    protected int MM_PARAMETER_ROW = 127;
    protected int MM_FITTING_PROCEDURE_ROW = 132;
    
    
    public OtherModelGeneralInformation retrieveGeneralInformation(Sheet sheet) {

        OtherModelGeneralInformation information = new OtherModelGeneralInformation();

        Cell nameCell = sheet.getRow(GENERAL_INFORMATION__NAME).getCell(J);
        if (nameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setName(nameCell.getStringCellValue());
        }

        Cell sourceCell = sheet.getRow(GENERAL_INFORMATION__SOURCE).getCell(J);
        if (sourceCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setSource(sourceCell.getStringCellValue());
        }

        Cell identifierCell = sheet.getRow(GENERAL_INFORMATION__IDENTIFIER).getCell(J);
        if (identifierCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setIdentifier(identifierCell.getStringCellValue());
        }

        try {
            Contact author = retrieveAuthor(sheet.getRow(GI_CREATOR_ROW));
            information.addAuthorItem(author);
        } catch (Exception exception) {
        }

        for (int numRow = GI_CREATOR_ROW; numRow < (GI_CREATOR_ROW + 4); numRow++) {
            try {
                Contact contact = retrieveCreator(sheet.getRow(numRow));
                information.addCreatorItem(contact);
            } catch (Exception exception) {
            }
        }

        Cell creationDateCell = sheet.getRow(GENERAL_INFORMATION_CREATION_DATE).getCell(J);
        if (creationDateCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            Date creationDate = creationDateCell.getDateCellValue();
            LocalDate localDate = LocalDate.of(creationDate.getYear() + 1900, creationDate.getMonth() + 1,
                    creationDate.getDate());
            information.setCreationDate(localDate);
        }

        // TODO: modificationDate

        Cell rightsCell = sheet.getRow(GENERAL_INFORMATION__RIGHTS).getCell(J);
        if (rightsCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setRights(rightsCell.getStringCellValue());
        }

        Cell isAvailableCell = sheet.getRow(GENERAL_INFORMATION__AVAILABLE).getCell(J);
        if (isAvailableCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setAvailability(isAvailableCell.getStringCellValue());
        }

        Cell urlCell = sheet.getRow(GENERAL_INFORMATION__URL).getCell(J);
        if (urlCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setUrl(urlCell.getStringCellValue());
        }

        Cell formatCell = sheet.getRow(GENERAL_INFORMATION__FORMAT).getCell(J);
        if (formatCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setFormat(formatCell.getStringCellValue());
        }

        // reference (1..n)
        for (int numRow = this.GI_REFERENCE_ROW; numRow < (GI_REFERENCE_ROW + 3); numRow++) {
            try {
                Reference reference = retrieveReference(sheet.getRow(numRow));
                information.addReferenceItem(reference);
            } catch (Exception exception) {
            }
        }

        Cell languageCell = sheet.getRow(GENERAL_INFORMATION__LANGUAGE).getCell(J);
        if (languageCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setLanguage(languageCell.getStringCellValue());
        }

        Cell softwareCell = sheet.getRow(GENERAL_INFORMATION__SOFTWARE).getCell(J);
        if (softwareCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setSoftware(softwareCell.getStringCellValue());
        }

        Cell languageWrittenInCell = sheet.getRow(GENERAL_INFORMATION__LANGUAGE_WRITTEN_IN).getCell(J);
        if (languageWrittenInCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setLanguageWrittenIn(languageWrittenInCell.getStringCellValue());
        }

        // model category (0..n)
        try {
            ModelCategory category = retrieveModelCategory(sheet);
            information.setModelCategory(category);
        } catch (Exception exception) {
        }

        Cell statusCell = sheet.getRow(GENERAL_INFORMATION__STATUS).getCell(J);
        if (statusCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setStatus(statusCell.getStringCellValue());
        }

        Cell objectiveCell = sheet.getRow(GENERAL_INFORMATION__OBJECTIVE).getCell(J);
        if (objectiveCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setObjective(objectiveCell.getStringCellValue());
        }

        Cell descriptionCell = sheet.getRow(GENERAL_INFORMATION__DESCRIPTION).getCell(J);
        if (descriptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            information.setDescription(descriptionCell.getStringCellValue());
        }

        return information;
    }
    public OtherModelModelMath retrieveModelMath(Sheet sheet) {
        
        OtherModelModelMath math = new OtherModelModelMath();

        for (int rownum = this.MM_PARAMETER_ROW; rownum < sheet.getLastRowNum(); rownum++) {
            try {
                Row row = sheet.getRow(rownum);
                Parameter param = retrieveParameter(row);
                math.addParameterItem(param);
            } catch (Exception exception) {
                // ...
            }
        }
        
        try {
            QualityMeasures measures = retrieveQualityMeasures(sheet);
            math.addQualityMeasuresItem(measures);
        } catch (Exception exception) {
            // ...
        }
        
        Cell fittingProcedureCell = sheet.getRow(MM_FITTING_PROCEDURE_ROW).getCell(J);
        if (fittingProcedureCell.getCellType() == Cell.CELL_TYPE_STRING) {
            math.setFittingProcedure(fittingProcedureCell.getStringCellValue());
        }
        
        return math;
    }
    public OtherModelDataBackground retrieveBackground(Sheet sheet) {

        OtherModelDataBackground background = new OtherModelDataBackground();

        try {
            Study study = retrieveStudy(sheet);
            background.setStudy(study);
        } catch (Exception exception) {
        }

        for (int numrow = this.BG_STUDY_SAMPLE_ROW; numrow < (BG_STUDY_SAMPLE_ROW + 3); numrow++) {
            try {
                StudySample sample = retrieveStudySample(sheet.getRow(numrow));
                background.addStudySampleItem(sample);
            } catch (Exception exception) {
            }
        }


        for (int numrow = BG_LABORATORY_ROW; numrow < (BG_LABORATORY_ROW + 3); numrow++) {
            try {
                Laboratory laboratory = retrieveLaboratory(sheet.getRow(numrow));
                background.addLaboratoryItem(laboratory);
            } catch (Exception exception) {
            }
        }

        for (int numrow = BG_ASSAY_ROW; numrow < (BG_ASSAY_ROW + 3); numrow++) {
            try {
                Assay assay = retrieveAssay(sheet.getRow(numrow));
                background.addAssayItem(assay);
            } catch (Exception exception) {
                // ignore errors since Assay is optional
            }
        }

        return background;
    }
    public OtherModelScope retrieveScope(Sheet sheet) {

        OtherModelScope scope = new OtherModelScope();
        
        
        for (int numrow = SCOPE_PRODHAZPOP_ROW; numrow <= (SCOPE_PRODHAZPOP_ROW + 11); numrow++) {

            Row row = sheet.getRow(numrow);

            try {
                scope.addProductItem(retrieveProduct(row));
            } catch (IllegalArgumentException exception) {
                // ignore exception since products are optional (*)
            }

            try {
                scope.addHazardItem(retrieveHazard(row));
            } catch (IllegalArgumentException exception) {
                // ignore exception since products are optional (*)
            }

            try {
                scope.addPopulationGroupItem(retrievePopulationGroup(row));
            } catch (IllegalArgumentException exception) {
                // ignore exception since population groups are optional (*)
            }
        }

        Cell generalCommentCell = sheet.getRow(SCOPE__GENERAL_COMMENT).getCell(J);
        if (generalCommentCell.getCellType() == Cell.CELL_TYPE_STRING) {
            scope.setGeneralComment(generalCommentCell.getStringCellValue());
        }

        Cell temporalInformationCell = sheet.getRow(SCOPE__TEMPORAL_INFORMATION).getCell(J);
        if (temporalInformationCell.getCellType() == Cell.CELL_TYPE_STRING) {
            scope.setTemporalInformation(temporalInformationCell.getStringCellValue());
        }

        // TODO: Spatial information

        return scope;
    }
    public Product retrieveProduct(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing product name");
        }
        if (row.getCell(N).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing product unit");
        }

        Product product = new Product();
        product.setName(row.getCell(L).getStringCellValue());
        product.setUnit(row.getCell(N).getStringCellValue());

        Cell descriptionCell = row.getCell(M);
        if (descriptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            product.setDescription(descriptionCell.getStringCellValue());
        }

        Cell methodCell = row.getCell(O);
        if (methodCell.getCellType() == Cell.CELL_TYPE_STRING) {
            product.addMethodItem(methodCell.getStringCellValue());
        }

        Cell packagingCell = row.getCell(P);
        if (packagingCell.getCellType() == Cell.CELL_TYPE_STRING) {
            product.addPackagingItem(packagingCell.getStringCellValue());
        }

        Cell treatmentCell = row.getCell(P);
        if (treatmentCell.getCellType() == Cell.CELL_TYPE_STRING) {
            product.addTreatmentItem(treatmentCell.getStringCellValue());
        }

        Cell originCountryCell = row.getCell(R);
        if (originCountryCell.getCellType() == Cell.CELL_TYPE_STRING) {
            product.setOriginCountry(originCountryCell.getStringCellValue());
        }

        Cell originAreaCell = row.getCell(S);
        if (originAreaCell.getCellType() == Cell.CELL_TYPE_STRING) {
            product.setOriginArea(originAreaCell.getStringCellValue());
        }

        Cell fisheriesAreaCell = row.getCell(T);
        if (fisheriesAreaCell.getCellType() == Cell.CELL_TYPE_STRING) {
            product.setFisheriesArea(fisheriesAreaCell.getStringCellValue());
        }

        Cell productionDateCell = row.getCell(U);
        if (productionDateCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            Date date = productionDateCell.getDateCellValue();
            product.setProductionDate(LocalDate.of(date.getYear() + 1900, date.getMonth(), date.getDate()));
        }

        Cell expiryDateCell = row.getCell(V);
        if (expiryDateCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            Date date = expiryDateCell.getDateCellValue();
            product.setExpiryDate(LocalDate.of(date.getYear() + 1900, date.getMonth(), date.getDate()));
        }

        return product;
    }
    public Contact retrieveCreator(Row row) {
        @SuppressWarnings("serial")
        HashMap<String, Integer> columns = new HashMap<String, Integer>() {
            {
                put("mail", S);
                put("title", L);
                put("familyName", P);
                put("givenName", N);
                put("telephone", R);
                put("streetAddress", X);
                put("country", T);
                put("city", U);
                put("zipCode", V);
                put("region", Z);
                put("organization", Q);
            }
        };
        return retrieveContact(row, columns);
    }

    public Contact retrieveAuthor(Row row) {

        @SuppressWarnings("serial")
        HashMap<String, Integer> columns = new HashMap<String, Integer>() {
            {
                put("mail", AI);
                put("title", AB);
                put("familyName", AF);
                put("givenName", AD);
                put("telephone", AH);
                put("streetAddress", AN);
                put("country", AJ);
                put("city", AK);
                put("zipCode", AL);
                put("region", AP);
                put("organization", AG);
            }
        };
        return retrieveContact(row, columns);
    }

    private Contact retrieveContact(Row row, Map<String, Integer> columns) {

        // Check mandatory properties and throw exception if missing
        if (row.getCell(columns.get("mail")).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing mail");
        }

        Contact contact = new Contact();
        contact.setEmail(row.getCell(columns.get("mail")).getStringCellValue());

        Cell titleCell = row.getCell(columns.get("title"));
        if (titleCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setTitle(titleCell.getStringCellValue());
        }

        Cell familyNameCell = row.getCell(columns.get("familyName"));
        if (familyNameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setFamilyName(familyNameCell.getStringCellValue());
        }

        Cell givenNameCell = row.getCell(columns.get("givenName"));
        if (givenNameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setGivenName(givenNameCell.getStringCellValue());
        }

        Cell telephoneCell = row.getCell(columns.get("telephone"));
        if (telephoneCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setTelephone(telephoneCell.getStringCellValue());
        }

        Cell streetAddressCell = row.getCell(columns.get("streetAddress"));
        if (streetAddressCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setStreetAddress(streetAddressCell.getStringCellValue());
        }

        Cell countryCell = row.getCell(columns.get("country"));
        if (countryCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setCountry(countryCell.getStringCellValue());
        }

        Cell zipCodeCell = row.getCell(columns.get("zipCode"));
        if (zipCodeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setZipCode(zipCodeCell.getStringCellValue());
        }

        Cell regionCell = row.getCell(columns.get("region"));
        if (regionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setRegion(regionCell.getStringCellValue());
        }

        // Time zone not included in spreadsheet
        // gender not included in spreadsheet
        // note not included in spreadsheet

        Cell organizationCell = row.getCell(columns.get("organization"));
        if (organizationCell.getCellType() == Cell.CELL_TYPE_STRING) {
            contact.setOrganization(organizationCell.getStringCellValue());
        }

        return contact;
    }

    public Reference retrieveReference(Row row) {

        // Check mandatory properties and throw exception if missing
        if (row.getCell(L).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing Is reference description?");
        }
        if (row.getCell(P).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing DOI");
        }

        Reference reference = new Reference();
        reference.setIsReferenceDescription(row.getCell(L).getStringCellValue().equals("Yes"));
        reference.setDoi(row.getCell(P).getStringCellValue());

        // publication type
        Cell typeCell = row.getCell(M);
        if (typeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            PublicationType type = PublicationType.get(typeCell.getStringCellValue());
            if (type != null) {
                reference.setPublicationType(SwaggerUtil.PUBLICATION_TYPE.get(type));
            }
        }

        Cell dateCell = row.getCell(N);
        if (dateCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            reference.setDate(dateCell.getStringCellValue());
        }

        Cell pmidCell = row.getCell(O);
        if (pmidCell.getCellType() == Cell.CELL_TYPE_STRING) {
            reference.setPmid(pmidCell.getStringCellValue());
        }

        Cell authorListCell = row.getCell(Q);
        if (authorListCell.getCellType() == Cell.CELL_TYPE_STRING) {
            reference.setAuthorList(authorListCell.getStringCellValue());
        }

        Cell titleCell = row.getCell(R);
        if (titleCell.getCellType() == Cell.CELL_TYPE_STRING) {
            reference.setTitle(titleCell.getStringCellValue());
        }

        Cell abstractCell = row.getCell(S);
        if (abstractCell.getCellType() == Cell.CELL_TYPE_STRING) {
            reference.setAbstract(abstractCell.getStringCellValue());
        }
        // journal
        // volume
        // issue

        Cell statusCell = row.getCell(U);
        if (statusCell.getCellType() == Cell.CELL_TYPE_STRING) {
            reference.setStatus(statusCell.getStringCellValue());
        }

        Cell websiteCell = row.getCell(V);
        if (websiteCell.getCellType() == Cell.CELL_TYPE_STRING) {
            reference.setWebsite(websiteCell.getStringCellValue());
        }

        Cell commentCell = row.getCell(W);
        if (commentCell.getCellType() == Cell.CELL_TYPE_STRING) {
            reference.setComment(commentCell.getStringCellValue());
        }

        return reference;
    }

    public ModelCategory retrieveModelCategory(Sheet sheet) {
        // Check mandatory properties and throw exception if missing
        if (sheet.getRow(MODEL_CATEGORY__MODEL_CLASS).getCell(J).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing model class");
        }

        ModelCategory category = new ModelCategory();

        category.setModelClass(sheet.getRow(MODEL_CATEGORY__MODEL_CLASS).getCell(J).getStringCellValue());

        Cell subClassCell = sheet.getRow(MODEL_CATEGORY__MODEL_SUB_CLASS).getCell(J);
        if (subClassCell.getCellType() == Cell.CELL_TYPE_STRING) {
            category.addModelSubClassItem(subClassCell.getStringCellValue());
        }

        Cell modelClassCommentCell = sheet.getRow(MODEL_CATEGORY__CLASS_COMMENT).getCell(J);
        if (modelClassCommentCell.getCellType() == Cell.CELL_TYPE_STRING) {
            category.setModelClassComment(modelClassCommentCell.getStringCellValue());
        }

        Cell basicProcessCell = sheet.getRow(MODEL_CATEGORY__BASIC_PROCESS).getCell(J);
        if (basicProcessCell.getCellType() == Cell.CELL_TYPE_STRING) {
            category.addBasicProcessItem(basicProcessCell.getStringCellValue());
        }

        return category;
    }


    public Hazard retrieveHazard(Row row) {
        // Check mandatory properties
        if (row.getCell(X).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Hazard name is missing");
        }

        Hazard hazard = new Hazard();
        hazard.setName(row.getCell(X).getStringCellValue());

        Cell typeCell = row.getCell(W);
        if (typeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setType(typeCell.getStringCellValue());
        }

        Cell hazardDescriptionCell = row.getCell(Y);
        if (hazardDescriptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setDescription(hazardDescriptionCell.getStringCellValue());
        }

        Cell hazardUnitCell = row.getCell(Z);
        if (hazardUnitCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setUnit(hazardUnitCell.getStringCellValue());
        }

        Cell adverseEffect = row.getCell(AA);
        if (adverseEffect.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setAdverseEffect(adverseEffect.getStringCellValue());
        }

        Cell sourceOfContaminationCell = row.getCell(AB);
        if (sourceOfContaminationCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setSourceOfContamination(sourceOfContaminationCell.getStringCellValue());
        }

        Cell bmdCell = row.getCell(AC);
        if (bmdCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setBenchmarkDose(bmdCell.getStringCellValue());
        }

        Cell maximumResidueLimitCell = row.getCell(AD);
        if (maximumResidueLimitCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setMaximumResidueLimit(maximumResidueLimitCell.getStringCellValue());
        }

        Cell noaelCell = row.getCell(AE);
        if (noaelCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setNoObservedAdverseAffectLevel(noaelCell.getStringCellValue());
        }

        Cell loaelCell = row.getCell(AF);
        if (loaelCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setLowestObservedAdverseAffectLevel(loaelCell.getStringCellValue());
        }

        Cell aoelCell = row.getCell(AG);
        if (aoelCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setAcceptableOperatorsExposureLevel(aoelCell.getStringCellValue());
        }

        Cell arfdCell = row.getCell(AH);
        if (arfdCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setAcuteReferenceDose(arfdCell.getStringCellValue());
        }

        Cell adiCell = row.getCell(AI);
        if (adiCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setAcceptableDailyIntake(adiCell.getStringCellValue());
        }

        Cell indSumCell = row.getCell(AJ);
        if (indSumCell.getCellType() == Cell.CELL_TYPE_STRING) {
            hazard.setIndSum(indSumCell.getStringCellValue());
        }

        return hazard;
    }

    


    public Study retrieveStudy(Sheet sheet) {

        // Check first mandatory properties
        if (sheet.getRow(STUDY__STUDY_TITLE).getCell(J).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing study title");
        }

        Study study = new Study();

        Cell identifierCell = sheet.getRow(STUDY__STUDY_IDENTIFIER).getCell(J);
        if (identifierCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setIdentifier(identifierCell.getStringCellValue());
        }

        study.setTitle(sheet.getRow(STUDY__STUDY_TITLE).getCell(J).getStringCellValue());

        Cell descriptionCell = sheet.getRow(STUDY__STUDY_DESCRIPTION).getCell(J);
        if (descriptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setDescription(descriptionCell.getStringCellValue());
        }

        Cell designTypeCell = sheet.getRow(STUDY__STUDY_DESIGN_TYPE).getCell(J);
        if (designTypeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setDesignType(designTypeCell.getStringCellValue());
        }

        Cell measurementTypeCell = sheet.getRow(STUDY__STUDY_ASSAY_MEASUREMENT_TYPE).getCell(J);
        if (measurementTypeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setAssayMeasurementType(measurementTypeCell.getStringCellValue());
        }

        Cell technologyTypeCell = sheet.getRow(STUDY__STUDY_ASSAY_TECHNOLOGY_TYPE).getCell(J);
        if (technologyTypeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setAssayTechnologyType(technologyTypeCell.getStringCellValue());
        }

        Cell technologyPlatformCell = sheet.getRow(STUDY__STUDY_ASSAY_TECHNOLOGY_PLATFORM).getCell(J);
        if (technologyPlatformCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setAssayTechnologyPlatform(technologyPlatformCell.getStringCellValue());
        }

        Cell accreditationProcedureCell = sheet.getRow(STUDY__ACCREDITATION_PROCEDURE_FOR_THE_ASSAY_TECHNOLOGY)
                .getCell(J);
        if (accreditationProcedureCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setAccreditationProcedureForTheAssayTechnology(accreditationProcedureCell.getStringCellValue());
        }

        Cell protocolNameCell = sheet.getRow(STUDY__STUDY_PROTOCOL_NAME).getCell(J);
        if (protocolNameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolName(protocolNameCell.getStringCellValue());
        }

        Cell protocolTypeCell = sheet.getRow(STUDY__STUDY_PROTOCOL_TYPE).getCell(J);
        if (protocolTypeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolType(protocolTypeCell.getStringCellValue());
        }

        Cell protocolDescriptionCell = sheet.getRow(STUDY__STUDY_PROTOCOL_DESCRIPTION).getCell(J);
        if (protocolDescriptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolDescription(protocolDescriptionCell.getStringCellValue());
        }

        Cell protocolURICell = sheet.getRow(STUDY__STUDY_PROTOCOL_URI).getCell(J);
        if (protocolURICell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolURI(protocolURICell.getStringCellValue());
        }

        Cell protocolVersionCell = sheet.getRow(STUDY__STUDY_PROTOCOL_VERSION).getCell(J);
        if (protocolVersionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolVersion(protocolVersionCell.getStringCellValue());
        }

        Cell parameterNameCell = sheet.getRow(STUDY__STUDY_PROTOCOL_PARAMETERS_NAME).getCell(J);
        if (parameterNameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolParametersName(parameterNameCell.getStringCellValue());
        }

        Cell componentNameCell = sheet.getRow(STUDY__STUDY_PROTOCOL_COMPONENTS_NAME).getCell(J);
        if (componentNameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolComponentsName(componentNameCell.getStringCellValue());
        }

        Cell componentTypeCell = sheet.getRow(STUDY__STUDY_PROTOCOL_COMPONENTS_TYPE).getCell(J);
        if (componentTypeCell.getCellType() == Cell.CELL_TYPE_STRING) {
            study.setProtocolComponentsType(componentTypeCell.getStringCellValue());
        }

        return study;
    }


    public StudySample retrieveStudySample(Row row) {

        // Check mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing sample name");
        }
        if (row.getCell(M).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing protocol of sample collection");
        }
        if (row.getCell(Q).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing sampling method");
        }
        if (row.getCell(R).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing sampling weight");
        }
        if (row.getCell(S).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing sampling size");
        }

        StudySample sample = new StudySample();
        sample.setSampleName(row.getCell(L).getStringCellValue());
        sample.setProtocolOfSampleCollection(row.getCell(M).getStringCellValue());

        Cell strategyCell = row.getCell(N);
        if (strategyCell.getCellType() == Cell.CELL_TYPE_STRING) {
            sample.setSamplingStrategy(strategyCell.getStringCellValue());
        }

        Cell samplingProgramCell = row.getCell(O);
        if (samplingProgramCell.getCellType() == Cell.CELL_TYPE_STRING) {
            sample.setTypeOfSamplingProgram(samplingProgramCell.getStringCellValue());
        }

        Cell samplingMethodCell = row.getCell(P);
        if (samplingMethodCell.getCellType() == Cell.CELL_TYPE_STRING) {
            sample.setSamplingMethod(samplingMethodCell.getStringCellValue());
        }

        sample.setSamplingPlan(row.getCell(Q).getStringCellValue());
        sample.setSamplingWeight(row.getCell(R).getStringCellValue());
        sample.setSamplingSize(row.getCell(S).getStringCellValue());

        Cell unitCell = row.getCell(T);
        if (unitCell.getCellType() == Cell.CELL_TYPE_STRING) {
            sample.setLotSizeUnit(row.getCell(T).getStringCellValue());
        }

        Cell pointCell = row.getCell(U);
        if (pointCell.getCellType() == Cell.CELL_TYPE_STRING) {
            sample.setSamplingPoint(row.getCell(U).getStringCellValue());
        }

        return sample;
    }

    
    public Laboratory retrieveLaboratory(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing laboratory accreditation");
        }

        Laboratory laboratory = new Laboratory();
        Arrays.stream(row.getCell(L).getStringCellValue().split(",")).forEach(laboratory::addAccreditationItem);

        Cell nameCell = row.getCell(M);
        if (nameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            laboratory.setName(row.getCell(M).getStringCellValue());
        }

        Cell countryCell = row.getCell(N);
        if (countryCell.getCellType() == Cell.CELL_TYPE_STRING) {
            laboratory.setCountry(row.getCell(N).getStringCellValue());
        }

        return laboratory;
    }

    public Assay retrieveAssay(Row row) {
        // Check first mandatory properties
        if (row.getCell(L).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing assay name");
        }

        Assay assay = new Assay();
        assay.setName(row.getCell(L).getStringCellValue());

        Cell descriptionCell = row.getCell(M);
        if (descriptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setDescription(descriptionCell.getStringCellValue());
        }

        Cell moistureCell = row.getCell(N);
        if (moistureCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setMoisturePercentage(moistureCell.getStringCellValue());
        }

        Cell fatCell = row.getCell(O);
        if (fatCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setFatPercentage(fatCell.getStringCellValue());
        }

        Cell detectionCell = row.getCell(P);
        if (detectionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setDetectionLimit(detectionCell.getStringCellValue());
        }

        Cell quantificationCell = row.getCell(Q);
        if (quantificationCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setQuantificationLimit(quantificationCell.getStringCellValue());
        }

        Cell dataCell = row.getCell(R);
        if (dataCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setLeftCensoredData(dataCell.getStringCellValue());
        }

        Cell contaminationCell = row.getCell(S);
        if (contaminationCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setContaminationRange(contaminationCell.getStringCellValue());
        }

        Cell uncertaintyCell = row.getCell(T);
        if (uncertaintyCell.getCellType() == Cell.CELL_TYPE_STRING) {
            assay.setUncertaintyValue(uncertaintyCell.getStringCellValue());
        }

        return assay;
    }


    public Parameter retrieveParameter(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter id");
        }

        if (row.getCell(M).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter classification");
        }

        if (row.getCell(N).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter name");
        }

        if (row.getCell(P).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing parameter unit");
        }

        if (row.getCell(R).getCellType() == Cell.CELL_TYPE_BLANK) {
            throw new IllegalArgumentException("Missing data type");
        }

        Parameter param = new Parameter();
        param.setId(row.getCell(L).getStringCellValue());

        ParameterClassification pc = ParameterClassification.get(row.getCell(M).getStringCellValue());
        if (pc != null) {
            param.setClassification(SwaggerUtil.CLASSIF.get(pc));
        }

        param.setName(row.getCell(N).getStringCellValue());

        Cell descriptionCell = row.getCell(O);
        if (descriptionCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            param.setDescription(descriptionCell.getStringCellValue());
        }

        param.setUnit(row.getCell(P).getStringCellValue());

        Cell unitCategoryCell = row.getCell(Q);
        if (unitCategoryCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            param.setUnitCategory(unitCategoryCell.getStringCellValue());
        }

        ParameterType parameterType = ParameterType.get(row.getCell(R).getStringCellValue());
        if (parameterType != null) {
            param.setDataType(SwaggerUtil.TYPES.get(parameterType));
        }

        Cell sourceCell = row.getCell(S);
        if (sourceCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            param.setSource(sourceCell.getStringCellValue());
        }

        Cell subjectCell = row.getCell(T);
        if (subjectCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            param.setSubject(subjectCell.getStringCellValue());
        }

        Cell distributionCell = row.getCell(U);
        if (distributionCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            param.setDistribution(distributionCell.getStringCellValue());
        }

        Cell valueCell = row.getCell(V);
        if (valueCell.getCellType() != Cell.CELL_TYPE_BLANK) {

            if (valueCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
                Double doubleValue = valueCell.getNumericCellValue();
                if (parameterType == ParameterType.INTEGER) {
                    param.setValue(Integer.toString(doubleValue.intValue()));
                } else if (parameterType == ParameterType.DOUBLE || parameterType == ParameterType.NUMBER) {
                    param.setValue(Double.toString(doubleValue));
                }
            } else {
                param.setValue(valueCell.getStringCellValue());
            }
        }

        // TODO: reference

        Cell variabilitySubjectCell = row.getCell(X);
        if (variabilitySubjectCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            param.setVariabilitySubject(variabilitySubjectCell.getStringCellValue());
        }

        Cell maxCell = row.getCell(Y);
        if (maxCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            if(maxCell.getCellType() != Cell.CELL_TYPE_STRING)
                param.setMaxValue(String.valueOf(maxCell.getNumericCellValue()));
            else param.setMaxValue(maxCell.getStringCellValue());
            
        }
        
        Cell minCell = row.getCell(Z);
        if (minCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            if(minCell.getCellType() != Cell.CELL_TYPE_STRING)
                param.setMinValue(String.valueOf(minCell.getNumericCellValue()));
            else param.setMinValue(minCell.getStringCellValue());
        }

        Cell errorCell = row.getCell(AA);
        if (errorCell.getCellType() != Cell.CELL_TYPE_BLANK) {
            if(errorCell.getCellType() != Cell.CELL_TYPE_STRING)
                param.setError(String.valueOf(errorCell.getNumericCellValue()));
            else param.setError(errorCell.getStringCellValue());
        }
        return param;
    }

    public QualityMeasures retrieveQualityMeasures(Sheet sheet) {
        QualityMeasures measures = new QualityMeasures();

        Cell sseCell = sheet.getRow(QUALITY_MEASURES__SSE).getCell(M);
        if (sseCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            measures.setSse(BigDecimal.valueOf(sseCell.getNumericCellValue()));
        }

        Cell mseCell = sheet.getRow(QUALITY_MEASURES__MSE).getCell(M);
        if (mseCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            measures.setMse(BigDecimal.valueOf(mseCell.getNumericCellValue()));
        }

        Cell rmseCell = sheet.getRow(QUALITY_MEASURES__RMSE).getCell(M);
        if (rmseCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            measures.setRmse(BigDecimal.valueOf(rmseCell.getNumericCellValue()));
        }

        Cell rsquareCell = sheet.getRow(QUALITY_MEASURES__RSQUARE).getCell(M);
        if (rsquareCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            measures.setRsquared(BigDecimal.valueOf(rsquareCell.getNumericCellValue()));
        }
        
        Cell aicCell = sheet.getRow(QUALITY_MEASURES__AIC).getCell(M);
        if (aicCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            measures.setAic(BigDecimal.valueOf(aicCell.getNumericCellValue()));
        }

        Cell bicCell = sheet.getRow(QUALITY_MEASURES__BIC).getCell(M);
        if (bicCell.getCellType() == Cell.CELL_TYPE_NUMERIC) {
            measures.setBic(BigDecimal.valueOf(bicCell.getNumericCellValue()));
        }
        
        return measures;
    }
    public DietaryAssessmentMethod retrieveDietaryAssessmentMethod(Row row) {

        // Check first mandatory properties
        if (row.getCell(L).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing methodological tool to collect data");
        }
        if (row.getCell(M).getCellType() != Cell.CELL_TYPE_NUMERIC) {
            throw new IllegalArgumentException("Missing number of non consecutive one day");
        }

        DietaryAssessmentMethod method = new DietaryAssessmentMethod();

        method.setCollectionTool(row.getCell(L).getStringCellValue());
        method.setNumberOfNonConsecutiveOneDay(Double.toString(row.getCell(M).getNumericCellValue()));

        Cell softwareCell = row.getCell(N);
        if (softwareCell.getCellType() == Cell.CELL_TYPE_STRING) {
            method.setSoftwareTool(softwareCell.getStringCellValue());
        }

        Cell foodItemsCell = row.getCell(O);
        if (foodItemsCell.getCellType() == Cell.CELL_TYPE_STRING) {
            method.addNumberOfFoodItemsItem(foodItemsCell.getStringCellValue());
        }

        Cell recordTypesCell = row.getCell(P);
        if (recordTypesCell.getCellType() == Cell.CELL_TYPE_STRING) {
            method.addRecordTypesItem(recordTypesCell.getStringCellValue());
        }

        Cell foodDescriptorsCell = row.getCell(Q);
        if (foodDescriptorsCell.getCellType() == Cell.CELL_TYPE_STRING) {
            method.addFoodDescriptorsItem(foodDescriptorsCell.getStringCellValue());
        }

        return method;
    }
    public PopulationGroup retrievePopulationGroup(Row row) {
        
        // Check mandatory properties
        if (row.getCell(AK).getCellType() != Cell.CELL_TYPE_STRING) {
            throw new IllegalArgumentException("Missing population name");
        }

        PopulationGroup group = new PopulationGroup();

        Cell nameCell = row.getCell(AK);
        if (nameCell.getCellType() == Cell.CELL_TYPE_STRING) {
            group.setName(nameCell.getStringCellValue());
        }

        Cell targetPopulationCell = row.getCell(AL);
        if (targetPopulationCell.getCellType() == Cell.CELL_TYPE_STRING) {
            group.setTargetPopulation(targetPopulationCell.getStringCellValue());
        }

        Cell spanCell = row.getCell(AM);
        if (spanCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(spanCell.getStringCellValue().split(",")).forEach(group::addPopulationSpanItem);
        }

        Cell descriptionCell = row.getCell(AN);
        if (descriptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(descriptionCell.getStringCellValue().split(",")).forEach(group::addPopulationDescriptionItem);
        }

        Cell ageCell = row.getCell(AO);
        if (ageCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(ageCell.getStringCellValue().split(",")).forEach(group::addPopulationAgeItem);
        }

        Cell genderCell = row.getCell(AP);
        if (genderCell.getCellType() == Cell.CELL_TYPE_STRING) {
            group.setPopulationGender(genderCell.getStringCellValue());
        }

        Cell bmiCell = row.getCell(AQ);
        if (bmiCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(bmiCell.getStringCellValue().split(",")).forEach(group::addBmiItem);
        }

        Cell dietCell = row.getCell(AR);
        if (dietCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(dietCell.getStringCellValue().split(",")).forEach(group::addSpecialDietGroupsItem);
        }

        Cell consumptionCell = row.getCell(AS);
        if (consumptionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(consumptionCell.getStringCellValue().split(",")).forEach(group::addPatternConsumptionItem);
        }

        Cell regionCell = row.getCell(AT);
        if (regionCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(regionCell.getStringCellValue().split(",")).forEach(group::addRegionItem);
        }

        Cell countryCell = row.getCell(AU);
        if (countryCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(countryCell.getStringCellValue().split(",")).forEach(group::addCountryItem);
        }

        Cell factorsCell = row.getCell(AV);
        if (factorsCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(factorsCell.getStringCellValue().split(",")).forEach(group::addPopulationRiskFactorItem);
        }

        Cell seasonCell = row.getCell(AW);
        if (seasonCell.getCellType() == Cell.CELL_TYPE_STRING) {
            Arrays.stream(seasonCell.getStringCellValue().split(",")).forEach(group::addSeasonItem);
        }

        return group;
    }
}