Skip to content

Commit 3e0b8ee

Browse files
authored
Merge pull request #96 from bcschiffler/hotfix/issue93
Fix: #93 (Missing PerformingPhysicianName entry)
2 parents 8bb7feb + a8d0b51 commit 3e0b8ee

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/heudiconv

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -984,7 +984,12 @@ def get_formatted_scans_key_row(item):
984984
acq_time = datetime.strptime(td, '%H%M%S%Y%m%d').isoformat()
985985
# add random string
986986
randstr = ''.join(map(chr, sample(k=8, population=range(33, 127))))
987-
row = [acq_time, mw.dcm_data.PerformingPhysicianName, randstr]
987+
# Catch AttributeError if PerformingPhysicianName info is missing
988+
try:
989+
perfphys = mw.dcm_data.PerformingPhysicianName
990+
except AttributeError:
991+
perfphys = 'n/a'
992+
row = [acq_time, perfphys, randstr]
988993
# empty entries should be 'n/a'
989994
# https://github.com/dartmouth-pbs/heudiconv/issues/32
990995
row = ['n/a' if not str(e) else e for e in row]

0 commit comments

Comments
 (0)