# HG changeset patch # User Sebastien Jodogne # Date 1497085646 -7200 # Node ID 7aee4cc64fca98e65d2772b09272ebbbcd5809fd # Parent fddb35f7289d7891c760d870673a71bcb0e5fb38 fix diff -r fddb35f7289d -r 7aee4cc64fca Database/Worklists/Encodings/issue49-latin1.wl Binary file Database/Worklists/Encodings/issue49-latin1.wl has changed diff -r fddb35f7289d -r 7aee4cc64fca Plugins/Worklists/Run.py --- a/Plugins/Worklists/Run.py Fri Jun 09 15:33:14 2017 +0200 +++ b/Plugins/Worklists/Run.py Sat Jun 10 11:07:26 2017 +0200 @@ -78,6 +78,9 @@ DATABASE = os.path.abspath(os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..', 'Database', 'Worklists'))) WORKING = os.path.join(DATABASE, 'Working') +print('Database directory: %s' % DATABASE) +print('Working directory: %s' % WORKING) + try: os.mkdir(WORKING) except Exception as e: @@ -106,23 +109,33 @@ if len(filter(lambda x: x.startswith('E:'), a)) > 0: raise Exception('Error while running findscu') - b = map(lambda x: x[3:], filter(lambda x: x.startswith('W: ---') or x.startswith('W: ('), a)) + b = map(lambda x: x[3:], filter(lambda x: (x.startswith('I: ---') or + x.startswith('W: ---') or + x.startswith('I: (') or + x.startswith('W: (')), a)) b = map(lambda x: re.sub(r'\s*#.*', '', x), b) answers = [] current = [] + isQuery = True for l in b: + l = l.replace('\0', '') + if l[0] == '-': - # This is a separator between DICOM datasets - if len(current) > 0: - answers.append(current) - current = [] + if isQuery: + isQuery = False + else: + # This is a separator between DICOM datasets + if len(current) > 0: + answers.append(current) + current = [] else: - tag = l[1:10].lower() - if not tag in ignoreTags: - current.append(l) + if not isQuery: + tag = l[1:10].lower() + if not tag in ignoreTags: + current.append(l) if len(current) > 0: answers.append(current)