from pprint import pprint with open(f'/tmp/{project_name}_configs.json','r') as f: settings = json.load(f) delta_path = settings['delta_path'] pprint(settings)
{'artifact_location': 'dbfs:/databricks/mlflow-tracking/4233158071187382',
'base_path': '/home/jingting.lu@databricks.com/health-lakehouse',
'data_path': 's3://hls-eng-data-public/data/rwe/dbx-covid-sim/',
'delta_path': '/home/jingting.lu@databricks.com/health-lakehouse/psm/delta',
'experiment_id': '4233158071187382',
'experiment_name': '/Users/jingting.lu@databricks.com/psm',
'tags': {'mlflow.experiment.sourceName': '/Users/jingting.lu@databricks.com/psm',
'mlflow.experimentType': 'MLFLOW_EXPERIMENT',
'mlflow.ownerEmail': 'jingting.lu@databricks.com',
'mlflow.ownerId': '5215232244814299'}}
target_params = { # set the target drug med code 'target_med_code':20134224, # databrixovir # set the target drug name 'target_med_name':'databrixovir', # set the target event code 'target_event_code':840539006, # set the target event name 'target_event_name':'covid', # set the target outcome 'target_outcome' : 'admission', 'target_outcome_code': 1505002 }
delta_ehr=DeltaEHR(delta_path) delta_ehr.add_simple_cohort(cohort_name='covid',resource='conditions',inclusion_criteria=f"CODE=={target_params['target_event_code']}") delta_ehr.add_simple_cohort(cohort_name='admission',resource='encounters',inclusion_criteria=f"REASONCODE == {target_params['target_event_code']} AND CODE == {target_params['target_outcome_code']}") delta_ehr.add_simple_cohort(cohort_name='deceased',resource='patients',inclusion_criteria="DEATHDATE is not null",start_col='DEATHDATE',stop_col='DEATHDATE') target_cohort=delta_ehr.cohorts['covid']
You may find this series of notebooks at https://github.com/databricks-industry-solutions/psm. For more information about this solution accelerator, visit https://www.databricks.com/blog/2020/10/20/detecting-at-risk-patients-with-real-world-data.html.