This commit is contained in:
Ross
2022-04-08 23:57:24 +01:00
parent 6efb72ddec
commit 1b6cb4f63a
5 changed files with 142 additions and 18 deletions
@@ -0,0 +1,43 @@
# Generated by Django 3.2.4 on 2022-04-08 22:55
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('atlas', '0037_cidreportanswer_feedback'),
]
operations = [
migrations.RenameField(
model_name='casecollection',
old_name='show_description',
new_name='show_description_pre',
),
migrations.RenameField(
model_name='casecollection',
old_name='show_discussion',
new_name='show_discussion_pre',
),
migrations.RenameField(
model_name='casecollection',
old_name='show_history',
new_name='show_history_pre',
),
migrations.RenameField(
model_name='casecollection',
old_name='show_report',
new_name='show_report_pre',
),
migrations.RenameField(
model_name='casecollection',
old_name='show_title',
new_name='show_title_pre',
),
migrations.AlterField(
model_name='casecollection',
name='publish_results',
field=models.BooleanField(default=False, help_text='If a collection should published'),
),
]
@@ -0,0 +1,63 @@
# Generated by Django 3.2.4 on 2022-04-08 22:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('atlas', '0038_auto_20220408_2355'),
]
operations = [
migrations.AddField(
model_name='casecollection',
name='show_description_post',
field=models.BooleanField(default=False, help_text='Show the description of the cases (post exam)'),
),
migrations.AddField(
model_name='casecollection',
name='show_discussion_post',
field=models.BooleanField(default=False, help_text='Show the case discussion (post exam)'),
),
migrations.AddField(
model_name='casecollection',
name='show_history_post',
field=models.BooleanField(default=False, help_text='Show the history of the cases (post exam)'),
),
migrations.AddField(
model_name='casecollection',
name='show_report_post',
field=models.BooleanField(default=False, help_text='Show the case report (post exam)'),
),
migrations.AddField(
model_name='casecollection',
name='show_title_post',
field=models.BooleanField(default=False, help_text='Show the title of the cases (post exam)'),
),
migrations.AlterField(
model_name='casecollection',
name='show_description_pre',
field=models.BooleanField(default=False, help_text='Show the description of the cases (pre exam)'),
),
migrations.AlterField(
model_name='casecollection',
name='show_discussion_pre',
field=models.BooleanField(default=False, help_text='Show the case discussion (pre exam)'),
),
migrations.AlterField(
model_name='casecollection',
name='show_history_pre',
field=models.BooleanField(default=False, help_text='Show the history of the cases (pre exam)'),
),
migrations.AlterField(
model_name='casecollection',
name='show_report_pre',
field=models.BooleanField(default=False, help_text='Show the case report (pre exam)'),
),
migrations.AlterField(
model_name='casecollection',
name='show_title_pre',
field=models.BooleanField(default=False, help_text='Show the title of the cases (pre exam)'),
),
]
+29 -12
View File
@@ -11,7 +11,6 @@ import tagulous
import tagulous.models import tagulous.models
import pydicom import pydicom
import dicognito.anonymizer import dicognito.anonymizer
@@ -591,7 +590,6 @@ class Series(models.Model):
pass pass
class CaseCollection(models.Model): class CaseCollection(models.Model):
name = models.CharField(max_length=255, unique=True) name = models.CharField(max_length=255, unique=True)
@@ -605,19 +603,37 @@ class CaseCollection(models.Model):
help_text="If a collection should be available", default=True help_text="If a collection should be available", default=True
) )
show_title = models.BooleanField( show_title_pre = models.BooleanField(
default=False, help_text="Show the title of the cases" default=False, help_text="Show the title of the cases (pre exam)"
) )
show_history = models.BooleanField( show_history_pre = models.BooleanField(
default=False, help_text="Show the history of the cases" default=False, help_text="Show the history of the cases (pre exam)"
) )
show_description = models.BooleanField( show_description_pre = models.BooleanField(
default=False, help_text="Show the description of the cases" default=False, help_text="Show the description of the cases (pre exam)"
) )
show_discussion = models.BooleanField( show_discussion_pre = models.BooleanField(
default=False, help_text="Show the case discussion" default=False, help_text="Show the case discussion (pre exam)"
)
show_report_pre = models.BooleanField(
default=False, help_text="Show the case report (pre exam)"
)
show_title_post = models.BooleanField(
default=False, help_text="Show the title of the cases (post exam)"
)
show_history_post = models.BooleanField(
default=False, help_text="Show the history of the cases (post exam)"
)
show_description_post = models.BooleanField(
default=False, help_text="Show the description of the cases (post exam)"
)
show_discussion_post = models.BooleanField(
default=False, help_text="Show the case discussion (post exam)"
)
show_report_post = models.BooleanField(
default=False, help_text="Show the case report (post exam)"
) )
show_report = models.BooleanField(default=False, help_text="Show the case report")
author = models.ManyToManyField( author = models.ManyToManyField(
settings.AUTH_USER_MODEL, settings.AUTH_USER_MODEL,
@@ -709,6 +725,7 @@ class CaseCollection(models.Model):
content_type=content_type, object_id=self.pk, cid_user=cid_user content_type=content_type, object_id=self.pk, cid_user=cid_user
) )
class CaseDetail(models.Model): class CaseDetail(models.Model):
case = models.ForeignKey(Case, on_delete=models.CASCADE) case = models.ForeignKey(Case, on_delete=models.CASCADE)
collection = models.ForeignKey(CaseCollection, on_delete=models.CASCADE) collection = models.ForeignKey(CaseCollection, on_delete=models.CASCADE)
@@ -720,7 +737,7 @@ class CaseDetail(models.Model):
class CidReportAnswer(models.Model): class CidReportAnswer(models.Model):
question = models.ForeignKey(CaseDetail, on_delete=models.CASCADE ) question = models.ForeignKey(CaseDetail, on_delete=models.CASCADE)
answer = models.TextField(blank=True) answer = models.TextField(blank=True)
@@ -3,18 +3,18 @@
{% block content %} {% block content %}
<h2>Case {{case_number|add:1}} <h2>Case {{case_number|add:1}}
{% if collection.show_title %} {% if collection.show_title_pre %}
: {{case.title}} : {{case.title}}
{% endif %} {% endif %}
</h2> </h2>
{% if collection.show_description and case.description%} {% if collection.show_description_pre and case.description%}
<div> <div>
Description: {{case.description}} Description: {{case.description}}
</div> </div>
{% endif %} {% endif %}
{% if collection.show_history and case.history%} {% if collection.show_history_pre and case.history%}
<div> <div>
History: {{case.history}} History: {{case.history}}
</div> </div>
@@ -38,7 +38,7 @@
</div> </div>
</div> </div>
{% if collection.show_discussion and case.discussion%} {% if collection.show_discussion_pre and case.discussion%}
<details> <details>
<summary> <summary>
Discussion: Discussion:
@@ -48,7 +48,7 @@
</div> </div>
</details> </details>
{% endif %} {% endif %}
{% if collection.show_report and case.report%} {% if collection.show_report_pre and case.report%}
<details> <details>
<summary> <summary>
Report: Report:
+2 -1
View File
@@ -23,4 +23,5 @@ django-zipview
pymemcache pymemcache
django-autocomplete-light django-autocomplete-light
django-querysetsequence django-querysetsequence
dicognito dicognito
django_unused_media