Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug fixes for the MoH model #14

Merged
merged 8 commits into from
Jun 15, 2023
Merged

Bug fixes for the MoH model #14

merged 8 commits into from
Jun 15, 2023

Conversation

daisieh
Copy link
Member

@daisieh daisieh commented Jun 14, 2023

  • fixed a bug in which something like primary_site.INDEX, which has no sub-objects and is just an array of strings, can be processed as that.
  • added the NONE option for indexed_on
  • added errors for when things don't work, esp when an index is missing.

@daisieh daisieh marked this pull request as draft June 14, 2023 20:31
@daisieh daisieh changed the title [WIP] Bug fixes for the MoH model Bug fixes for the MoH model Jun 14, 2023
@daisieh daisieh requested a review from kcranston June 14, 2023 20:32
@daisieh daisieh marked this pull request as ready for review June 14, 2023 20:33
@kcranston
Copy link
Member

AttributeError: module 'mappings' has no attribute 'indexed_on'

@daisieh
Copy link
Member Author

daisieh commented Jun 14, 2023

What line was this on? Can you use verbose mode?

@kcranston
Copy link
Member

kcranston commented Jun 14, 2023

Using the REDCAP data in clinical_ETL_data:

Mapping line primary_diagnoses.0
Evaluating {indexed_on(Primary Diagnosis_id)}
Traceback (most recent call last):
  File "/Users/karen/Documents/candig/repos/clinical_ETL_code/CSVConvert.py", line 592, in <module>
    main(parse_args())
  File "/Users/karen/Documents/candig/repos/clinical_ETL_code/CSVConvert.py", line 576, in main
    mcodepackets.append(map_row_to_mcodepacket(
                        ^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/karen/Documents/candig/repos/clinical_ETL_code/CSVConvert.py", line 196, in map_row_to_mcodepacket
    dict = map_row_to_mcodepacket(identifier, index_field, new_key, indexed_data, node[key], x)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/karen/Documents/candig/repos/clinical_ETL_code/CSVConvert.py", line 196, in map_row_to_mcodepacket
    dict = map_row_to_mcodepacket(identifier, index_field, new_key, indexed_data, node[key], x)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/karen/Documents/candig/repos/clinical_ETL_code/CSVConvert.py", line 170, in map_row_to_mcodepacket
    return eval_mapping(identifier, index_field, indexed_data, node, x)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/karen/Documents/candig/repos/clinical_ETL_code/CSVConvert.py", line 308, in eval_mapping
    return eval(f'module.{method}({data_values})')
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 1, in <module>
AttributeError: module 'mappings' has no attribute 'indexed_on'

@daisieh
Copy link
Member Author

daisieh commented Jun 14, 2023

That line has the old 0 instead of INDEX

@daisieh
Copy link
Member Author

daisieh commented Jun 14, 2023

You'll probably need to merge mappings onto the new template.

@kcranston
Copy link
Member

kcranston commented Jun 14, 2023

Do you have updates you can push to clinical_ETL_data? (hard to test if we aren't using the same data files)

@daisieh daisieh merged commit e10679d into main Jun 15, 2023
@daisieh daisieh deleted the daisieh/bug-fixes branch June 15, 2023 00:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants