Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid exception if modality is null to create manufacturer model #2655

Merged
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 @@ -121,7 +121,8 @@ public void actionPerformed(ActionEvent event) {
+ mainWindow.patientIDTF.getText() + " "
+ mainWindow.birthDate.toString() + " "
+ mainWindow.studyDescriptionTF.getText() + " "
+ mainWindow.studyDate.toString()) ;
+ mainWindow.studyDate.toString() + " "
+ mainWindow.modality);
this.mainWindow.isFromPACS = true;

this.mainWindow.setCursor(Cursor
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,8 @@ protected Void doInBackground() throws Exception {
String patientName = importJob.getDicomQuery().getPatientName();
String patientID = importJob.getDicomQuery().getPatientID();
String studyDate = importJob.getDicomQuery().getStudyDate();
String importJobIdentifier = "[Line: " + i + ", patientName: " + patientName + ", patientID: " + patientID + ", studyDate: " + studyDate + "]";
String modality = importJob.getDicomQuery().getModality();
String importJobIdentifier = "[Line: " + i + ", patientName: " + patientName + ", patientID: " + patientID + ", studyDate: " + studyDate + ", modality: " + modality + "]";
logger.info("\r\n------------------------------------------------------\r\n"
+ "Starting importJob " + importJobIdentifier + "\r\n"
+ "------------------------------------------------------");
Expand Down Expand Up @@ -294,7 +295,12 @@ private boolean importData(ImportJob importJob, org.shanoir.uploader.model.rest.
logger.error(importJob.getErrorMessage());
return false;
}

// Modality is mandatory to create a new Manufacturer model, but not mandatory in the dicom query
String modality = importJob.getDicomQuery().getModality();
if (modality == null || modality.isBlank()) {
modality = importJob.getSelectedSeries().iterator().next().getModality();
}
Integer datasetModalityType = DatasetModalityType.getIdFromModalityName(modality);
String magneticFieldStrength = uploadJob.getMriInformation().getMagneticFieldStrength();
if (magneticFieldStrength == null || magneticFieldStrength.isBlank() || "unknown".equals(magneticFieldStrength)) {
Expand Down