.
This commit is contained in:
@@ -612,6 +612,29 @@ class Series(SeriesBase):
|
|||||||
|
|
||||||
return series_json
|
return series_json
|
||||||
|
|
||||||
|
def get_ohif_dicom_json(self, case_title_as_patient_name = True):
|
||||||
|
series_json = []
|
||||||
|
series_json.append(self.get_series_dicom_json())
|
||||||
|
|
||||||
|
patient_name = ""
|
||||||
|
if case_title_as_patient_name:
|
||||||
|
patient_name = self.title
|
||||||
|
|
||||||
|
return {
|
||||||
|
"studies": [
|
||||||
|
{
|
||||||
|
"StudyInstanceUID": "1.3.6.1.4.1.14519.5.2.1.6279.6001.298806137288633453246975630178",
|
||||||
|
"StudyDate": "20000101",
|
||||||
|
"StudyTime": "",
|
||||||
|
"PatientName": patient_name,
|
||||||
|
"PatientID": "LIDC-IDRI-0001",
|
||||||
|
"AccessionNumber": "",
|
||||||
|
"PatientAge": "",
|
||||||
|
"PatientSex": "",
|
||||||
|
"series": series_json,
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
|
||||||
class CaseCollection(ExamOrCollectionGenericBase):
|
class CaseCollection(ExamOrCollectionGenericBase):
|
||||||
app_name = "atlas"
|
app_name = "atlas"
|
||||||
|
|||||||
@@ -2,14 +2,38 @@
|
|||||||
|
|
||||||
{% block content %}
|
{% block content %}
|
||||||
<h3>Cases</h3>
|
<h3>Cases</h3>
|
||||||
<ol id="full-question-list" class="sortable">
|
<details class="help-text">
|
||||||
{% for case in cases %}
|
<summary>Instructions</summary>
|
||||||
<li data-question_pk={{case.pk}}>Case {{forloop.counter}}: {{case.title}}
|
<p>Click on the 'Show' button to view the case in the viewer. Click on the 'Open' button to open the case in a new window.</p>
|
||||||
|
<p>Opening a second case will replace the first case in the viewer or window.</p>
|
||||||
|
</details>
|
||||||
|
|
||||||
aoeu
|
<ol id="" class="sortable">
|
||||||
<button class="show-case no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Show</button>
|
{% for case in cases %}
|
||||||
|
<li data-question_pk={{case.pk}}>
|
||||||
|
<div>Case {{forloop.counter}}: {{case.title}}
|
||||||
|
<button class="show-case no-padding" data-title="{{case.title}}" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:case_dicom_json' case.pk %}">Show</button>
|
||||||
{% 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 %}
|
||||||
<button class="open-case no-padding" data-title="{{case.title}}" data-target="{% url 'atlas:collection_viva_case' collection.pk forloop.counter0 %}">Case</button>
|
<button class="open-case no-padding" data-title="{{case.title}}" data-target="{% url 'atlas:collection_viva_case' collection.pk forloop.counter0 %}">Open</button>
|
||||||
|
<br />
|
||||||
|
<div class="pre-whitespace multi-image-block"><b>Series:</b>
|
||||||
|
{% for series in case.series.all %}
|
||||||
|
<span class="series-block">
|
||||||
|
<span>
|
||||||
|
<span class="series-block-series-number">Series {{ forloop.counter }}:</span><br>
|
||||||
|
{{series.get_block}}
|
||||||
|
<button class="show-series" data-target="/ohif/viewer/dicomjson?url=https://www.penracourses.org.uk{% url 'atlas:series_dicom_json' series.pk %}">
|
||||||
|
show
|
||||||
|
</button>
|
||||||
|
<button class="open-series" data-target="{% url 'atlas:collection_viva_series' collection.pk series.pk %}">
|
||||||
|
show
|
||||||
|
</button>
|
||||||
|
<br>
|
||||||
|
</span>
|
||||||
|
</span>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</li>
|
</li>
|
||||||
|
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
@@ -34,6 +58,12 @@
|
|||||||
$('#case-title').text($(this).data('title'));
|
$('#case-title').text($(this).data('title'));
|
||||||
$('#viewer').attr('src', url)
|
$('#viewer').attr('src', url)
|
||||||
});
|
});
|
||||||
|
$('.show-series').click(function() {
|
||||||
|
var url = $(this).data('target');
|
||||||
|
console.log('clicked', url)
|
||||||
|
$('#case-title').text("Series: " + $(this).data('title'));
|
||||||
|
$('#viewer').attr('src', url)
|
||||||
|
});
|
||||||
$('.open-case').click(function() {
|
$('.open-case').click(function() {
|
||||||
var url = $(this).data('target');
|
var url = $(this).data('target');
|
||||||
bc.postMessage(url);
|
bc.postMessage(url);
|
||||||
|
|||||||
@@ -58,6 +58,7 @@ urlpatterns = [
|
|||||||
path("collection/<int:pk>", views.collection_detail, name="collection_detail"),
|
path("collection/<int:pk>", views.collection_detail, name="collection_detail"),
|
||||||
path("collection/<int:pk>/viva", views.collection_viva, name="collection_viva"),
|
path("collection/<int:pk>/viva", views.collection_viva, name="collection_viva"),
|
||||||
path("collection/<int:pk>/viva/<int:case_number>", views.collection_viva_case, name="collection_viva_case"),
|
path("collection/<int:pk>/viva/<int:case_number>", views.collection_viva_case, name="collection_viva_case"),
|
||||||
|
path("collection/<int:pk>/viva/<int:series_id>", views.collection_viva_series, name="collection_viva_series"),
|
||||||
path(
|
path(
|
||||||
"collection/<int:pk>/take",
|
"collection/<int:pk>/take",
|
||||||
views.collection_take_start,
|
views.collection_take_start,
|
||||||
@@ -148,6 +149,11 @@ urlpatterns = [
|
|||||||
views.case_dicom_json,
|
views.case_dicom_json,
|
||||||
name="case_dicom_json",
|
name="case_dicom_json",
|
||||||
),
|
),
|
||||||
|
path(
|
||||||
|
"series/<int:pk>/dicom_json",
|
||||||
|
views.series_dicom_json,
|
||||||
|
name="series_dicom_json",
|
||||||
|
),
|
||||||
path("uncategorised_dicoms/", views.uncategorised_dicoms, name="uncategorised_dicoms_view"),
|
path("uncategorised_dicoms/", views.uncategorised_dicoms, name="uncategorised_dicoms_view"),
|
||||||
|
|
||||||
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
path("condition/", views.ConditionView.as_view(), name="condition_view"),
|
||||||
|
|||||||
@@ -1363,6 +1363,19 @@ def collection_viva_case(request, pk, case_number):
|
|||||||
{"collection": collection, "cases": cases, "current_case": current_case},
|
{"collection": collection, "cases": cases, "current_case": current_case},
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@user_is_collection_author_or_atlas_editor
|
||||||
|
def collection_viva_series(request, pk, series_id):
|
||||||
|
collection = get_object_or_404(CaseCollection, pk=pk)
|
||||||
|
|
||||||
|
series = get_object_or_404(Series, pk=series_id)
|
||||||
|
|
||||||
|
return render(
|
||||||
|
request,
|
||||||
|
"atlas/collection_viva_case.html",
|
||||||
|
{"collection": collection, "current_case": series},
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
@user_is_collection_author_or_atlas_editor
|
@user_is_collection_author_or_atlas_editor
|
||||||
def collection_detail(request, pk):
|
def collection_detail(request, pk):
|
||||||
collection = get_object_or_404(CaseCollection, pk=pk)
|
collection = get_object_or_404(CaseCollection, pk=pk)
|
||||||
@@ -1820,6 +1833,10 @@ def case_dicom_json(request, pk):
|
|||||||
|
|
||||||
return JsonResponse(case.get_case_dicom_json())
|
return JsonResponse(case.get_case_dicom_json())
|
||||||
|
|
||||||
|
def series_dicom_json(request, pk):
|
||||||
|
series = get_object_or_404(Series, pk=pk)
|
||||||
|
|
||||||
|
return JsonResponse(series.get_ohif_dicom_json())
|
||||||
|
|
||||||
@user_is_collection_author_or_atlas_editor
|
@user_is_collection_author_or_atlas_editor
|
||||||
def delete_collection_cid_answers(request, exam_id, cid):
|
def delete_collection_cid_answers(request, exam_id, cid):
|
||||||
|
|||||||
Reference in New Issue
Block a user