try adding series data to case table
This commit is contained in:
@@ -516,6 +516,14 @@ class Case(models.Model, AuthorMixin, QuestionMixin):
|
||||
def get_series(self):
|
||||
return self.series.all().prefetch_related("images", "examination", "plane")
|
||||
|
||||
def get_series_modalities(self) -> set:
|
||||
"""Returns a list of the modalities of the series in the case"""
|
||||
series = self.series.all()
|
||||
modalities = [s.modality.short_code for s in series if s.modality is not None]
|
||||
|
||||
return set(modalities)
|
||||
|
||||
|
||||
def get_total_series_images_size(self, refresh=False):
|
||||
if self.total_images_series_size is not None and not refresh:
|
||||
return self.total_images_series_size
|
||||
@@ -656,6 +664,11 @@ class Series(SeriesBase):
|
||||
series_instance_uid = models.CharField(max_length=255, blank=True, null=True)
|
||||
|
||||
# findings = models.TextField(null=True, blank=True, help_text="Findings on the series / stack")
|
||||
def __str__(self) -> str:
|
||||
if self.description:
|
||||
return self.description
|
||||
else:
|
||||
return f"{self.examination} ({self.plane})"
|
||||
|
||||
def get_full_str(self):
|
||||
if self.case:
|
||||
|
||||
Reference in New Issue
Block a user