def _populate_telecom_fields(segment: Segment, personal_telecom: str, work_telecom: str, telecom_list) -> None: for telecom in telecom_list: telecom_type = telecom.get("use", "") telecom_value = telecom.get("value", "") if telecom_type in ["home", "temp", "old", "mobile", ""]: telecom = personal_telecom else: telecom = work_telecom if telecom_value: telecom_field = Field(telecom) telecom_field.XTN_2 = _get_telecom_use_code(telecom_type) telecom_field.XTN_12 = telecom_value segment.add(telecom_field)