Skip to content

Commit

Permalink
Merge pull request #22 from salimkanoun/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
salimkanoun committed Oct 29, 2018
2 parents 3e2f352 + 8c9500d commit 05ae366
Show file tree
Hide file tree
Showing 16 changed files with 435 additions and 307 deletions.
6 changes: 6 additions & 0 deletions pom.xml
Expand Up @@ -352,6 +352,12 @@

</dependency>

<dependency>
<groupId>com.vnetpublishing.java</groupId>
<artifactId>super-user-application</artifactId>
<version>0.0.5</version>
</dependency>

</dependencies>

</project>
Expand Up @@ -63,7 +63,6 @@ public void windowClosing(WindowEvent e) {
private void closeAll() {
if (monitoring.isRunningMonitoringService()) monitoring.closeAllMonitoringServices();
if(runOrthanc.getIsStarted()) {

runOrthanc.stopOrthanc();
}
frame.dispose();
Expand Down
14 changes: 7 additions & 7 deletions src/org/petctviewer/orthanc/anonymize/QueryFillStore.java
Expand Up @@ -18,7 +18,6 @@
package org.petctviewer.orthanc.anonymize;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -47,7 +46,7 @@ public QueryFillStore(ParametreConnexionHttp connexion){
}

public QueryFillStore(ParametreConnexionHttp connexion, String level, String inputType, String input,
String date, String studyDesc) throws MalformedURLException{
String date, String studyDesc) {

this.connexion=connexion;

Expand Down Expand Up @@ -126,7 +125,7 @@ public String getQuery(){
return this.query;
}

private String sendQuery(String action) throws IOException{
private String sendQuery(String action){
StringBuilder sb = new StringBuilder();

if(action.equals("storeIDs") && this.url.toString().contains("tools/find")){
Expand All @@ -140,7 +139,7 @@ private String sendQuery(String action) throws IOException{
return sb.toString();
}

private void storeIDs() throws IOException{
private void storeIDs(){

if(this.level.equals("series")){

Expand Down Expand Up @@ -188,9 +187,10 @@ public ArrayList<String> getIDs(){
}

// Renvoie les responses JSON par niveau de query
public List<JSONObject> getJsonResponse() throws IOException{
public List<JSONObject> getJsonResponse() {
ids.removeAll(ids);
this.storeIDs();

List<JSONObject> jsonResponses=new ArrayList<JSONObject>();

for(String id : ids){
Expand Down Expand Up @@ -237,7 +237,7 @@ public Object[] getAET() {
for (int i=0 ; i<aet.size(); i++){
indexes.add(aet.get(i).toString());
}
} catch (ParseException | IOException e) {e.printStackTrace();}
} catch (ParseException e) {e.printStackTrace();}

// We convert the ArrayList to an Object[]
return indexes.toArray();
Expand Down Expand Up @@ -266,7 +266,7 @@ public Object[] getPeers() {
for (int i=0 ; i<peers.size(); i++){
indexes.add(peers.get(i).toString());
}
} catch (ParseException | IOException e) {e.printStackTrace();}
} catch (ParseException e) {e.printStackTrace();}

// We convert the ArrayList to an Object[]
return indexes.toArray();
Expand Down
13 changes: 3 additions & 10 deletions src/org/petctviewer/orthanc/anonymize/TableDataExportSeries.java
Expand Up @@ -19,7 +19,6 @@

import java.io.IOException;
import java.net.HttpURLConnection;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

Expand Down Expand Up @@ -121,13 +120,7 @@ protected Void doInBackground() {
@Override
protected void done(){
clear();
try {
addSerie(studyID);
} catch (IOException e) {
e.printStackTrace();
} catch (ParseException e) {
e.printStackTrace();
}
addSerie(studyID);
stateExport.setText("<html><font color='green'>The description has been changed.</font></html>");
frame.pack();
}
Expand All @@ -142,7 +135,7 @@ public Serie getSerie(int rowIndex){
return this.series.get(rowIndex);
}

public boolean checkSopClassUid(String instanceUid) throws IOException{
public boolean checkSopClassUid(String instanceUid) {
if(instanceUid != null){
url="/instances/" + instanceUid + "/metadata/SopClassUid";
StringBuilder sb =connexionHttp.makeGetConnectionAndStringBuilder(url);
Expand Down Expand Up @@ -194,7 +187,7 @@ public ArrayList<Serie> getSeries(){
return this.series;
}

public void addSerie(String studyID) throws IOException, ParseException{
public void addSerie(String studyID) {
this.studyID = studyID;

QueryFillStore querySeries = new QueryFillStore(connexionHttp,"series", null, studyID, null, null);
Expand Down
11 changes: 2 additions & 9 deletions src/org/petctviewer/orthanc/anonymize/TableDataSeries.java
Expand Up @@ -18,14 +18,9 @@
package org.petctviewer.orthanc.anonymize;

import java.io.IOException;
//import java.net.HttpURLConnection;
import java.text.ParseException;
import java.util.ArrayList;
import java.util.List;

import javax.swing.JFrame;
import javax.swing.JLabel;
//import javax.swing.SwingWorker;
import javax.swing.table.AbstractTableModel;

import org.json.simple.JSONArray;
Expand All @@ -42,12 +37,10 @@ public class TableDataSeries extends AbstractTableModel{
private String url;
private ParametreConnexionHttp connexionHttp;

public TableDataSeries(ParametreConnexionHttp connexionHttp, JLabel state, JFrame frame){
public TableDataSeries(ParametreConnexionHttp connexionHttp){
super();
//Recupere les settings
this.connexionHttp=connexionHttp;
//this.state = state;
//this.frame = frame;

}

Expand Down Expand Up @@ -145,7 +138,7 @@ public void removeSerie(int rowIndex){
fireTableRowsDeleted(rowIndex, rowIndex);
}

public void addSerie(String studyID) throws IOException, ParseException{
public void addSerie(String studyID) {
//this.studyID = studyID;
QueryFillStore querySeries = new QueryFillStore(connexionHttp,"series", null, studyID, null, null);
List<JSONObject> jsonResponsesPatient=querySeries.getJsonResponse();
Expand Down
Expand Up @@ -48,7 +48,7 @@ public void mouseClicked(MouseEvent event) {
this.modeleSeries.clear();

try {
if(this.modele.getRowCount() != 0){
if(this.modele.getRowCount() != 0 && tableau.getSelectedRow() != -1){
String patientName = (String)this.tableau.getValueAt(this.tableau.getSelectedRow(), 0);
String patientID = (String)this.tableau.getValueAt(this.tableau.getSelectedRow(), 1);
String patientUID = (String)this.tableau.getValueAt(this.tableau.getSelectedRow(), 2);
Expand Down
Expand Up @@ -19,8 +19,6 @@

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.io.IOException;

import javax.swing.JFrame;
import javax.swing.JTable;
import javax.swing.ListSelectionModel;
Expand Down Expand Up @@ -50,9 +48,6 @@ public void mouseClicked(MouseEvent event) {
String studyID = (String)this.tableau.getValueAt(this.tableau.getSelectedRow(), 3);
this.modeleSeries.addSerie(studyID);
}
} catch (IOException e1) {
e1.printStackTrace();

} catch (Exception e1) {
//ignore
}
Expand Down

0 comments on commit 05ae366

Please sign in to comment.