migrate examinations to generic model (and start adding mangament)

This commit is contained in:
Ross
2023-06-19 12:37:55 +01:00
parent 154494e4b0
commit 6c1fd3ae2f
21 changed files with 429 additions and 64 deletions
@@ -0,0 +1,29 @@
# Generated by Django 4.1.4 on 2023-06-19 10:51
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
("generic", "0002_modality_examination_modality"),
("atlas", "0002_initial"),
]
operations = [
migrations.SeparateDatabaseAndState(
state_operations=[
migrations.AlterField(
model_name="series",
name="modality",
field=models.ForeignKey(
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="atlas_series_modality",
to="generic.modality",
),
),
],
database_operations=[],
)
]
+1 -1
View File
@@ -29,7 +29,6 @@ import string
from collections import defaultdict
from helpers.images import image_as_base64, pretty_print_dicom
from anatomy.models import Modality
from generic.models import (
CidUser,
@@ -44,6 +43,7 @@ from generic.models import (
QuestionNote,
SeriesBase,
SeriesImageBase,
Modality,
)
# from generic.models import Examination, Site, Condition, Sign
+49 -47
View File
@@ -34,8 +34,8 @@
</a>
<br>
<span class="series-block-popup-link">
<a href="#"
onclick="return window.create_popup_window('/atlas/series/{{series.pk}}', 'Series')">Popup</a>
<a href="#"
onclick="return window.create_popup_window('/atlas/series/{{series.pk}}', 'Series')">Popup</a>
</span>
</span>
</span>
@@ -53,51 +53,53 @@
<li>{{con.get_link}}</li>
{% endfor %}
</ul>
<details>
<summary><b>Findings</b></summary>
{% if case.series.all %}
See individual series for more details.<br/>
{% for series in case.series.all %}
{% for finding in series.findings.all %}
<div class="finding-box">
<span>
<a href="{{series.get_absolute_url}}">Series {{series.pk}}</a>: {{series.get_examination_full}} |&nbsp;
</span>
{% if finding.findings.all %}
<div>
<details>
<summary><b>Findings</b></summary>
{% if case.series.all %}
{% for series in case.series.all %}
{% for finding in series.findings.all %}
<div class="finding-box">
<span>
Findings: {% for f in finding.findings.all %}
{{f.get_link}},&nbsp;
{% endfor %}
<a href="{{series.get_absolute_url}}">Series {{series.pk}}</a>: {{series.get_examination_full}} |&nbsp;
</span>
{% endif %}
{% if finding.structures.all %}
<span>
Structure: {% for s in finding.structures.all %}
{{s.get_link}},&nbsp;
{% endfor %}
</span>
{% endif %}
{% if finding.description %}
<span>
Description: {{finding.description}}
</span>
{% endif %}
</div>
{% if finding.findings.all %}
<span>
Findings: {% for f in finding.findings.all %}
{{f.get_link}},&nbsp;
{% endfor %}
</span>
{% endif %}
{% if finding.structures.all %}
<span>
Structure: {% for s in finding.structures.all %}
{{s.get_link}},&nbsp;
{% endfor %}
</span>
{% endif %}
{% if finding.description %}
<span>
Description: {{finding.description}}
</span>
{% endif %}
</div>
{% endfor %}
{% endfor %}
{% endfor %}
{% else %}
No findings associated with case.
{% endif %}
</details>
<details open>
<summary><b>Differentials</b></summary>
<ul>
{% for diff in case.differentialcase.all %}
<li>{{diff.condition.get_link}} - {{diff.text}}</li>
{% endfor %}
</ul>
</details>
{% else %}
No series associated with case.
{% endif %}
</details>
</div>
<div>
<details open>
<summary><b>Differentials</b></summary>
<ul>
{% for diff in case.differentialcase.all %}
<li>{{diff.condition.get_link}} - {{diff.text}}</li>
{% endfor %}
</ul>
</details>
</div>
</p>
</div>
Subspecialty:
@@ -114,9 +116,9 @@
</ul>
<b>Collections:</b>
<button
hx-get="{% url 'atlas:case_collection_form' case.pk %}"
hx-target="#collection-form">
Add collection</button>
hx-get="{% url 'atlas:case_collection_form' case.pk %}"
hx-target="#collection-form">
Add collection</button>
<div id="collection-form"></div>
<ul>
{% for collection in case.casecollection_set.all %}