furher shorts improvements

This commit is contained in:
Ross
2025-04-07 11:34:10 +01:00
parent afa1379ce4
commit d387e32777
16 changed files with 795 additions and 111 deletions
+2 -12
View File
@@ -52,6 +52,7 @@ from generic.models import (
Examination,
# Condition,
ExamBase,
FindingBase,
Plane,
Contrast,
QuestionNote,
@@ -600,29 +601,18 @@ class SeriesImage(SeriesImageBase):
# }}
class SeriesFinding(models.Model):
class SeriesFinding(FindingBase):
series = models.ForeignKey(
"Series", related_name="findings", on_delete=models.SET_NULL, null=True
)
description = models.TextField(
null=True, blank=True, help_text="Findings on the series / stack"
)
findings = models.ManyToManyField(Finding, blank=True)
structures = models.ManyToManyField(Structure, blank=True)
conditions = models.ManyToManyField(Condition, blank=True)
annotation_json = models.TextField(null=True, blank=True)
viewport_json = models.TextField(null=True, blank=True)
# This has been migrated to install the image id (not index)
current_image_id_index = models.TextField(null=True, blank=True)
def __str__(self) -> str:
findings = self.findings.all().values_list("name")
return f"SeriesFinding: {self.series.id}/{findings}/{self.description}"
def annotation_as_string(self) -> str:
return json.dumps(self.annotation_json)
@reversion.register
class Series(SeriesBase):
modality = models.ForeignKey(