From 7fe7823deb6694a3ce70721b0c5f604479e25157 Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 7 Apr 2025 12:09:46 +0100 Subject: [PATCH] . --- shorts/filters.py | 3 --- shorts/forms.py | 30 +--------------------- shorts/models.py | 28 -------------------- shorts/templates/shorts/question_form.html | 12 +++------ 4 files changed, 5 insertions(+), 68 deletions(-) diff --git a/shorts/filters.py b/shorts/filters.py index 113844f9..8d1538f6 100755 --- a/shorts/filters.py +++ b/shorts/filters.py @@ -39,10 +39,7 @@ class QuestionFilter(django_filters.FilterSet): class Meta: model = Question fields = { - "abnormality": ["exact"], - "region": ["exact"], "examination": ["exact"], - "laterality": ["exact"], # "site", "created_date": ["exact"], "open_access": ["exact"], diff --git a/shorts/forms.py b/shorts/forms.py index bb6d3836..34173e6e 100644 --- a/shorts/forms.py +++ b/shorts/forms.py @@ -89,36 +89,15 @@ class QuestionForm(ModelForm): self.helper.layout = Layout( Div( - HTML("

Abnormality

"), - Field('abnormality', css_class='form-control'), - HTML("

Region

"), - Field('region', css_class='form-control'), - css_class='clearfix abnormal-fields' - ), HTML("

Examination*

"), Field('examination', css_class='form-control'), - Div(InlineRadios('laterality', css_class='form-control'), css_class='clearfix clear-both'), Field('history', css_class='form-control'), Field('marking_guidance', css_class='form-control'), Field('feedback', css_class='form-control'), Field('open_access', css_class='form-control'), HTML("

Exams

"), Field('exams', css_class='form-control'), - ) - - self.fields["abnormality"] = ModelMultipleChoiceField( - required=False, - queryset=Abnormality.objects.all(), - widget=FilteredSelectMultiple(verbose_name="Abnormality", is_stacked=False), - ) - self.fields["abnormality"].label = "" - - self.fields["region"] = ModelMultipleChoiceField( - required=False, - queryset=Region.objects.all(), - widget=FilteredSelectMultiple(verbose_name="Region", is_stacked=False), - ) - self.fields["region"].label = "" + )) self.fields["examination"] = ModelMultipleChoiceField( queryset=Examination.objects.all(), @@ -126,10 +105,6 @@ class QuestionForm(ModelForm): ) self.fields["examination"].label = "" - self.fields["laterality"] = ChoiceField( - choices=Question.LATERALITY_CHOICES, required=False, widget=RadioSelect() - ) - if self.user.groups.filter(name="shorts_checker").exists(): exam_queryset = Exam.objects.all() else: @@ -188,9 +163,6 @@ class QuestionForm(ModelForm): # fields = ['due_back'] # fields = '__all__' fields = [ - "abnormality", - "region", - "laterality", "examination", # "site", "feedback", diff --git a/shorts/models.py b/shorts/models.py index 768aa324..0893bad4 100644 --- a/shorts/models.py +++ b/shorts/models.py @@ -46,37 +46,9 @@ class Question(QuestionBase): help_text="Single line history for the question, e.g. Age 14, male. Referral from ED. History: Painful wrist after falling off skateboard.", ) - NONE = "NONE" - LEFT = "LEFT" - RIGHT = "RIGHT" - BILATERAL = "BILAT" - - LATERALITY_CHOICES = ( - (NONE, "None"), - (LEFT, "Left"), - (RIGHT, "Right"), - (BILATERAL, "Bilateral"), - ) - - abnormality = models.ManyToManyField( - Abnormality, - blank=True, - help_text="The abnormality (laterality and region independent). Used for categorisation but does not affect the answer", - ) - region = models.ManyToManyField( - Region, - blank=True, - help_text="Region of the abnormality (laterality independent)", - ) examination = models.ManyToManyField( Examination, help_text="Name of the (primary) examination" ) - laterality = models.CharField( - max_length=20, - choices=LATERALITY_CHOICES, - default=NONE, - help_text="Applies to the answer, not the examination", - ) marking_guidance = models.TextField( null=True, diff --git a/shorts/templates/shorts/question_form.html b/shorts/templates/shorts/question_form.html index bff27991..5601c0a6 100755 --- a/shorts/templates/shorts/question_form.html +++ b/shorts/templates/shorts/question_form.html @@ -58,9 +58,7 @@ $(document).ready(function () { - $("#add_abnormality").appendTo($("#abnormality-label")); $("#add_examination").appendTo($("#examination-label")); - $("#add_region").appendTo($("#region-label")); dropContainer = document.getElementById("drop-container"); @@ -278,11 +276,13 @@ {% endif %}

Submit Shorts Question

-

Instructions

-Abnormality, Region and Laterality are used to categorise within the system (they are not used for marking). Multiple images can be added to a question. +

+Use this form to create a new short style question/case. Multiple images can be added to a question. If the feedback image box is checked they will not be displayed when taking the question.

+

Once you have created the question with this form you can add relevant findings. +

{% comment %} {% csrf_token %} {% endcomment %} - - {% crispy form form.helper %}