add basic (user) history for collections
This commit is contained in:
@@ -555,6 +555,14 @@ class SeriesImage(SeriesImageBase):
|
||||
help_text="Reference to the object that has replaced this one.",
|
||||
)
|
||||
|
||||
def get_file_size(self):
|
||||
try:
|
||||
return self.image.size
|
||||
|
||||
# We catch this for when the image does not exist
|
||||
except FileNotFoundError:
|
||||
return 0
|
||||
|
||||
def get_dicom_data(self):
|
||||
try:
|
||||
with pydicom.dcmread(self.image) as d:
|
||||
@@ -1066,6 +1074,13 @@ class CaseDetail(models.Model):
|
||||
"""Returns the correct question answers as a json string"""
|
||||
return json.dumps(self.question_answers)
|
||||
|
||||
def get_user_answers(self, user):
|
||||
"""Returns the users answers as a json string"""
|
||||
try:
|
||||
return UserReportAnswer.objects.get(question=self, user=user)
|
||||
except UserReportAnswer.DoesNotExist:
|
||||
return None
|
||||
|
||||
class CasePrior(models.Model):
|
||||
case_detail = models.ForeignKey(CaseDetail, on_delete=models.CASCADE)
|
||||
prior_case = models.ForeignKey(Case, on_delete=models.CASCADE, related_name="prior_case")
|
||||
|
||||
Reference in New Issue
Block a user