Skip to content

Commit

Permalink
API Call Relocation for Optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
rdziewietin committed Jul 1, 2024
1 parent d6f47d4 commit e7397a0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/msfocr/docTR/ocr_functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,13 +168,13 @@ def generate_key_value_pairs(table):
columns = table.columns
for row_index in range(table_array.shape[0]):
data_element = table_array[row_index][0]
data_element_id = data_upload_DHIS2.getAllUIDs('dataElements', [data_element], **st.secrets.dhis2_credentials)
print(data_element, data_element_id)
# print(data_element, data_element_id)
for col_index in range(1, table_array.shape[1]):
category = columns[col_index]
category_id = data_upload_DHIS2.getAllUIDs('categoryOptions', [category], **st.secrets.dhis2_credentials)
cell_value = table_array[row_index][col_index]
if cell_value is not None:
data_element_id = data_upload_DHIS2.getAllUIDs('dataElements', [data_element], **st.secrets.dhis2_credentials)
category_id = data_upload_DHIS2.getAllUIDs('categoryOptions', [category], **st.secrets.dhis2_credentials)
data_element_pairs.append({ 'dataElement': data_element_id,
'categoryOptions': category_id,
'value': cell_value})
Expand Down

0 comments on commit e7397a0

Please sign in to comment.