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

SHANOIRUploader - Allowing Patient ID only C-FIND request #2444

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 @@ -10,7 +10,6 @@

import javax.swing.JButton;
import javax.swing.JFileChooser;
import javax.swing.JFrame;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
Expand Down Expand Up @@ -154,24 +153,6 @@ public void actionPerformed(ActionEvent event) {
lastName = patientName + "*";
}

// Users can't use the wildcard "*" on the lastName unless they
// introduce at least 3 characters
boolean exitFlag = false;
if (lastName.contains("*")) {
String lastNamePartIntroduced = lastName;
String regex = "\\*";
String replacement = "";
lastNamePartIntroduced = lastNamePartIntroduced.replaceAll(
regex, replacement);
if (lastNamePartIntroduced.length() < 3) {
String message = "\"The wildcard \"*\" can not be used on the last name unless introducing at least 3 characters\"\n";
JOptionPane.showMessageDialog(new JFrame(), message,
"ERROR", JOptionPane.ERROR_MESSAGE);
mainWindow.patientNameTF.setText("");
exitFlag = true;
}
}

// for Request, the Patient Name must be of the form:
// lastName^firstName1^firstName2

Expand All @@ -185,7 +166,6 @@ else if (!firstName1.equals(""))
else
patientNameFinal = lastName.toUpperCase();

