improve dicom uploading

This commit is contained in:
Ross
2023-10-23 13:36:41 +01:00
parent c786019af1
commit 0f3bc68de6
28 changed files with 464 additions and 172 deletions
@@ -1,5 +1,5 @@
<div class="atlas {% if case.scrapped %}atlas-scrapped{% endif %}">
<div><a href="https://viewer.penracourses.org.uk/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}"">View case in OHIF</a></div>
<div><a href="https://viewer.penracourses.org.uk/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">View case in OHIF</a></div>
<div class="date">
{{ case.created_date|date:"d/m/Y" }}
@@ -42,7 +42,10 @@
</span>
</span>
{% endfor %}
<a href="{% url 'atlas:series_id_create' pk=case.pk %}">Add new series</a><br />
<span>
<a href="{% url 'atlas:series_id_create' pk=case.pk %}">Add new series</a><br />
<a href="{% url 'atlas:user_uploads_case' case_id=case.pk %}">Import new uploads</a><br />
</span>
</div>
{% comment %} <p><b>Scrapped:</b> {{ case.scrapped }} <a
href="{% url 'atlas:case_scrap' pk=case.pk %}">(toggle)</a> {% endcomment %}
+1 -1
View File
@@ -411,7 +411,7 @@
{{ form.media }}
{% endblock %}
{% block content %}
<h2>Add Series</h2>
<h2>Series Form</h2>
This form will create a image set that can be associated with a atlas question. If the question has already been created
it can be linked below.
<form action="" method="post" enctype="multipart/form-data" id="atlas-form">
+38 -29
View File
@@ -2,46 +2,55 @@
{% block content %}
<h2>Uploaded dicoms</h2>
Click to select cases to import. If no cases are selected all will be seleced/imported.
{% if series_list %}
<ul>
{% for series, n, tags in series_list %}
<li>
{{series}} [{{n}} images] <br/>
{{tags}}
</li>
{% endfor %}
</ul>
<ul id="series-list">
{% for series, n, tags in series_list %}
<li _="
on click toggle .selected on me
then set i to the first <input/> in me
then set i.checked to not i.checked" >
{{series}} [{{n}} images] <br/>
{{tags}}
<input class="hidden" type="checkbox" name="selection" value="{{ series }}">
</li>
{% endfor %}
</ul>
{% if case %}
<p>Importing into case {{case}}</p>
{% endif %}
{% if case %}
<p>Importing into case {{case}}</p>
{% endif %}
<button
hx-get="{% url 'api-1:clear_dicoms' %}"
hx-confirm="This will clear all uploads that have not been imported into series, Continue?"
>Delete Uploads</button>
{% if case %}
<button
hx-get="{% url 'api-1:import_dicoms_case' case.id %}"
hx-target=".imported"
>Import</button>
<button id="delete-uploads-button"
hx-post="{% url 'api-1:clear_dicoms' %}"
hx-include="[name='selection']"
hx-confirm="This will clear selected uploads, Continue?"
title="Deleted selected uploads"
>Delete Uploads</button>
{% if case %}
<button id="import-dicoms-case-button"
hx-post="{% url 'api-1:import_dicoms_case' case.id %}"
hx-target=".imported"
hx-include=".selected"
>Import into case</button>
{% else %}
<button
hx-get="{% url 'api-1:import_dicoms' %}"
hx-target=".imported"
>Import</button>
{% endif %}
{% else %}
<button id="import-dicoms-button"
hx-post="{% url 'api-1:import_dicoms' %}"
hx-target=".imported"
hx-include=".selected"
>Import</button>
{% endif %}
<div class="imported">
<div class="imported">
</div>
</div>
{% else %}
No uploads awaiting importing have been found.
{% endif %}
<p><a href="{% url 'atlas:series_view' %}?case=null">View orphan series</a></p>
<p><a href="{% url 'atlas:series_view' %}?case=null&sort=-modified_date">View orphan series</a></p>
{% endblock %}