|
|
@@ -325,11 +325,14 @@ def updateAndValidateEntry(e,pars):
|
|
|
|
|
|
def generateEntries(df,r,objFunc,pars):
|
|
|
idField=pars.get('idField','ParticipantId')
|
|
|
+ copyRows=pars.get('copyRows',{idField:None})
|
|
|
+
|
|
|
getId=objFunc['getId']
|
|
|
id=getId(df,r,pars)
|
|
|
- entry={}
|
|
|
- entry[idField]=id
|
|
|
- return [entry]
|
|
|
+#only use the first key from copyRows
|
|
|
+ c=list(copyRows.keys())[0]
|
|
|
+ ar=df.at[r,c].split(copyRows[c])
|
|
|
+ return [ {idField:id,c:x} for x in ar]
|
|
|
|
|
|
def setParsingObject(pars):
|
|
|
#updateAlias from pars
|
|
|
@@ -367,14 +370,20 @@ def setEntry(entry,df,r,objParse,objFunc,pMap,pars):
|
|
|
additionalVars=pars.get('additionalVars',{})
|
|
|
seqNumOffset=pars.get('seqNumOffset',0)
|
|
|
idField=pars.get('idField','ParticipantId')
|
|
|
+ copyRows=pars.get('copyRows',{})
|
|
|
|
|
|
modify=objFunc['modify']
|
|
|
convertLookup=objFunc['convertLookup']
|
|
|
updateAndValidateEntry=objFunc['updateAndValidateEntry']
|
|
|
|
|
|
eId=entry[idField]
|
|
|
+ rowsCopyColumn=list(copyRows.keys())
|
|
|
|
|
|
for v in df.columns:
|
|
|
+ qv=df.at[r,v]
|
|
|
+ if v in rowsCopyColumn:
|
|
|
+ qv=entry[v]
|
|
|
+ del entry[v]
|
|
|
qv=validate(df.at[r,v])
|
|
|
qv=modify(qv,v)
|
|
|
f=findAlias(v,objParse['alias'])
|