Changeset 5778


Ignore:
Timestamp:
Dec 9, 2019, 9:37:42 AM (2 years ago)
Author:
Nicklas Nordborg
Message:

References #1209: Add support for storing TMA specimen

Implemented support for importing annotations TMABlock, TMABlockPos and PAD.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/TMASpecimenImporter.java

    r5777 r5778  
    3535import net.sf.basedb.plugins.util.Parameters;
    3636import net.sf.basedb.reggie.Reggie;
     37import net.sf.basedb.reggie.dao.Annotationtype;
    3738import net.sf.basedb.reggie.dao.Case;
    3839import net.sf.basedb.reggie.dao.ReggieItem;
     
    7071      );
    7172
    72  
     73  private static final PluginParameter<String> tmaBlockColumnMapping = new PluginParameter<String>(
     74      "tmaBlockColumnMapping",
     75      "TMA Block",
     76      "Mapping that picks the name of the TMA Block on which the specimen is located. This " +
     77      "parameter is required. " +
     78      "Example: \\TMABlock\\",
     79      requiredColumnMapping
     80      );
     81 
     82  private static final PluginParameter<String> tmaBlockPosColumnMapping = new PluginParameter<String>(
     83      "tmaBlockPosColumnMapping",
     84      "TMA Block Position",
     85      "Mapping that picks the position on the TMA block were the specimen is located. This " +
     86      "parameter is required. " +
     87      "Example: \\TMABlockPos\\",
     88      requiredColumnMapping
     89      );
     90 
     91  private static final PluginParameter<String> padColumnMapping = new PluginParameter<String>(
     92      "padColumnMapping",
     93      "PAD",
     94      "Mapping that picks the PAD id that was used to create the TMA. This " +
     95      "parameter is required. " +
     96      "Example: \\PAD\\",
     97      requiredColumnMapping
     98      );
     99
    73100  public TMASpecimenImporter()
    74101  {}
     
    183210        storeValue(wrapper, request, complexMappings);
    184211        storeValue(wrapper, request, caseColumnMapping);
     212        storeValue(wrapper, request, tmaBlockColumnMapping);
     213        storeValue(wrapper, request, tmaBlockPosColumnMapping);
     214        storeValue(wrapper, request, padColumnMapping);
    185215       
    186216        response.setDryRun(Boolean.TRUE.equals(request.getParameterValue(Parameters.DRY_RUN_PARAMETER)));
     
    205235  private ItemQuery<Sample> caseQuery;
    206236  private Mapper caseMapper;
     237  private Mapper tmaBlockMapper;
     238  private Mapper tmaBlockPosMapper;
     239  private Mapper padMapper;
    207240  private String lastTMA_XId;
    208241 
     
    230263  {
    231264    caseMapper = getMapper(ffp, job.getValue("caseColumnMapping"), null, null);
     265    tmaBlockMapper = getMapper(ffp, job.getValue("tmaBlockColumnMapping"), null, null);
     266    tmaBlockPosMapper = getMapper(ffp, job.getValue("tmaBlockPosColumnMapping"), null, null);
     267    padMapper = getMapper(ffp, job.getValue("padColumnMapping"), null, null);
    232268    numCreated = 0;
    233269  }
     
    249285    }
    250286
    251     Case theCase = Case.get(cases.get(0));
    252     String tmaName = theCase.getNextTMASpecimenName(dc);
     287    Sample theCase = cases.get(0);
     288    Case c = Case.get(theCase);
     289    String tmaName = c.getNextTMASpecimenName(dc);
    253290    if (lastTMA_XId == null)
    254291    {
     
    266303    tmaSpecimen.setName(tmaName);
    267304    tmaSpecimen.setExternalId(lastTMA_XId);
    268     tmaSpecimen.getCreationEvent().setSource(theCase.getItem());
     305    tmaSpecimen.getCreationEvent().setSource(theCase);
    269306    dc.saveItem(tmaSpecimen);
     307   
     308    Annotationtype.TMA_BLOCK.setAnnotationValue(dc, tmaSpecimen, tmaBlockMapper.getString(data));
     309    Annotationtype.TMA_BLOCK_POS.setAnnotationValue(dc, tmaSpecimen, tmaBlockPosMapper.getString(data));
     310    Annotationtype.PAD.setAnnotationValue(dc, tmaSpecimen, padMapper.getString(data));
    270311   
    271312    numCreated++;
     
    339380        parameters.add(complexMappings);
    340381        parameters.add(caseColumnMapping);
     382        parameters.add(tmaBlockColumnMapping);
     383        parameters.add(tmaBlockPosColumnMapping);
     384        parameters.add(padColumnMapping);
    341385       
    342386        configureParser = new RequestInformation
Note: See TracChangeset for help on using the changeset viewer.