# 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
# Copyright 2021 Google Health Research.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python3
"""Defining some masks' names and utils."""


# Names of component masks available to tasks.
# Masks intervals for patient history based on labels set for censoring during
# preprocessing.
INTERVAL_MASK = "interval_mask"
# Masks entire patients based on labels set for censoring during preprocessing.
PATIENT_MASK = "patient_mask"

UNKNOWN_LOOKAHEAD_MASK = "unknown_lookahead_mask"
IGNORE_MASK = "ignore_mask"
PADDED_EVENT_MASK = "padded_event_mask"
SINCE_EVENT_TRAIN_MASK = "since_event_train_mask"
SINCE_EVENT_EVAL_MASK = "since_event_eval_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

# Copyright 2021 Google Health Research.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# Lint as: python3
"""Defining some masks' names and utils."""


# Names of component masks available to tasks.
# Masks intervals for patient history based on labels set for censoring during
# preprocessing.
INTERVAL_MASK = "interval_mask"
# Masks entire patients based on labels set for censoring during preprocessing.
PATIENT_MASK = "patient_mask"

UNKNOWN_LOOKAHEAD_MASK = "unknown_lookahead_mask"
IGNORE_MASK = "ignore_mask"
PADDED_EVENT_MASK = "padded_event_mask"
SINCE_EVENT_TRAIN_MASK = "since_event_train_mask"
SINCE_EVENT_EVAL_MASK = "since_event_eval_mask"

AT_DISCHARGE_MASK = label_utils.DISCHARGE_LABEL