improve vivas
This commit is contained in:
+1
-1
@@ -1147,7 +1147,7 @@ class CaseDetail(models.Model):
|
|||||||
return None
|
return None
|
||||||
|
|
||||||
def default_viewerstate_string(self):
|
def default_viewerstate_string(self):
|
||||||
return json.dumps(self.default_viewerstate) if self.default_viewerstate else ""
|
return json.dumps(self.default_viewerstate) if self.default_viewerstate else "{}"
|
||||||
|
|
||||||
class CasePrior(models.Model):
|
class CasePrior(models.Model):
|
||||||
case_detail = models.ForeignKey(CaseDetail, on_delete=models.CASCADE)
|
case_detail = models.ForeignKey(CaseDetail, on_delete=models.CASCADE)
|
||||||
|
|||||||
@@ -18,7 +18,11 @@
|
|||||||
<li data-question_pk={{casedetail.case.pk}}><a title="sort_order: {{casedetail.sort_order}}" href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=forloop.counter0 %}">Case {{forloop.counter}}</a>
|
<li data-question_pk={{casedetail.case.pk}}><a title="sort_order: {{casedetail.sort_order}}" href="{% url 'atlas:collection_case_view' pk=collection.pk case_number=forloop.counter0 %}">Case {{forloop.counter}}</a>
|
||||||
: {{casedetail.case.title}}
|
: {{casedetail.case.title}}
|
||||||
|
|
||||||
(<a href="{% url 'atlas:collection_case_display_setup' casedetail.collection.pk casedetail.case.pk %}">setup default display</a>)
|
(<a href="{% url 'atlas:collection_case_display_setup' casedetail.collection.pk casedetail.case.pk %}">setup default display</a>
|
||||||
|
{% if casedetail.default_viewerstate %}
|
||||||
|
<i class="bi bi-check text-success" title="This case has a default viewerstate defined"></i>
|
||||||
|
{% endif %}
|
||||||
|
)
|
||||||
|
|
||||||
{% if collection.collection_type == "QUE" %}
|
{% if collection.collection_type == "QUE" %}
|
||||||
(<a href='{% url "atlas:collection_case_details" casedetail.collection.pk casedetail.case.pk %}'>edit questions</a>
|
(<a href='{% url "atlas:collection_case_details" casedetail.collection.pk casedetail.case.pk %}'>edit questions</a>
|
||||||
|
|||||||
@@ -10,9 +10,9 @@
|
|||||||
<p>It is also possible to open a single series by clicking on the 'Load' button next to the individual series.</p>
|
<p>It is also possible to open a single series by clicking on the 'Load' button next to the individual series.</p>
|
||||||
<p>Once opened the case details will be show on the right hand side of the page.</p>
|
<p>Once opened the case details will be show on the right hand side of the page.</p>
|
||||||
|
|
||||||
<div class="mb-2">
|
<div class="mb-2">
|
||||||
<button id="toggle-load-mode" class="btn btn-secondary">Switch to Load OHIF</button>
|
<button id="toggle-load-mode" class="btn btn-secondary">Switch to Load OHIF</button>
|
||||||
</div>
|
</div>
|
||||||
</details>
|
</details>
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
@@ -22,11 +22,11 @@
|
|||||||
<button id="open-viewer-local" >Open Viewer Local</button>
|
<button id="open-viewer-local" >Open Viewer Local</button>
|
||||||
<button id="view-series" class="text-dark border-dark" >Toggle series</button>
|
<button id="view-series" class="text-dark border-dark" >Toggle series</button>
|
||||||
<ol id="" class="sortable">
|
<ol id="" class="sortable">
|
||||||
{% for case in cases %}
|
{% for casedetail in casedetails %}
|
||||||
|
{% with case=casedetail.case %}
|
||||||
|
|
||||||
<li data-question_pk={{case.pk}}>
|
<li data-question_pk={{case.pk}}>
|
||||||
{{case.casedetail.sort_order}}
|
<div class="case-item" data-title="{{case.title}}" data-case={{case.pk}} data-casejson='{{case.get_viva_details_json}}' data-images='{{case.get_series_images_nested}}' data-viewerstate={{casedetail.default_viewerstate_string}}>Case {{forloop.counter}}: {{case.title}}
|
||||||
<div class="case-item" data-title="{{case.title}}" data-case={{case.pk}} data-casejson='{{case.get_viva_details_json}}' data-images='{{case.get_series_images_nested}}'>Case {{forloop.counter}}: {{case.title}}
|
|
||||||
{% comment %} <button class="show-case no-padding" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Show</button> {% endcomment %}
|
{% comment %} <button class="show-case no-padding" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Show</button> {% endcomment %}
|
||||||
{% comment %} <button class="send-message no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Open</button> {% endcomment %}
|
{% comment %} <button class="send-message no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Open</button> {% endcomment %}
|
||||||
{% comment %} <button class="open-case no-padding" data-target="{% url 'atlas:collection_viva_case' collection.pk forloop.counter0 %}" data-type="case">Load</button> {% endcomment %}
|
{% comment %} <button class="open-case no-padding" data-target="{% url 'atlas:collection_viva_case' collection.pk forloop.counter0 %}" data-type="case">Load</button> {% endcomment %}
|
||||||
@@ -64,6 +64,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
|
{% endwith %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
</ol>
|
</ol>
|
||||||
</div>
|
</div>
|
||||||
@@ -152,6 +153,7 @@
|
|||||||
console.log('clicked local', c)
|
console.log('clicked local', c)
|
||||||
console.log('open local', c.dataset.case)
|
console.log('open local', c.dataset.case)
|
||||||
case_details = JSON.parse(c.dataset.casejson);
|
case_details = JSON.parse(c.dataset.casejson);
|
||||||
|
let viewerstate = JSON.parse(c.dataset.viewerstate) || {};
|
||||||
$('#loading-case').show()
|
$('#loading-case').show()
|
||||||
$("#open-viewer-local").addClass("flash-button");
|
$("#open-viewer-local").addClass("flash-button");
|
||||||
$('#current-case-title').html("<span class='title'>Case:</span> "+c.dataset.title);
|
$('#current-case-title').html("<span class='title'>Case:</span> "+c.dataset.title);
|
||||||
@@ -159,7 +161,10 @@
|
|||||||
$("#current-case-discussion").html("<span class='title'>Discussion:</span> "+case_details['discussion']);
|
$("#current-case-discussion").html("<span class='title'>Discussion:</span> "+case_details['discussion']);
|
||||||
$("#current-case-report").html("<span class='title'>Report:</span> "+case_details['report']);
|
$("#current-case-report").html("<span class='title'>Report:</span> "+case_details['report']);
|
||||||
|
|
||||||
bc.postMessage({"type": "open", "case" : c.dataset.case, "images": c.dataset.images});
|
bc.postMessage({"type": "open",
|
||||||
|
"case" : c.dataset.case, "images": c.dataset.images,
|
||||||
|
"viewerstate": viewerstate
|
||||||
|
});
|
||||||
|
|
||||||
});
|
});
|
||||||
$('.open-series-local').click(function() {
|
$('.open-series-local').click(function() {
|
||||||
@@ -181,7 +186,7 @@
|
|||||||
"type": "open",
|
"type": "open",
|
||||||
"case": c.dataset.case,
|
"case": c.dataset.case,
|
||||||
"series": seriesPk,
|
"series": seriesPk,
|
||||||
"images": JSON.stringify(images)
|
"images": JSON.stringify(images),
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
$('.open-case, .open-series').click(function() {
|
$('.open-case, .open-series').click(function() {
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
{% load static %}
|
{% load static %}
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
<head>
|
<head>
|
||||||
<title>Viewer</title>
|
<title>Viewer</title>
|
||||||
<style type="text/css">
|
<style type="text/css">
|
||||||
body, html
|
body, html
|
||||||
@@ -16,9 +16,9 @@
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<script src="{% static 'dv3d/index.js' %}" type="module" defer="defer" type="module"></script>
|
<script src="{% static 'dv3d/index.js' %}" type="module" defer="defer" type="module"></script>
|
||||||
</head>
|
</head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div id="awating-load">
|
<div id="awating-load">
|
||||||
<p>Awating load request</p>
|
<p>Awating load request</p>
|
||||||
This page will display series when loaded from other pages.
|
This page will display series when loaded from other pages.
|
||||||
@@ -43,6 +43,17 @@
|
|||||||
console.log("open, images: ", event.data.images);
|
console.log("open, images: ", event.data.images);
|
||||||
document.getElementById("root").dataset.images = event.data.images;
|
document.getElementById("root").dataset.images = event.data.images;
|
||||||
|
|
||||||
|
console.log("viewerstate: ", event.data.viewerstate);
|
||||||
|
console.log(event.data.viewerstate == {});
|
||||||
|
if (
|
||||||
|
event.data.viewerstate &&
|
||||||
|
Object.keys(event.data.viewerstate).length > 0
|
||||||
|
) {
|
||||||
|
document.getElementById("root").dataset.viewerstate = event.data.viewerstate;
|
||||||
|
} else {
|
||||||
|
delete document.getElementById("root").dataset.viewerstate;
|
||||||
|
}
|
||||||
|
|
||||||
window.mountDicomViewers();
|
window.mountDicomViewers();
|
||||||
bc.postMessage({"type": "open-complete-local"});
|
bc.postMessage({"type": "open-complete-local"});
|
||||||
}
|
}
|
||||||
@@ -50,5 +61,5 @@
|
|||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
|||||||
+17
-11
@@ -1611,22 +1611,28 @@ class CollectionView(LoginRequiredMixin, SingleTableMixin, FilterView):
|
|||||||
def collection_viva(request, pk):
|
def collection_viva(request, pk):
|
||||||
collection = get_object_or_404(CaseCollection, pk=pk)
|
collection = get_object_or_404(CaseCollection, pk=pk)
|
||||||
|
|
||||||
cases = (
|
#cases = (
|
||||||
collection.cases.all()
|
# collection.cases.all()
|
||||||
.order_by("casedetail__sort_order")
|
# .order_by("casedetail__sort_order")
|
||||||
.prefetch_related(
|
# .prefetch_related(
|
||||||
"series",
|
# "series",
|
||||||
"series__images",
|
# "series__images",
|
||||||
"series__contrast",
|
# "series__contrast",
|
||||||
"series__plane",
|
# "series__plane",
|
||||||
"series__examination",
|
# "series__examination",
|
||||||
)
|
# )
|
||||||
|
#)
|
||||||
|
|
||||||
|
casedetails = CaseDetail.objects.filter(collection=collection).order_by(
|
||||||
|
"sort_order"
|
||||||
)
|
)
|
||||||
|
logger.debug(casedetails)
|
||||||
|
|
||||||
|
|
||||||
return render(
|
return render(
|
||||||
request,
|
request,
|
||||||
"atlas/collection_viva.html",
|
"atlas/collection_viva.html",
|
||||||
{"collection": collection, "cases": cases, "can_edit": True},
|
{"collection": collection, "casedetails": casedetails, "can_edit": True},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user