cladteam / CCDA_OMOP_by_Python

2 stars 3 forks source link

Weekly Monday Morning Error Report 9/16/2024 #99

Open chrisroederucdenver opened 2 months ago

chrisroederucdenver commented 2 months ago

Check and summarize errors on last run in CCDA_OMOP_by_Pthon

chrisroederucdenver commented 1 month ago

2024-09-30 from Foundry Workspace

Summary

Details

AdamLeeIT commented 1 month ago

@chrisroederucdenver does the metadata.py default': (0,'default') resolve the race_concept_id NULL problems?

    'race_concept_id':{
        'config_type': 'DERIVED',
        'FUNCTION': VT.map_hl7_to_omop_concept_id,
        'argument_names': {
            'concept_code': 'race_concept_code',
            'vocabulary_oid': 'race_concept_codeSystem',
            **'default': (0,'default')**
        }
chrisroederucdenver commented 1 month ago

"does" or "should"? The first question is answered by looking at the output, which shows the problem, and the code that was run to get that, which has the default config in it. Since it's not running right, it doesn't seem to resolve the issue. You should be able to check this for yourself. Give it a shot, happy to review and discuss.

The second seems reasonable, I have to read the code to verify.

from value_transformations.py `def _map_to_omop_concept_row(vocabulary_oid, concept_code, default): """ """ try: concept_id_df = concept_df[(concept_df['oid'] == vocabulary_oid) & (concept_df['concept_code'] == concept_code)]

    if len(concept_id_df) < 1:
       logger.error(f"no concept for \"{vocabulary_oid}\" \"{concept_code}\" ")
       return default

    if len(concept_id_df) > 1:
       logger.warning(f"more than one  concept for \"{vocabulary_oid}\" \"{concept_code}\", chose the first")
       return default

    return concept_id_df
except IndexError as e:
    logger.warning(f"no concept for \"{vocabulary_oid}\" \"{concept_code}\" type:{type(e)}")
    return default

def map_hl7_to_omop_concept_id(args_dict): """ expects: vocabulary_oid, concept_code """ return int(_map_to_omop_concept_row(args_dict['vocabulary_oid'], args_dict['concept_code'], args_dict['default'])\ ['concept_id'].iloc[0]) `

It looks like that was the intent. Not sure why it's not working. Still a problem.

chrisroederucdenver commented 1 month ago

116 fixed some bugs in the above code and will make next week's analysis look better with regard to race and ethnicity.