Skip to content

Commit

Permalink
Updated init scripts for python3 & FY22 cycle
Browse files Browse the repository at this point in the history
  • Loading branch information
paynejd committed Jun 8, 2022
1 parent d45ca0f commit 5b46477
Show file tree
Hide file tree
Showing 8 changed files with 1,787 additions and 27 deletions.
8 changes: 0 additions & 8 deletions common.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,10 @@
APP_VERSION = '0.1.0'
OCL_ENVIRONMENTS = {
'qa': 'https://api.qa.openconceptlab.org',
'qa-v1': 'https://api.qa.v1.openconceptlab.org',
'qa-aws': 'https://api.qa.aws.openconceptlab.org',
'dev': 'https://api.dev.openconceptlab.org',
'staging': 'https://api.staging.openconceptlab.org',
'staging-v1': 'https://api.staging.v1.openconceptlab.org',
'staging-aws': 'https://api.staging.aws.openconceptlab.org',
'production': 'https://api.openconceptlab.org',
'production-v1': 'https://api.v1.openconceptlab.org',
'production-aws': 'https://api.aws.openconceptlab.org',
'demo': 'https://api.demo.openconceptlab.org',
'demo-v1': 'https://api.demo.v1.openconceptlab.org',
'demo-aws': 'https://api.demo.aws.openconceptlab.org',
}


Expand Down
60 changes: 60 additions & 0 deletions datim/datimconstants.py
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,66 @@ class DatimConstants(object):
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-DAA-FY21/'},
'DAA-FY22': {
'title': 'MER Results: MOH Facility Based FY22',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-DAA-FY22/'},
'DAA-FY22Q1': {
'title': 'MER Results: MOH Facility Based FY22Q1',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-DAA-FY22Q1/'},
'DAA-FY22Q2': {
'title': 'MER Results: MOH Facility Based FY22Q2',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-DAA-FY22Q2/'},
'DAA-FY22Q3': {
'title': 'MER Results: MOH Facility Based FY22Q3',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-DAA-FY22Q3/'},
'DAA-FY22Q4': {
'title': 'MER Results: MOH Facility Based FY22Q4',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-DAA-FY22Q4/'},
'CS-FY22': {
'title': 'MER Results: CS Facility Based FY22',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-CS-FY22/'},
'CS-FY22Q1': {
'title': 'MER Results: CS Facility Based FY22Q1',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-CS-FY22Q1/'},
'CS-FY22Q2': {
'title': 'MER Results: CS Facility Based FY22Q2',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-CS-FY22Q2/'},
'CS-FY22Q3': {
'title': 'MER Results: CS Facility Based FY22Q3',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-CS-FY22Q3/'},
'CS-FY22Q4': {
'title': 'MER Results: CS Facility Based FY22Q4',
'import_batch': IMPORT_BATCH_MOH_FY20,
'show_build_row_method': 'build_moh_indicator_output',
'show_headers_key': 'moh',
'endpoint': '/orgs/PEPFAR/sources/DATIM-MOH-CS-FY22Q4/'},
}

# MOH FY18 OCL Export Definitions
Expand Down
2 changes: 1 addition & 1 deletion datim/datimshow.py
Original file line number Diff line number Diff line change
Expand Up @@ -278,7 +278,7 @@ def get(self, repo_id='', export_format=''):
self.vlog(1, '**** STEP 3 of 4: Cache the intermediate output')
if self.cache_intermediate:
filename = self.endpoint2filename_ocl_export_intermediate_json(repo_endpoint)
with open(self.attach_absolute_data_path(filename), 'wb') as output_file:
with open(self.attach_absolute_data_path(filename), 'w') as output_file:
output_file.write(json.dumps(intermediate))
self.vlog(1, 'Processed OCL export saved to "%s"' % filename)
else:
Expand Down
8 changes: 5 additions & 3 deletions importinit.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
Tiered Site Support
"""
import ocldev.oclresourcelist

import ocldev.oclfleximporter
import settings

# Edit this list to import the files that you need
Expand All @@ -27,15 +27,17 @@
'init/datim_moh_fy20.json',
'init/datim_moh_fy21_cs.json',
'init/datim_moh_fy21_daa.json',
'init/datim_moh_fy22_daa.json',
'init/datim_moh_fy22q1_daa.json',
]
IMPORT_FILENAMES = IMPORT_FILENAMES_ALL

# OCL Settings
VERBOSE = False
DO_BULK_IMPORT = True
DO_WAIT_UNTIL_IMPORT_COMPLETE = True
OCL_API_URL_ROOT = settings.ocl_api_url_qa
OCL_API_TOKEN = settings.api_token_qa_datim_admin
OCL_API_URL_ROOT = settings.ocl_api_url_staging
OCL_API_TOKEN = settings.api_token_staging_datim_admin

# Build a combined resource list
resource_list = ocldev.oclresourcelist.OclJsonResourceList()
Expand Down
Loading

0 comments on commit 5b46477

Please sign in to comment.