main_18.py 283 B

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