From c90eca02d4f6a5b0245f515fd2a16bca88272747 Mon Sep 17 00:00:00 2001 From: David Brownlee Date: Mon, 19 Feb 2024 10:44:00 -0500 Subject: [PATCH] Updte sample_inputs to work as standalone (not imported library). --- sample_inputs/new_cohort.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/sample_inputs/new_cohort.py b/sample_inputs/new_cohort.py index 13a00ed..ef8b5e5 100644 --- a/sample_inputs/new_cohort.py +++ b/sample_inputs/new_cohort.py @@ -1,5 +1,12 @@ -## Additional mappings customised to my special cohort +import os +import sys +# Include src/ directory in the module search path. +current_dir = os.path.dirname(os.path.abspath(__file__)) +parent_dir = os.path.dirname(current_dir) +sys.path.append(os.sep.join([parent_dir, "src"])) +import clinical_etl.mappings +## Additional mappings customised to my special cohort def sex(data_value): # make sure we only have one value mapping_val = mappings.single_val(data_value)