Skip to content
Merged
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 @@ -972,7 +972,11 @@ private void validateUniqueObsUnits(
String errorMessage = String.format("The ID (%s) is not unique within the environment(%s)", importRow.getExpUnitId(), importRow.getEnv());
this.addRowError(Columns.EXP_UNIT_ID, errorMessage, validationErrors, rowNum);
} else {
uniqueStudyAndObsUnit.add(envIdPlusStudyId);
//Only want to add valid unique study-obs unit combos
//To avoid situations like system counting a null value as a unique combo
if (!envIdPlusStudyId.isBlank()) {
uniqueStudyAndObsUnit.add(envIdPlusStudyId);
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,13 +169,19 @@ public static String createObservationUnitKey(ExperimentObservation importRow) {
*
* This method takes in the name of a study and the name of an observation unit and concatenates them to create a unique key.
*
* If one or both of the inputs is null, returns an empty string since not a valid combination
*
* @param studyName The name of the study
* @param obsUnitName The name of the observation unit
* @return A string representing the unique key formed by concatenating the study name and observation unit name
*/
public static String createObservationUnitKey(String studyName, String obsUnitName) {
// Concatenate the study name and observation unit name to create the unique key
return studyName + obsUnitName;
if (studyName != null && obsUnitName != null) {
return studyName + obsUnitName;
} else {
return "";
}
}

// Module/Script-level documentation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,11 @@ private void validateUniqueObsUnits(
String errorMessage = String.format("The ID (%s) is not unique within the environment(%s)", importRow.getExpUnitId(), importRow.getEnv());
ExperimentUtilities.addRowError(ExperimentObservation.Columns.EXP_UNIT_ID, errorMessage, validationErrors, rowNum);
} else {
uniqueStudyAndObsUnit.add(envIdPlusStudyId);
//Only want to add valid unique study-obs unit combos
//To avoid situations like system counting a null value as a unique combo
if (!envIdPlusStudyId.isBlank()) {
uniqueStudyAndObsUnit.add(envIdPlusStudyId);
}
}
}

Expand Down