1234567891011121314151617181920212223242526272829303132333435363738394041 |
- import sys
- import os
- import json
- def main(parameterFile):
- fhome=os.path.expanduser('~')
- fsetup=os.path.join(fhome,'.labkey','setup.json')
- with open(fsetup) as f:
- setup=json.load(f)
- sys.path.append(setup['paths']['labkeyInterface'])
- import labkeyInterface
- import labkeyDatabaseBrowser
- net=labkeyInterface.labkeyInterface()
- fconfig=os.path.join(fhome,'.labkey','network.json')
- net.init(fconfig)
- with open(parameterFile) as f:
- pars=json.load(f)
-
- id=net.getUserId()
- print('User id: {}'.format(id))
- db=labkeyDatabaseBrowser.labkeyDB(net)
- fv={'PatientId':'NIX-LJU-D2002-IRAE-A011',
- 'visitCode':'VISIT_0',
- 'ModifiedBy':str(id)}
- fv={'ModifiedBy':str(id)}
- filters=[{'variable':v,'value':fv[v],'oper':'eq'} for v in fv]
- ds=db.selectRows(pars['project'],pars['schemaName'],pars['queryName'],filters)
-
- for r in ds['rows']:
- print(r)
- print('here')
- return 0
- if __name__=="__main__":
- main(sys.argv[1])
|