def _replace_name(item, value, field, dicom): sex = dicom.get("PatientSex") sex = {"F": "Female", "M": "Male", "O": "Other", "": "Unk"}[sex] age = Deider._round_to_nearest(parse_AS_as_int(dicom.get("PatientAge")), 5) return f"{sex} {age:03d}Y {dicom.get('Modality')}"