|
@@ -2,6 +2,7 @@ import json
|
|
import orthancInterface
|
|
import orthancInterface
|
|
import orthancDatabaseBrowser
|
|
import orthancDatabaseBrowser
|
|
import os
|
|
import os
|
|
|
|
+import urllib3
|
|
|
|
|
|
|
|
|
|
class orthancQR:
|
|
class orthancQR:
|
|
@@ -14,7 +15,7 @@ class orthancQR:
|
|
def addModality(self,name,aet,host,port):
|
|
def addModality(self,name,aet,host,port):
|
|
apiURL='/'.join([self.net.getCoreURL(),'modalities',name])
|
|
apiURL='/'.join([self.net.getCoreURL(),'modalities',name])
|
|
v={"AET":aet,"Host":host,"Port":port}
|
|
v={"AET":aet,"Host":host,"Port":port}
|
|
- response=self.net.put(apiURL,json.dumps(v),'json')
|
|
|
|
|
|
+ response=self.net.put(apiURL,json.dumps(v),'json',timeout=urllib3.util.Timeout(connect=1.0,read=1.0))
|
|
|
|
|
|
def removeModality(self,name):
|
|
def removeModality(self,name):
|
|
apiURL='/'.join([self.net.getCoreURL(),'modalities',name])
|
|
apiURL='/'.join([self.net.getCoreURL(),'modalities',name])
|
|
@@ -25,8 +26,6 @@ class orthancQR:
|
|
v={}
|
|
v={}
|
|
response=self.net.get(apiURL)
|
|
response=self.net.get(apiURL)
|
|
#OK if empty,JSON if fail
|
|
#OK if empty,JSON if fail
|
|
- if len(response.data)==0:
|
|
|
|
- return {}
|
|
|
|
return orthancDatabaseBrowser.extractJSON(response.data)
|
|
return orthancDatabaseBrowser.extractJSON(response.data)
|
|
|
|
|
|
def sendCFind(self,name,query):
|
|
def sendCFind(self,name,query):
|