Skip to content

Commit 5b1670c

Browse files
authored
fixed the bug in filtering out the records from specific domains e.g. measurement (#110)
1 parent 6683510 commit 5b1670c

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/cehrbert/data_generators/hf_data_generator/meds_utils.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ def create_dataset_from_meds_reader(
181181
dataset_mappings: Optional[List[DatasetMapping]] = None,
182182
cache_file_collector: Optional[CacheFileCollector] = None,
183183
) -> DatasetDict:
184+
184185
LOG.info("The meds_to_cehrbert_conversion_type: %s", data_args.meds_to_cehrbert_conversion_type)
185186
LOG.info("The att_function_type: %s", data_args.att_function_type)
186187
LOG.info("The inpatient_att_function_type: %s", data_args.inpatient_att_function_type)
@@ -307,6 +308,7 @@ def _create_cehrbert_data_from_meds(
307308
path_to_db=os.path.expanduser(data_args.data_folder),
308309
default_visit_id=default_visit_id,
309310
meds_to_cehrbert_conversion_type=data_args.meds_to_cehrbert_conversion_type,
311+
meds_exclude_tables=data_args.meds_exclude_tables,
310312
disconnect_problem_list_events=data_args.disconnect_problem_list_events,
311313
)
312314
dataset = Dataset.from_generator(

tests/integration_tests/runners/hf_cehrbert_pretrain_runner_meds_test.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,11 @@
77

88
from datasets import disable_caching
99

10+
from cehrbert.data_generators.hf_data_generator.meds_to_cehrbert_conversion_rules.meds_to_cehrbert_omop import (
11+
MedsToCehrbertOMOP,
12+
)
1013
from cehrbert.runners.hf_cehrbert_pretrain_runner import main
14+
from cehrbert.runners.hf_runner_argument_dataclass import MedsToCehrBertConversionType
1115

1216
disable_caching()
1317
os.environ["CUDA_VISIBLE_DEVICES"] = ""
@@ -49,6 +53,12 @@ def setUp(self):
4953
"true",
5054
"--report_to",
5155
"none",
56+
"--disconnect_problem_list_events",
57+
"true",
58+
"--meds_exclude_tables",
59+
"condition",
60+
"--meds_to_cehrbert_conversion_type",
61+
"MedsToCehrBertConversionType.MedsToCehrbertOMOP",
5262
]
5363

5464
def tearDown(self):

0 commit comments

Comments
 (0)