pyhealth.tasks.MIMIC3ICD9Coding#

class pyhealth.tasks.medical_coding.MIMIC3ICD9Coding(code_mapping=None)[source]#

Bases: BaseTask

Medical coding task for MIMIC-III using ICD-9 codes.

This task uses clinical notes to predict ICD-9 codes for a patient.

Parameters:
  • task_name – Name of the task

  • input_schema – Definition of the input data schema

  • output_schema – Definition of the output data schema

Examples

>>> from pyhealth.datasets import MIMIC3Dataset
>>> from pyhealth.tasks import MIMIC3ICD9Coding
>>> dataset = MIMIC3Dataset(
...     root="/path/to/mimic-iii/1.4",
...     tables=["diagnoses_icd", "procedures_icd", "noteevents"],
... )
>>> task = MIMIC3ICD9Coding()
>>> samples = dataset.set_task(task)
task_name: str = 'mimic3_icd9_coding'#
input_schema: Dict[str, Union[str, Type]] = {'text': <class 'pyhealth.processors.text_processor.TextProcessor'>}#
output_schema: Dict[str, Union[str, Type]] = {'icd_codes': <class 'pyhealth.processors.label_processor.MultiLabelProcessor'>}#
pre_filter(df)[source]#
Return type:

LazyFrame