def __init__(self, oclenv='', oclapitoken='', run_ocl_offline=False, verbosity=0, cache_intermediate=True): DatimShow.__init__(self) self.oclenv = oclenv self.oclapitoken = oclapitoken self.run_ocl_offline = run_ocl_offline self.verbosity = verbosity self.cache_intermediate = cache_intermediate self.oclapiheaders = { 'Authorization': 'Token ' + self.oclapitoken, 'Content-Type': 'application/json' }
'code': c['id'], 'uid': c['external_id'], 'partner': c['extras']['Partner'], 'primeid': c['extras']['Prime Id'], 'agency': c['extras']['Agency'], 'ou': c['extras']['Organizational Unit'], 'startdate': c['extras']['Start Date'], 'enddate': c['extras']['End Date'], } return None # Default Script Settings verbosity = 0 # 0=none, 1=some, 2=all run_ocl_offline = False # Set to true to use local copies of dhis2/ocl exports export_format = DatimShow.DATIM_FORMAT_HTML repo_id = 'Mechanisms' # This one is hard-coded # JetStream Staging user=datim-admin oclenv = 'https://api.staging.openconceptlab.org' oclapitoken = 'c3b42623c04c87e266d12ae0e297abbce7f1cbe8' # Set arguments from the command line if sys.argv and len(sys.argv) > 1: export_format = DatimShow.get_format_from_string(sys.argv[1]) # Create Show object and run datim_show = DatimShowMechanisms( oclenv=oclenv, oclapitoken=oclapitoken, run_ocl_offline=run_ocl_offline, verbosity=verbosity) datim_show.get(export_format=export_format, repo_id=repo_id)