.
This commit is contained in:
@@ -90,6 +90,10 @@ This series is not associated with any cases.
|
|||||||
$("#hidden-form").hide()
|
$("#hidden-form").hide()
|
||||||
});
|
});
|
||||||
|
|
||||||
|
{% if editing_finding %}
|
||||||
|
$("#hidden-form").show()
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
$("#reset-viewport-button").click(() => {
|
$("#reset-viewport-button").click(() => {
|
||||||
dicom_element = $(".cornerstone-element").get(0);
|
dicom_element = $(".cornerstone-element").get(0);
|
||||||
//annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson);
|
//annotationjson = JSON.parse(e.currentTarget.dataset.annotationjson);
|
||||||
@@ -128,6 +132,7 @@ This series is not associated with any cases.
|
|||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: '{% url "atlas:add_finding" %}',
|
url: '{% url "atlas:add_finding" %}',
|
||||||
data: {
|
data: {
|
||||||
|
series_finding_id: {{editing_finding}},
|
||||||
description: $('#id_description').val(),
|
description: $('#id_description').val(),
|
||||||
series: {{ series.pk }},
|
series: {{ series.pk }},
|
||||||
//annotation_json: JSON.stringify(c.toolStateManager.saveToolState()),
|
//annotation_json: JSON.stringify(c.toolStateManager.saveToolState()),
|
||||||
|
|||||||
+14
-1
@@ -123,7 +123,7 @@ def series_detail(request, pk, finding_pk=None):
|
|||||||
if finding_pk is not None:
|
if finding_pk is not None:
|
||||||
finding = get_object_or_404(SeriesFinding, pk=finding_pk)
|
finding = get_object_or_404(SeriesFinding, pk=finding_pk)
|
||||||
series_finding_form = SeriesFindingForm(None, instance=finding)
|
series_finding_form = SeriesFindingForm(None, instance=finding)
|
||||||
editing_finding = True
|
editing_finding = finding.pk
|
||||||
else:
|
else:
|
||||||
series_finding_form = SeriesFindingForm(series_id=series.id)
|
series_finding_form = SeriesFindingForm(series_id=series.id)
|
||||||
|
|
||||||
@@ -554,22 +554,35 @@ def create_series_findings(request):
|
|||||||
response_data = {}
|
response_data = {}
|
||||||
|
|
||||||
if request.POST.get("action") == "post":
|
if request.POST.get("action") == "post":
|
||||||
|
series_finding_id = request.POST.get("series_finding_id")
|
||||||
series_id = request.POST.get("series")
|
series_id = request.POST.get("series")
|
||||||
findings_ids = json.loads(request.POST.get("findings"))
|
findings_ids = json.loads(request.POST.get("findings"))
|
||||||
|
structure_ids = json.loads(request.POST.get("structures"))
|
||||||
description = request.POST.get("description")
|
description = request.POST.get("description")
|
||||||
annotation_json = request.POST.get("annotation_json")
|
annotation_json = request.POST.get("annotation_json")
|
||||||
viewport_json = request.POST.get("viewport_json")
|
viewport_json = request.POST.get("viewport_json")
|
||||||
|
|
||||||
series = Series.objects.get(pk=series_id)
|
series = Series.objects.get(pk=series_id)
|
||||||
findings = Finding.objects.filter(pk__in=findings_ids)
|
findings = Finding.objects.filter(pk__in=findings_ids)
|
||||||
|
structures = Structure.objects.filter(pk__in=structure_ids)
|
||||||
|
|
||||||
|
if series_finding_id == "False":
|
||||||
sf = SeriesFinding.objects.create(
|
sf = SeriesFinding.objects.create(
|
||||||
series=series,
|
series=series,
|
||||||
description=description,
|
description=description,
|
||||||
annotation_json=annotation_json,
|
annotation_json=annotation_json,
|
||||||
viewport_json=viewport_json,
|
viewport_json=viewport_json,
|
||||||
)
|
)
|
||||||
|
else:
|
||||||
|
sf = get_object_or_404(SeriesFinding, pk=series_finding_id)
|
||||||
|
sf.series = series
|
||||||
|
sf.description=description
|
||||||
|
sf.annotation_json=annotation_json
|
||||||
|
sf.viewport_json=viewport_json
|
||||||
|
|
||||||
|
|
||||||
sf.findings.set(findings)
|
sf.findings.set(findings)
|
||||||
|
sf.structures.set(structures)
|
||||||
sf.save()
|
sf.save()
|
||||||
return JsonResponse({"success": True})
|
return JsonResponse({"success": True})
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user