This commit is contained in:
Ross
2021-02-05 09:59:04 +00:00
parent eeb5f50b09
commit 85b5b5d7ac
19 changed files with 245 additions and 205 deletions
+17 -40
View File
@@ -1,6 +1,5 @@
from django.db.models.fields.files import ImageField
from django.db.models.fields.related import ForeignKey
from anatomy.models import Modality
from django.db import models
from django.utils import timezone
import tagulous
@@ -20,6 +19,10 @@ from sortedm2m.fields import SortedManyToManyField
import string
from anatomy.models import Modality
from generic.models import Examination, Site, Condition, Sign
image_storage = FileSystemStorage(
# Physical file location ROOT
location=u"{0}/longs/".format(settings.MEDIA_ROOT),
@@ -32,31 +35,6 @@ def image_directory_path(instance, filename):
class Examination(models.Model):
examination = models.CharField(max_length=200)
def __str__(self):
return self.examination
class Meta:
ordering = ('examination', )
class Site(models.Model):
site = models.CharField(max_length=200)
initials = models.CharField(max_length=200)
def __str__(self):
return self.site
class Condition(tagulous.models.TagModel):
pass
class Sign(tagulous.models.TagModel):
pass
class Long(models.Model):
#author = models.ForeignKey('auth.User', on_delete=models.CASCADE)
#image = models.ImageField()
@@ -64,23 +42,23 @@ class Long(models.Model):
feedback = models.TextField(null=True, blank=True)
#condition = tagulous.models.TagField(
# to=Condition,
# blank=True,
# help_text=
# "Associated condition. Will allow searching / filtering and tips / hints to be displayed. Conditions with spaces must be enclosed in quotes \"...\""
#)
condition = tagulous.models.TagField(
to=Condition,
blank=True,
help_text=
"Associated condition. Will allow searching / filtering and tips / hints to be displayed. Conditions with spaces must be enclosed in quotes \"...\""
)
sign = models.CharField(max_length=255, blank=True)
#sign = tagulous.models.TagField(
# to=Sign, blank=True, help_text='Radiological signs in the question')
#sign = models.CharField(max_length=255, blank=True)
sign = tagulous.models.TagField(
to=Sign, blank=True, help_text='Radiological signs in the question')
# Model answers
model_observations = models.TextField(null=True, blank=True)
model_interpretation = models.TextField(null=True, blank=True)
model_principle_diagnosis = models.TextField(null=True, blank=True)
model_differential_diagnosis = models.TextField(null=True, blank=True)
model_further_management = models.TextField(null=True, blank=True)
model_management = models.TextField(null=True, blank=True)
DEFAULT_SITE_ID = 1
@@ -147,8 +125,8 @@ class LongSeriesImage(models.Model):
class LongSeries(models.Model):
modality = models.ForeignKey(Modality, related_name="series_modality", on_delete=models.SET_NULL, null=True)
examination = models.ForeignKey(
Examination, help_text="Name of the examination", on_delete=models.SET_NULL, null=True)
#examination = models.ForeignKey(
# Examination, help_text="Name of the examination", related_name="series_examination", on_delete=models.SET_NULL, null=True)
long = models.ForeignKey("Long", related_name="series", on_delete=models.SET_NULL, null=True)
description = models.TextField(blank=True, help_text="Description of stack, for admin organisation")
@@ -263,8 +241,7 @@ class CidUserAnswer(models.Model):
answer_interpretation = models.TextField(null=True, blank=True)
answer_principle_diagnosis = models.TextField(null=True, blank=True)
answer_differential_diagnosis = models.TextField(null=True, blank=True)
answer_further_management = models.TextField(null=True, blank=True)
answer_management = models.TextField(null=True, blank=True)
cid = models.BigIntegerField(blank=True, null=True, help_text="Candidate ID (limitied by BigIntegerField size)")