Skip to content

Commit

Permalink
Merge pull request #2655 from LaurentPV/issue#2592_shup_mass_import_b…
Browse files Browse the repository at this point in the history
…ugfix

avoid exception if modality is null to create manufacturer model
  • Loading branch information
michaelkain authored Feb 26, 2025
2 parents 436c808 + 2e4ebb3 commit a0c15d4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
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

0 comments on commit a0c15d4

Please sign in to comment.