|
@@ -1,3 +1,6 @@
|
|
|
+#scans orthanc database and updates Demographics datataset and
|
|
|
+#series list in project Imaging dataset
|
|
|
+
|
|
|
import os
|
|
|
import json
|
|
|
import re
|
|
@@ -5,11 +8,16 @@ import sys
|
|
|
|
|
|
|
|
|
fhome=os.path.expanduser('~')
|
|
|
-sys.path.insert(1,fhome+'/software/src/labkeyInterface')
|
|
|
+fsetup=os.path.join(fhome,'.labkey','setup.json')
|
|
|
+
|
|
|
+with open(fsetup,'r') as f:
|
|
|
+ setup=json.load(f)
|
|
|
+
|
|
|
+sys.path.insert(0,setup['paths']['labkeyInterface'])
|
|
|
import labkeyInterface
|
|
|
import labkeyDatabaseBrowser
|
|
|
|
|
|
-sys.path.insert(1,fhome+'/software/src/orthancInterface')
|
|
|
+sys.path.insert(0,setup['paths']['orthancInterface'])
|
|
|
import orthancInterface
|
|
|
import orthancDatabaseBrowser
|
|
|
|
|
@@ -49,12 +57,15 @@ for p in patients:
|
|
|
row['PatientName']=dicom['PatientName']
|
|
|
except KeyError:
|
|
|
pass
|
|
|
+
|
|
|
+
|
|
|
row['OrthancId']=p
|
|
|
db.modifyRows('insert',project,'study','Demographics',[row])
|
|
|
|
|
|
for s in pdata['Studies']:
|
|
|
sdata=odb.getStudyData(s)
|
|
|
sdicom=sdata['MainDicomTags']
|
|
|
+
|
|
|
sdate='19700101'
|
|
|
try:
|
|
|
sid=sdicom['StudyInstanceUID']
|