From 3f68a98abda2db4a3aaf50d56d8a919edbceb3e7 Mon Sep 17 00:00:00 2001 From: Ross Date: Tue, 13 Feb 2024 14:55:17 +0000 Subject: [PATCH] . --- atlas/models.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/atlas/models.py b/atlas/models.py index b17a5511..8b746ab2 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -388,18 +388,22 @@ class Case(models.Model, AuthorMixin): examinations = [series.get_examination() for series in self.series.all()] return f"{self.pk}:{self.title} {'/'.join([str(c) for c in self.condition.all()])} [{', '.join(examinations)}]" - def get_case_dicom_json(self): + def get_case_dicom_json(self, case_title_as_patient_name = True): series_json = [] for series in self.series.all(): series_json.append(series.get_series_dicom_json()) + patient_name = "" + if case_title_as_patient_name: + patient_name = self.title + return { "studies": [ { "StudyInstanceUID": "1.3.6.1.4.1.14519.5.2.1.6279.6001.298806137288633453246975630178", "StudyDate": "20000101", "StudyTime": "", - "PatientName": "", + "PatientName": patient_name, "PatientID": "LIDC-IDRI-0001", "AccessionNumber": "", "PatientAge": "",