.
This commit is contained in:
@@ -12,6 +12,7 @@ from atlas.models import (
|
||||
Case,
|
||||
Series,
|
||||
SeriesImage,
|
||||
SeriesFindings
|
||||
)
|
||||
|
||||
from anatomy.models import Modality
|
||||
@@ -32,6 +33,11 @@ class ExaminationForm(ModelForm):
|
||||
fields = ["examination"]
|
||||
|
||||
|
||||
class SeriesFindingsForm(ModelForm):
|
||||
class Meta:
|
||||
model = SeriesFindings
|
||||
exclude = [""]
|
||||
|
||||
class SeriesForm(ModelForm):
|
||||
class Media:
|
||||
# Django also includes a few javascript files necessary
|
||||
|
||||
@@ -11,6 +11,12 @@ This series is not associated with any cases.
|
||||
|
||||
<div id="single-dicom-viewer" class="dicom-viewer" data-images="{{ series.get_image_url_array }}" data-annotations=''></div>
|
||||
|
||||
<form method="post" id="series_finding_form">
|
||||
{% csrf_token %}
|
||||
{{ series_finding_form }}
|
||||
<input type="submit" value="Submit">
|
||||
</form>
|
||||
|
||||
<div>Author: {{ series.get_author_display }}</div>
|
||||
<details>
|
||||
<summary>Image info</summary>
|
||||
|
||||
+29
-1
@@ -30,11 +30,16 @@ from .forms import (
|
||||
SeriesImageFormSet,
|
||||
SeriesFormSet,
|
||||
ExaminationForm,
|
||||
SeriesFindingsForm
|
||||
)
|
||||
from .models import (
|
||||
Case,
|
||||
Series,
|
||||
Examination,
|
||||
Finding,
|
||||
Subspecialty,
|
||||
SeriesFindings,
|
||||
SeriesImage
|
||||
)
|
||||
from .tables import AtlasTable, SeriesTable
|
||||
from .filters import AtlasFilter, SeriesFilter
|
||||
@@ -112,9 +117,11 @@ def series_detail(request, pk):
|
||||
|
||||
# if request.user not in atlas.author.all():
|
||||
# raise PermissionDenied
|
||||
series_finding_form = SeriesFindingsForm()
|
||||
|
||||
|
||||
# logging.debug(atlas.subspecialty.first().name.all())
|
||||
return render(request, "atlas/series.html", {"series": series})
|
||||
return render(request, "atlas/series.html", {"series": series, "series_finding_form": series_finding_form})
|
||||
|
||||
|
||||
@login_required
|
||||
@@ -508,3 +515,24 @@ class SeriesImagesZipView(SuperuserRequiredMixin, BaseZipView):
|
||||
series = Series.objects.get(pk=self.kwargs["pk"])
|
||||
|
||||
return [i.image.file for i in series.images.all()]
|
||||
|
||||
def create_series_findings(request):
|
||||
#posts = Post.objects.all()
|
||||
response_data = {}
|
||||
|
||||
if request.POST.get('action') == 'post':
|
||||
series = request.POST.get('series')
|
||||
findings = request.POST.get('findings')
|
||||
description = request.POST.get('description')
|
||||
annotation_json = request.POST.get('annotation_json')
|
||||
|
||||
sf = SeriesFindings.create(
|
||||
series = series,
|
||||
findings = findings,
|
||||
description = description,
|
||||
annotation_json = annotation_json,
|
||||
)
|
||||
return JsonResponse({"success":True})
|
||||
|
||||
return JsonResponse({"success": False})
|
||||
return render(request, 'create_post.html', {'posts':posts})
|
||||
Reference in New Issue
Block a user