.
This commit is contained in:
+6
-1
@@ -154,7 +154,12 @@ def import_dicoms_helper(request, case_id: int | None = None):
|
|||||||
|
|
||||||
series_list = []
|
series_list = []
|
||||||
for series_uid in data:
|
for series_uid in data:
|
||||||
modality = get_object_or_404(Modality, short_code=tags["Modality"])
|
try:
|
||||||
|
modality = Modality.objects.get(short_code=tags["Modality"])
|
||||||
|
except Modality.DoesNotExist:
|
||||||
|
modality = Modality.objects.create(short_code=tags["Modality"], modality=tags["Modality"])
|
||||||
|
|
||||||
|
|
||||||
tags = data[series_uid][0][1]
|
tags = data[series_uid][0][1]
|
||||||
|
|
||||||
# Check if series with the id already exists (in which case we just add to htat)
|
# Check if series with the id already exists (in which case we just add to htat)
|
||||||
|
|||||||
@@ -1378,6 +1378,11 @@ class UncategorisedDicom(models.Model):
|
|||||||
def get_series(self):
|
def get_series(self):
|
||||||
return self.series
|
return self.series
|
||||||
|
|
||||||
|
def get_dicom_url(self):
|
||||||
|
return f"{REMOTE_URL}self.image.url"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class DuplicateDicom(Exception):
|
class DuplicateDicom(Exception):
|
||||||
def __init__(self, duplicate):
|
def __init__(self, duplicate):
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
<h2>SeriesInstanceUID: {{series_id}}</h2>
|
<h2>SeriesInstanceUID: {{series_id}}</h2>
|
||||||
|
|
||||||
|
|
||||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="[{% for dicom in dicoms %}"{{dicom.image.url}}"
|
<div id="single-dicom-viewer" class="dicom-viewer" data-images="[{% for dicom in dicoms %}"{{dicom.get_dicom_url}}"
|
||||||
{% if not forloop.last %},{% endif %}{% endfor %}]" data-annotations=''>
|
{% if not forloop.last %},{% endif %}{% endfor %}]" data-annotations=''>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@@ -17,10 +17,10 @@
|
|||||||
</summary>
|
</summary>
|
||||||
{% for dicom in dicoms %}
|
{% for dicom in dicoms %}
|
||||||
{% if dicom.image %}
|
{% if dicom.image %}
|
||||||
[{{image.image.size|filesizeformat}}]
|
[{{dicom.image.size|filesizeformat}}]
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{{image.image_md5_hash}} ({{image.is_dicom}})
|
{% comment %} {{dicom.image_md5_hash}} ({{dicom.is_dicom}}) {% endcomment %}
|
||||||
|
|
||||||
<br />
|
<br />
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1735,7 +1735,7 @@ class ExamCollection(models.Model, AuthorMixin):
|
|||||||
)
|
)
|
||||||
|
|
||||||
def __str__(self):
|
def __str__(self):
|
||||||
if self.date is not None and self.date is not "":
|
if self.date is not None and self.date != "":
|
||||||
return f"{self.name} [{self.date}]"
|
return f"{self.name} [{self.date}]"
|
||||||
else:
|
else:
|
||||||
return f"{self.name}"
|
return f"{self.name}"
|
||||||
|
|||||||
Reference in New Issue
Block a user