Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class ImportableColumn
private final boolean _maskOnExport;
private final boolean _unique;
private final int _size;
private final Class _javaClass;
private final Class<?> _javaClass;
private final JdbcType _jdbcType;
private Object _defaultValue = null;

Expand Down Expand Up @@ -88,7 +88,7 @@ public ImportableColumn(String tsvColumnName, Collection<String> tsvColumnAliase
}

// Can't use standard JdbcType.valueOf() method since this uses contains()
private static Class determineJavaType(String dbType)
private static Class<?> determineJavaType(String dbType)
{
if (dbType.contains(ImportTypes.DATETIME_TYPE))
throw new IllegalStateException("Java types for DateTime/Timestamp columns should be previously initialized.");
Expand Down Expand Up @@ -148,7 +148,7 @@ public boolean isUnique()
return _unique;
}

public Class getJavaClass()
public Class<?> getJavaClass()
{
return _javaClass;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -395,8 +395,6 @@ public RequestableRule(Container container)
public int updateRequestability(User user, List<Vial> vials) throws InvalidRuleException
{
TableInfo tableInfoVial = SpecimenSchema.get().getTableInfoVial(_container);
if (null == tableInfoVial)
throw new IllegalStateException("Expected Vial table to exist.");

SQLFragment reason = getAvailabilityReason();
SQLFragment updateSQL = new SQLFragment("UPDATE ");
Expand Down Expand Up @@ -573,7 +571,7 @@ public SQLFragment getFilterSQL(Container container, User user, List<Vial> vials
@Override
public SQLFragment getAvailabilityReason()
{
return new SQLFragment("'This vial is " + getMarkType().getLabel().toLowerCase() + " because it was found in the set called \"" + _queryName + "\".'");
return new SQLFragment("?", "This vial is " + getMarkType().getLabel().toLowerCase() + " because it was found in the set called \"" + _queryName + "\".");
}

@Override
Expand Down Expand Up @@ -695,8 +693,6 @@ public LockedWhileProcessingRule(Container container)
public SQLFragment getFilterSQL(Container container, User user, List<Vial> vials)
{
TableInfo tableInfoVial = SpecimenSchema.get().getTableInfoVial(_container);
if (null == tableInfoVial)
throw new IllegalStateException("Expected Vial table to exist.");

SQLFragment sql = new SQLFragment();
if (vials != null && !vials.isEmpty())
Expand Down Expand Up @@ -792,8 +788,6 @@ private void updateRequestability(Container container, User user, boolean resetT
if (resetToAvailable)
{
TableInfo tableInfoVial = SpecimenSchema.get().getTableInfoVial(container);
if (null == tableInfoVial)
throw new IllegalStateException("Expected Vial table to exist.");

if (logger != null)
logger.info("\tResetting vials to default available state.");
Expand Down Expand Up @@ -847,10 +841,9 @@ public void updateRequestability(Container container, User user, boolean resetTo

public static String makeSpecimenUnavailableMessage(Vial vial, @Nullable String additionalText)
{
String message = String.format("Specimen %s%s%s",
return String.format("Specimen %s%s%s",
vial.getGlobalUniqueId(),
null != vial.getAvailabilityReason() ? vial.getAvailabilityReason().replaceFirst("This vial", "") : " is not available.",
null != additionalText ? " " + additionalText : "");
return message;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@ public class SimpleSpecimenImporter extends SpecimenImporter
private final Map<String, String> _columnLabels;
private final TimepointType _timepointType;

public SimpleSpecimenImporter(Container container, User user)
{
this(container, user, TimepointType.DATE, "Subject");
}

public SimpleSpecimenImporter(Container container, User user, TimepointType timepointType, String participantIdLabel)
{
super(container, user);
Expand Down Expand Up @@ -130,15 +125,6 @@ public void fixupSpecimenColumns(TabLoader tl) throws IOException
tl.setColumns(mappedCols);
}

// UNDONE: Converting values belongs in _process
public List<Map<String, Object>> fixupSpecimenRows(List<Map<String, Object>> rows)
{
List<Map<String, Object>> result = new ArrayList<>();
for (Map<String, Object> row : rows)
result.add(fixupSpecimenRow(row));
return result;
}

private Map<String, Object> fixupSpecimenRow(Map<String, Object> row)
{
Map<String, Object> result = new HashMap<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ public void process(SimpleStudyImportContext ctx, VirtualFile studyDir, BindExce
current.put(pd.getName(), pd);
}

DomainURIFactory factory = name -> new Pair<>(domain.getTypeURI(), container);
DomainURIFactory factory = _ -> new Pair<>(domain.getTypeURI(), container);

ImportPropertyDescriptorsList pds = importHelper.getImportPropertyDescriptors(factory, propErrors, container);
if (!propErrors.isEmpty())
Expand Down