Changeset 5778
- Timestamp:
- Dec 9, 2019, 9:37:42 AM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/net.sf.basedb.reggie/trunk/src/net/sf/basedb/reggie/plugins/TMASpecimenImporter.java
r5777 r5778 35 35 import net.sf.basedb.plugins.util.Parameters; 36 36 import net.sf.basedb.reggie.Reggie; 37 import net.sf.basedb.reggie.dao.Annotationtype; 37 38 import net.sf.basedb.reggie.dao.Case; 38 39 import net.sf.basedb.reggie.dao.ReggieItem; … … 70 71 ); 71 72 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 73 100 public TMASpecimenImporter() 74 101 {} … … 183 210 storeValue(wrapper, request, complexMappings); 184 211 storeValue(wrapper, request, caseColumnMapping); 212 storeValue(wrapper, request, tmaBlockColumnMapping); 213 storeValue(wrapper, request, tmaBlockPosColumnMapping); 214 storeValue(wrapper, request, padColumnMapping); 185 215 186 216 response.setDryRun(Boolean.TRUE.equals(request.getParameterValue(Parameters.DRY_RUN_PARAMETER))); … … 205 235 private ItemQuery<Sample> caseQuery; 206 236 private Mapper caseMapper; 237 private Mapper tmaBlockMapper; 238 private Mapper tmaBlockPosMapper; 239 private Mapper padMapper; 207 240 private String lastTMA_XId; 208 241 … … 230 263 { 231 264 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); 232 268 numCreated = 0; 233 269 } … … 249 285 } 250 286 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); 253 290 if (lastTMA_XId == null) 254 291 { … … 266 303 tmaSpecimen.setName(tmaName); 267 304 tmaSpecimen.setExternalId(lastTMA_XId); 268 tmaSpecimen.getCreationEvent().setSource(theCase .getItem());305 tmaSpecimen.getCreationEvent().setSource(theCase); 269 306 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)); 270 311 271 312 numCreated++; … … 339 380 parameters.add(complexMappings); 340 381 parameters.add(caseColumnMapping); 382 parameters.add(tmaBlockColumnMapping); 383 parameters.add(tmaBlockPosColumnMapping); 384 parameters.add(padColumnMapping); 341 385 342 386 configureParser = new RequestInformation
Note: See TracChangeset
for help on using the changeset viewer.