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