Skip to content

Commit

Permalink
fix hardcoded urls
Browse files Browse the repository at this point in the history
  • Loading branch information
Sandip117 committed Nov 19, 2024
1 parent c7e7c1f commit 6658f5f
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
4 changes: 2 additions & 2 deletions chrisClient.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
class ChrisClient(BaseClient):
def __init__(self, url: str, username: str, password: str):
self.cl = client.Client(url, username, password)
self.cl.pacs_series_url = "http://localhost:8000/api/v1/pacs/series/"
self.req = PACSClient(username,password)
self.cl.pacs_series_url = f"{url}pacs/series/"
self.req = PACSClient(self.cl.pacs_series_url,username,password)

def create_con(self,params:dict):
return self.cl
Expand Down
6 changes: 3 additions & 3 deletions chris_pacs_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@


class PACSClient(object):
def __init__(self, username: str, password: str):
def __init__(self, url: str, username: str, password: str):
self.cl = request.Request(username, password)
self.pacs_series_url = "http://localhost:8000/api/v1/pacs/series/search/"
self.pacs_series_search_url = f"{url}search/"


def get_pacs_files(self, params: dict):
l_dir_path = set()
resp = self.cl.get(self.pacs_series_url,params)
resp = self.cl.get(self.pacs_series_search_url,params)
for item in resp.items:
for link in item.links:
folder = self.cl.get(link.href)
Expand Down
11 changes: 9 additions & 2 deletions dyanon.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import pfdcm
import sys
import time
import os

LOG = logger.debug

Expand All @@ -27,7 +28,7 @@
logger.remove()
logger.add(sys.stderr, format=logger_format)

__version__ = '1.0.1'
__version__ = '1.0.2'

DISPLAY_TITLE = r"""
_ _
Expand Down Expand Up @@ -154,7 +155,7 @@ def main(options: Namespace, inputdir: Path, outputdir: Path):

for d_job in l_job:
d_job["send"] = {
"url" : options.orthancUrl,
"url" : options.orthancUrl,
"username" : options.username,
"password" : options.password,
"aec" : options.pushToRemote
Expand Down Expand Up @@ -196,6 +197,12 @@ def health_check(options) -> bool:
"""
check if connections to pfdcm, orthanc, and CUBE is valid
"""
try:
if not options.pluginInstanceID:
options.pluginInstanceID = os.environ['CHRIS_PREV_PLG_INST_ID']
except Exception as ex:
LOG(ex)
return False
try:
# create connection object
cube_con = ChrisClient(options.CUBEurl, options.CUBEuser, options.CUBEpassword)
Expand Down

0 comments on commit 6658f5f

Please sign in to comment.