# Path: ehr_prediction_modeling/utils/label_utils.py
# ADVERSE_OUTCOME_IN_ADMISSION = "adverse_outcome_in_admission"
# MORTALITY_IN_ADMISSION_LABEL = "mortality_in_admission"
# MORTALITY_LOOKAHEAD_LABEL_BASE = "mortality_in"
# READMISSION_LABEL_BASE = "readmission_within"
# TIME_UNTIL_NEXT_ADMISSION = "time_until_next_admission"
# SEGMENT_LABEL = "segment_mask"
# CENSORED_PATIENT_LABEL = "patient_mask"
# LAB_LOOKAHEAD_REGEX_BASE = r"lab_[0-9]+_value_within"
# LOS_LABEL = "length_of_stay"
# TIMESTAMP_KEY = "timestamp"
# TSA_LABEL = "time_since_admission"
# IGNORE_LABEL = "ignore_label"
# TOD_LABEL = "time_of_day_label"
# DISCHARGE_LABEL = "discharge_label"
# DEFAULT_LOOKAHEAD_WINDOWS = [6, 12, 18, 24, 36, 48, 60, 72]
# def get_lab_label_lookahead_key(lab_number: str,
#                                 time_window_hours: int,
#                                 suffix=None) -> str:
# def get_adverse_outcome_lookahead_label_key(time_window_hours: int) -> str:
# def get_readmission_label_keys(time_windows: List[int]) -> List[str]:


import re
import tensorflow.compat.v1 as tf
from typing import Dict, List, Tuple, Union
from ehr_prediction_modeling.utils import label_utils
    eval_masks: List[str],
    all_supported_masks: Dict[str, List[str]],
    time_since_event_label_key=label_utils.TSA_LABEL,
) -> LabelDicts:
  """Gets label dictionary required for masks from the context and sequence.

  Args:
    train_mask: Train masks to fetch labels for.
    eval_masks: Eval masks to fetch labels for.
    all_supported_masks: Mapping of composite masks to components for the task.
    time_since_event_label_key: The numerical label key which measures the time
      since the relevant event. By default this key is time since admission.
    min_aki_level: int, Only used for AKI task.

  Returns:
    context_d: Dictionaries of TF features to read in context.
    sequence_d: Dictionaries of TF features to read in sequence.
  """
  context_d = {}
  sequence_d = {}
  required_masks = []


  for mask_name in eval_masks + [train_mask]:
    required_masks.extend(all_supported_masks[mask_name])

  sequence_int_feature_labels = {
      INTERVAL_MASK:
          label_utils.SEGMENT_LABEL,
      IGNORE_MASK:

# Path: ehr_prediction_modeling/utils/label_utils.py
# ADVERSE_OUTCOME_IN_ADMISSION = "adverse_outcome_in_admission"
# MORTALITY_IN_ADMISSION_LABEL = "mortality_in_admission"
# MORTALITY_LOOKAHEAD_LABEL_BASE = "mortality_in"
# READMISSION_LABEL_BASE = "readmission_within"
# TIME_UNTIL_NEXT_ADMISSION = "time_until_next_admission"
# SEGMENT_LABEL = "segment_mask"
# CENSORED_PATIENT_LABEL = "patient_mask"
# LAB_LOOKAHEAD_REGEX_BASE = r"lab_[0-9]+_value_within"
# LOS_LABEL = "length_of_stay"
# TIMESTAMP_KEY = "timestamp"
# TSA_LABEL = "time_since_admission"
# IGNORE_LABEL = "ignore_label"
# TOD_LABEL = "time_of_day_label"
# DISCHARGE_LABEL = "discharge_label"
# DEFAULT_LOOKAHEAD_WINDOWS = [6, 12, 18, 24, 36, 48, 60, 72]
# def get_lab_label_lookahead_key(lab_number: str,
#                                 time_window_hours: int,
#                                 suffix=None) -> str:
# def get_adverse_outcome_lookahead_label_key(time_window_hours: int) -> str:
# def get_readmission_label_keys(time_windows: List[int]) -> List[str]:


# Path: ehr_prediction_modeling/utils/mask_utils.py
import re
import tensorflow.compat.v1 as tf
from typing import Dict, List, Tuple, Union
from ehr_prediction_modeling.utils import label_utils

    eval_masks: List[str],
    all_supported_masks: Dict[str, List[str]],
    time_since_event_label_key=label_utils.TSA_LABEL,
) -> LabelDicts:
  """Gets label dictionary required for masks from the context and sequence.

  Args:
    train_mask: Train masks to fetch labels for.
    eval_masks: Eval masks to fetch labels for.
    all_supported_masks: Mapping of composite masks to components for the task.
    time_since_event_label_key: The numerical label key which measures the time
      since the relevant event. By default this key is time since admission.
    min_aki_level: int, Only used for AKI task.

  Returns:
    context_d: Dictionaries of TF features to read in context.
    sequence_d: Dictionaries of TF features to read in sequence.
  """
  context_d = {}
  sequence_d = {}
  required_masks = []


  for mask_name in eval_masks + [train_mask]:
    required_masks.extend(all_supported_masks[mask_name])

  sequence_int_feature_labels = {
      INTERVAL_MASK:
          label_utils.SEGMENT_LABEL,
      IGNORE_MASK:

          label_utils.IGNORE_LABEL,