From c9f1e8d427690737262c3805af47380faa74e57a Mon Sep 17 00:00:00 2001
From: Ross
Date: Tue, 30 Nov 2021 20:56:09 +0000
Subject: [PATCH] .
---
atlas/migrations/0012_auto_20211130_2050.py | 28 ++++++++++
atlas/models.py | 9 ++--
atlas/templates/atlas/case_display_block.html | 54 +++++++++++--------
atlas/views.py | 4 +-
4 files changed, 65 insertions(+), 30 deletions(-)
create mode 100644 atlas/migrations/0012_auto_20211130_2050.py
diff --git a/atlas/migrations/0012_auto_20211130_2050.py b/atlas/migrations/0012_auto_20211130_2050.py
new file mode 100644
index 00000000..6d892395
--- /dev/null
+++ b/atlas/migrations/0012_auto_20211130_2050.py
@@ -0,0 +1,28 @@
+# Generated by Django 3.2.8 on 2021-11-30 20:50
+
+from django.db import migrations
+
+
+class Migration(migrations.Migration):
+
+ dependencies = [
+ ('atlas', '0011_auto_20211130_1807'),
+ ]
+
+ operations = [
+ migrations.RenameField(
+ model_name='condition',
+ old_name='primary_name',
+ new_name='primary',
+ ),
+ migrations.RenameField(
+ model_name='finding',
+ old_name='primary_name',
+ new_name='primary',
+ ),
+ migrations.RenameField(
+ model_name='structure',
+ old_name='primary_name',
+ new_name='primary',
+ ),
+ ]
diff --git a/atlas/models.py b/atlas/models.py
index 2678c3e0..8474c6e6 100644
--- a/atlas/models.py
+++ b/atlas/models.py
@@ -79,7 +79,7 @@ class SynMixin(object):
# abstract = True
def __str__(self) -> str:
- if self.primary_name:
+ if self.primary:
if self.synonym.count() == 0:
return self.name
else:
@@ -93,7 +93,7 @@ class Finding(SynMixin, models.Model):
name = models.CharField(max_length=255, unique=True)
synonym = models.ManyToManyField("self", blank=True)
- primary_name = models.BooleanField(default="True")
+ primary = models.BooleanField(default="True")
class Condition(SynMixin, models.Model):
@@ -101,7 +101,7 @@ class Condition(SynMixin, models.Model):
synonym = models.ManyToManyField("self", blank=True)
- primary_name = models.BooleanField(default="True")
+ primary = models.BooleanField(default="True")
subspecialty = models.ManyToManyField("subspecialty", blank=True)
@@ -126,8 +126,7 @@ class Structure(SynMixin, models.Model):
synonym = models.ManyToManyField("self", blank=True)
- primary_name = models.BooleanField(default="True")
-
+ primary = models.BooleanField(default="True")
@reversion.register
diff --git a/atlas/templates/atlas/case_display_block.html b/atlas/templates/atlas/case_display_block.html
index ad372dcb..71225733 100755
--- a/atlas/templates/atlas/case_display_block.html
+++ b/atlas/templates/atlas/case_display_block.html
@@ -11,37 +11,45 @@
Author(s): {% for author in case.author.all %} {{author}}, {% endfor %}
+ href="{% url 'atlas:author_detail' pk=author.pk %}">{{author}}, {% endfor %}
Checked by: {% for verified in case.verified.all %} {{verified}}, {% endfor %}
+ href="{% url 'atlas:verified_detail' pk=verified.pk %}">{{verified}}, {% endfor %}
{% comment %} Scrapped: {{ case.scrapped }} (toggle) {% endcomment %}
-
-
-
- Findings
- {{ case.findings | safe}}
-
-
-
-
-
- {% include 'question_notes.html' %}
+
+
+
+ Findings
+ {{ case.findings | safe}}
+
+
+ Differentials
+ {% for diff in case.differential.all %}
+
+ - {{diff.condition}} - {{diff.text}}
+
+ {% endfor %}
+
+
+
+
+
+ {% include 'question_notes.html' %}
-
\ No newline at end of file
+
diff --git a/atlas/views.py b/atlas/views.py
index 599c1486..bbcdbf61 100755
--- a/atlas/views.py
+++ b/atlas/views.py
@@ -586,9 +586,9 @@ class ConditionAutocomplete(autocomplete.Select2QuerySetView):
try:
primary = qs.filter(name__icontains=self.q)
- # synonyms = qs.filter(name__icontains=self.q, primary_name=False)
+ # synonyms = qs.filter(name__icontains=self.q, primary=False)
# for s in synonyms:
- # primary.extend(s.synonym.filter(primary_name=True))
+ # primary.extend(s.synonym.filter(primary=True))
except FieldError:
return Condition.objects.none()