Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
text = text.replace("<", "(")
text = text.replace(">", ")")
# Deidentify names
if names:
# First, based on the rules and lookup lists
text = annotate_names(text, patient_first_names, patient_initials,
patient_surname, patient_given_name)
# Then, based on the context
text = annotate_names_context(text)
# Flatten possible nested tags
if flatten:
text = flatten_text(text)
# Institutions
if institutions:
text = annotate_institution(text)
# Geographical locations
if locations:
text = annotate_residence(text)
text = annotate_address(text)
text = annotate_postalcode(text)
# Phone numbers
if phone_numbers:
text = annotate_phonenumber(text)