Sfoglia il codice sorgente

Modifying last argument of sentCFind to be a dictionary with required Query and optional Level field

Andrej 4 settimane fa
parent
commit
56ec5b679b
1 ha cambiato i file con 3 aggiunte e 2 eliminazioni
  1. 3 2
      orthancQR.py

+ 3 - 2
orthancQR.py

@@ -28,8 +28,8 @@ class orthancQR:
       #OK if empty,JSON if fail
       return orthancDatabaseBrowser.extractJSON(response.data)
 
-   def sendCFind(self,name,query):
-      v={"Level":"Study","Query":query}
+   def sendCFind(self,name,par):
+      v={"Level":par.get("Level","Study"),"Query":par["Query"]}
       apiURL='/'.join([self.net.getCoreURL(),'modalities',name,'query'])
       response=self.net.post(apiURL,json.dumps(v),'json')
       #pair of ID/Path json object
@@ -61,3 +61,4 @@ class orthancQR:
       response=self.net.post(apiURL,json.dumps(v),'json')
       return orthancDatabaseBrowser.extractJSON(response.data)
 
+