.
This commit is contained in:
@@ -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',
|
||||||
|
),
|
||||||
|
]
|
||||||
+4
-5
@@ -79,7 +79,7 @@ class SynMixin(object):
|
|||||||
# abstract = True
|
# abstract = True
|
||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
if self.primary_name:
|
if self.primary:
|
||||||
if self.synonym.count() == 0:
|
if self.synonym.count() == 0:
|
||||||
return self.name
|
return self.name
|
||||||
else:
|
else:
|
||||||
@@ -93,7 +93,7 @@ class Finding(SynMixin, models.Model):
|
|||||||
name = models.CharField(max_length=255, unique=True)
|
name = models.CharField(max_length=255, unique=True)
|
||||||
synonym = models.ManyToManyField("self", blank=True)
|
synonym = models.ManyToManyField("self", blank=True)
|
||||||
|
|
||||||
primary_name = models.BooleanField(default="True")
|
primary = models.BooleanField(default="True")
|
||||||
|
|
||||||
|
|
||||||
class Condition(SynMixin, models.Model):
|
class Condition(SynMixin, models.Model):
|
||||||
@@ -101,7 +101,7 @@ class Condition(SynMixin, models.Model):
|
|||||||
|
|
||||||
synonym = models.ManyToManyField("self", blank=True)
|
synonym = models.ManyToManyField("self", blank=True)
|
||||||
|
|
||||||
primary_name = models.BooleanField(default="True")
|
primary = models.BooleanField(default="True")
|
||||||
|
|
||||||
subspecialty = models.ManyToManyField("subspecialty", blank=True)
|
subspecialty = models.ManyToManyField("subspecialty", blank=True)
|
||||||
|
|
||||||
@@ -126,8 +126,7 @@ class Structure(SynMixin, models.Model):
|
|||||||
|
|
||||||
synonym = models.ManyToManyField("self", blank=True)
|
synonym = models.ManyToManyField("self", blank=True)
|
||||||
|
|
||||||
primary_name = models.BooleanField(default="True")
|
primary = models.BooleanField(default="True")
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@reversion.register
|
@reversion.register
|
||||||
|
|||||||
@@ -38,10 +38,18 @@
|
|||||||
<summary><b>Findings</b></summary>
|
<summary><b>Findings</b></summary>
|
||||||
<pre>{{ case.findings | safe}}</pre>
|
<pre>{{ case.findings | safe}}</pre>
|
||||||
</details>
|
</details>
|
||||||
|
<details>
|
||||||
|
<summary><b>Differentials</b></summary>
|
||||||
|
{% for diff in case.differential.all %}
|
||||||
|
<ul>
|
||||||
|
<li>{{diff.condition}} - {{diff.text}}</li>
|
||||||
|
</ul>
|
||||||
|
{% endfor %}
|
||||||
|
</details>
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</p>
|
</p>
|
||||||
<div>
|
<div>
|
||||||
{% include 'question_notes.html' %}
|
{% include 'question_notes.html' %}
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
+2
-2
@@ -586,9 +586,9 @@ class ConditionAutocomplete(autocomplete.Select2QuerySetView):
|
|||||||
try:
|
try:
|
||||||
primary = qs.filter(name__icontains=self.q)
|
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:
|
# for s in synonyms:
|
||||||
# primary.extend(s.synonym.filter(primary_name=True))
|
# primary.extend(s.synonym.filter(primary=True))
|
||||||
|
|
||||||
except FieldError:
|
except FieldError:
|
||||||
return Condition.objects.none()
|
return Condition.objects.none()
|
||||||
|
|||||||
Reference in New Issue
Block a user