diff --git a/atlas/models.py b/atlas/models.py index f64f7230..6737dc51 100644 --- a/atlas/models.py +++ b/atlas/models.py @@ -2802,6 +2802,7 @@ class UncategorisedDicom(models.Model): "SliceThickness", "SeriesNumber", "StudyDate", + "PatientID", ) tags = {} diff --git a/atlas/templates/atlas/user_uploads.html b/atlas/templates/atlas/user_uploads.html index d7ef461a..3a60f32f 100644 --- a/atlas/templates/atlas/user_uploads.html +++ b/atlas/templates/atlas/user_uploads.html @@ -17,7 +17,97 @@ {% if series_list %}
- {% if grouped_series %} + {% if grouped_patients %} + {% for patient in grouped_patients %} +
+
+ + + Patient ID: {{ patient.patient_id }} + +
+ + +
+
+ + {% for study_uid, study in patient.studies %} +
+ + {{ study.description|default:"(no description)" }} + ({{ study_uid }}) — {{ study.series|length }} series + + + + + + {% if study.partial_imported_uids %} +
+
+ Partial import detected: + {{ study.partial_imported_count }} series in this study already exist. + The highlighted rows can finish importing the remaining images. + {% if study.matched_existing_series %} +
+ Existing series in Atlas: + {% for existing_series in study.matched_existing_series %} + {{ existing_series }}{% if not forloop.last %}, {% endif %} + {% endfor %} +
+ {% endif %} +
+ +
+ {% endif %} + {% if study.import_suggestions %} +
+ Study already imported: + {% for suggestion in study.import_suggestions %} +
+ + Case: + {{ suggestion.case }} + ({{ suggestion.already_imported_count }} series already imported) + + +
+ {% endfor %} +
+ {% endif %} +
    + {% for series, n, tags, date in study.series %} + {% if series in study.partial_imported_uids %} + {% if case %} + {% include 'atlas/partials/_series_item.html' with show_tags_link=True series_is_partial=True series_item_classes='series-item--partial-import' import_case_id=case.pk %} + {% else %} + {% include 'atlas/partials/_series_item.html' with show_tags_link=True series_is_partial=True series_item_classes='series-item--partial-import' import_case_id=study.preferred_case_id %} + {% endif %} + {% else %} + {% if case %} + {% include 'atlas/partials/_series_item.html' with show_tags_link=True series_is_partial=False series_item_classes='' import_case_id=case.pk %} + {% else %} + {% include 'atlas/partials/_series_item.html' with show_tags_link=True series_is_partial=False series_item_classes='' %} + {% endif %} + {% endif %} + {% endfor %} +
+
+ {% endfor %} +
+ {% endfor %} + {% elif grouped_series %} {% for study_uid, study in grouped_series %}
@@ -233,7 +323,7 @@
-