if (!exitFlag) {
String modality = null;
if (!mainWindow.noRB.isSelected()) {
if (mainWindow.mrRB.isSelected()) {
Expand All @@ -208,9 +188,7 @@ else if (!firstName1.equals(""))
mainWindow.studyDescriptionTF.getText(),
mainWindow.birthDate, mainWindow.studyDate);
fillMediaWithPatients(media, patients);
} else {
media = null;
}

this.mainWindow.setCursor(Cursor.getDefaultCursor());
} catch (ConnectException cE) {
logger.error(cE.getMessage(), cE);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
import javax.swing.JMenu;
import javax.swing.JMenuBar;
import javax.swing.JMenuItem;
import javax.swing.JOptionPane;
import javax.swing.JPanel;
import javax.swing.JProgressBar;
import javax.swing.JRadioButton;
Expand Down Expand Up @@ -353,80 +352,16 @@ public void actionPerformed(ActionEvent arg0) {

patientNameTF = new JTextField();
GridBagConstraints gbc_patientNameTF = new GridBagConstraints();
gbc_patientNameTF.insets = new Insets(5, 5, 0, 0);
gbc_patientNameTF.insets = new Insets(5, 5, 0, 10);
gbc_patientNameTF.fill = GridBagConstraints.HORIZONTAL;
gbc_patientNameTF.gridwidth = 6;
gbc_patientNameTF.gridx = 1;
gbc_patientNameTF.gridy = 2;
queryPanel.add(patientNameTF, gbc_patientNameTF);
patientNameTF.setColumns(15);
patientNameTF.setText("");
patientNameTF.setToolTipText(resourceBundle.getString("shanoir.uploader.patientNameLabel.tooltip"));

/**
* Help Button
*/
JButton helpButton;
helpButton = new JButton(resourceBundle.getString("shanoir.uploader.helpButton"));
GridBagConstraints gbc_HelpButton = new GridBagConstraints();
gbc_HelpButton.insets = new Insets(5, 2, 0, 2);
gbc_HelpButton.gridx = 7;
gbc_HelpButton.gridy = 2;
queryPanel.add(helpButton, gbc_HelpButton);

helpButton.addActionListener(new java.awt.event.ActionListener() {
@Override
public void actionPerformed(java.awt.event.ActionEvent evt) {
String message = "<html><b> - </b>The patient name should be in this form:</html> "
+ "\n"
+ "\n"
+ "<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
+ "<b>"
+ "LastName"
+ "<b>"
+ "</html>"
+ "\n"
+ "or"
+ "\n"
+ "<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
+ "<b>"
+ "LastName, FirstName"
+ "<b>"
+ "</html>"
+ "\n"
+ "or"
+ "\n"
+ "<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
+ "<b>"
+ "LastName, FirstName1, FirstName2"
+ "<b>"
+ "</html>"
+ "\n"
+ "\n"
+

"<html><b> - </b>The wildcard character &nbsp;&nbsp; \"*\" &nbsp;&nbsp;can be used :</html>"
+ "\n"
+ "\n"
+

"<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
+ "<b>"
+ "with the patient FirstName"
+ "<b>"
+ "</html>"
+ "\n"
+ "or"
+ "\n"
+ "<html>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;"
+ "<b>"
+ "with the patient LastName only if the LastName introduced contains at least 4 characters"
+ "<b>" + "</html>" + "\n";


JOptionPane.showMessageDialog(queryPanel, message, "Help",
JOptionPane.INFORMATION_MESSAGE);
}
});

// If fields Patient name, Patient ID and Study description are empty
// Query DICOM server button is grey
Expand Down Expand Up @@ -457,7 +392,7 @@ public void caretUpdate(javax.swing.event.CaretEvent e) {

patientIDTF = new JTextField();
GridBagConstraints gbc_patientIDTF = new GridBagConstraints();
gbc_patientIDTF.insets = new Insets(5, 5, 0, 0);
gbc_patientIDTF.insets = new Insets(5, 5, 0, 10);
gbc_patientIDTF.fill = GridBagConstraints.HORIZONTAL;
gbc_patientIDTF.gridwidth = 6;
gbc_patientIDTF.gridx = 1;
Expand Down Expand Up @@ -488,7 +423,7 @@ public void caretUpdate(javax.swing.event.CaretEvent e) {
birthDatePicker.setTextEditable(true);

GridBagConstraints gbc_birthDateResearchTF = new GridBagConstraints();
gbc_birthDateResearchTF.insets = new Insets(5, 5, 0, 0);
gbc_birthDateResearchTF.insets = new Insets(5, 5, 0, 10);
gbc_birthDateResearchTF.fill = GridBagConstraints.HORIZONTAL;
gbc_birthDateResearchTF.gridwidth = 6;
gbc_birthDateResearchTF.gridx = 1;
Expand Down Expand Up @@ -558,7 +493,7 @@ public void actionPerformed(ActionEvent e) {

studyDescriptionTF = new JTextField();
GridBagConstraints gbc_studyDescriptionTF = new GridBagConstraints();
gbc_studyDescriptionTF.insets = new Insets(5, 5, 0, 0);
gbc_studyDescriptionTF.insets = new Insets(5, 5, 0, 10);
gbc_studyDescriptionTF.fill = GridBagConstraints.HORIZONTAL;
gbc_studyDescriptionTF.gridwidth = 6;
gbc_studyDescriptionTF.gridx = 1;
Expand Down Expand Up @@ -591,7 +526,7 @@ public void actionPerformed(ActionEvent e) {
studyDatePicker.setTextEditable(true);

GridBagConstraints gbc_studyDatePicker = new GridBagConstraints();
gbc_studyDatePicker.insets = new Insets(5, 5, 0, 0);
gbc_studyDatePicker.insets = new Insets(5, 5, 0, 10);
gbc_studyDatePicker.fill = GridBagConstraints.HORIZONTAL;
gbc_studyDatePicker.gridwidth = 6;
gbc_studyDatePicker.gridx = 1;
Expand Down Expand Up @@ -701,7 +636,7 @@ public void actionPerformed(ActionEvent e) {
noRB = new JRadioButton("None");
modalityRG.add(noRB);
GridBagConstraints gBC_noRB = new GridBagConstraints();
gBC_noRB.insets = new Insets(2, 2, 0, 2);
gBC_noRB.insets = new Insets(2, 2, 0, 10);
gBC_noRB.fill = GridBagConstraints.HORIZONTAL;
gBC_noRB.gridx = 5;
gBC_noRB.gridy = 7;
Expand Down
3 changes: 2 additions & 1 deletion shanoir-uploader/src/main/resources/messages_en.properties
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ shanoir.uploader.subjectIDLabel=<html><em>or</em> Subject ID:<html>
shanoir.uploader.studyIDLabel=<html><em>and / or</em> Study ID:<html>
shanoir.uploader.outputDirectoryLabel=Output directory:
shanoir.uploader.patientNameLabel=Patient name:
shanoir.uploader.patientNameLabel.tooltip=Last name and first names should be separated by a comma. Only the first letters of the last name are sufficient.
shanoir.uploader.preImportDialog.title=ImportDialog
shanoir.uploader.profile.select.label=Select Profile:
shanoir.uploader.profile.select.button=Select
Expand Down Expand Up @@ -284,4 +285,4 @@ shanoir.uploader.systemErrorDialog.error.wsdl.subjectfinder.find=Unable to find
shanoir.uploader.systemErrorDialog.error.wsdl.subjectfinder=Unable to access Subject Finder.
shanoir.uploader.systemErrorDialog.error.wsdl.uploadService=Unable to access Upload webservice. IRM Sequences will not be exported to Shanoir platform.
shanoir.uploader.systemErrorDialog.label=The following error was encountered on
shanoir.uploader.systemErrorDialog.title=System Error
shanoir.uploader.systemErrorDialog.title=System Error
1 change: 1 addition & 0 deletions shanoir-uploader/src/main/resources/messages_fr.properties
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ shanoir.uploader.subjectIDLabel=<html><em>ou</em> ID du sujet:<html>
shanoir.uploader.studyIDLabel=<html><em>et / ou</em> ID de l'&eacute;tude:<html>
shanoir.uploader.outputDirectoryLabel=R\u00E9pertoire de sortie:
shanoir.uploader.patientNameLabel=Nom du patient :
shanoir.uploader.patientNameLabel.tooltip=Nom et pr\u00E9noms doivent \u00eatre s\u00E9par\u00E9s par une virgule. Seules les premi\u00E8res lettres du nom suffisent.
shanoir.uploader.preImportDialog.title=Fen\u00eatre de import.
shanoir.uploader.profile.select.label=Choisissez le profil :
shanoir.uploader.profile.select.button=Choisir
Expand Down
Loading