|
@@ -409,21 +409,21 @@ def importData(pars,filename,getId=getId,modify=modify,\
|
|
#delete previous incarnations
|
|
#delete previous incarnations
|
|
loadSafely(pars,entries,dryRun=dryRun)
|
|
loadSafely(pars,entries,dryRun=dryRun)
|
|
|
|
|
|
-def loadSafely(pars,entries,keyColumn=None,dryRun=True):
|
|
|
|
|
|
+def loadSafely(pars,entries,dryRun=True):
|
|
#allow additional keys in keyColumn
|
|
#allow additional keys in keyColumn
|
|
|
|
|
|
db=getDB(pars)
|
|
db=getDB(pars)
|
|
project=pars.get('project','DCIS/Study')
|
|
project=pars.get('project','DCIS/Study')
|
|
schema=pars.get('schema','demographics')
|
|
schema=pars.get('schema','demographics')
|
|
query=pars.get('query','demographics')
|
|
query=pars.get('query','demographics')
|
|
|
|
+ matchColumns=pars.get('matchColumns',[])
|
|
|
|
|
|
updateRows=[]
|
|
updateRows=[]
|
|
insertRows=[]
|
|
insertRows=[]
|
|
|
|
|
|
|
|
|
|
selVal=['ParticipantId','SequenceNum']
|
|
selVal=['ParticipantId','SequenceNum']
|
|
- if keyColumn:
|
|
|
|
- selVal.append(keyColumn)
|
|
|
|
|
|
+ selVal.extend(matchColumns)
|
|
|
|
|
|
for entry in entries:
|
|
for entry in entries:
|
|
|
|
|