This commit is contained in:
Ross
2021-12-01 20:18:07 +00:00
parent f9dda1ddc8
commit 7ac535e741
8 changed files with 113 additions and 21 deletions
+7 -6
View File
@@ -25,12 +25,6 @@ from tinymce.widgets import TinyMCE
from dal import autocomplete
class ExaminationForm(ModelForm):
class Meta:
model = Examination
fields = ["examination"]
class SeriesFindingForm(ModelForm):
class Meta:
model = SeriesFinding
@@ -129,6 +123,13 @@ class SeriesForm(ModelForm):
exclude = ["author"]
widgets = {
"examination": autocomplete.ModelSelect2Multiple(
url="generic:examination-autocomplete"
),
}
class CaseForm(ModelForm):
# exams = ModelMultipleChoiceField(required=False, queryset=Exam.objects.all(),widget=FilteredSelectMultiple(verbose_name="Exams", is_stacked=False))
+17
View File
@@ -0,0 +1,17 @@
# Generated by Django 3.2.8 on 2021-12-01 19:32
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('atlas', '0013_rename_structure_structure_name'),
]
operations = [
migrations.RemoveField(
model_name='case',
name='sign',
),
]
+37
View File
@@ -304,6 +304,43 @@
}
}
function extractDicomStudyDescription(byteArray) {
// We need to setup a try/catch block because parseDicom will throw an exception
// if you attempt to parse a non dicom part 10 file (or one that is corrupted)
try {
// parse byteArray into a DataSet object using the parseDicom library
var dataSet = dicomParser.parseDicom(byteArray);
// dataSet contains the parsed elements. Each element is available via a property
// in the dataSet.elements object. The property name is based on the elements group
// and element in the following format: xggggeeee where gggg is the group number
// and eeee is the element number with lowercase hex characters.
// To access the data for an element, we need to know its type and its tag.
// We will get the sopInstanceUid from the file which is a string and
// has the tag (0020,000D)
var study_description = dataSet.string('x00081030').toLowerCase();
console.log("STUDY", study_description);
// try to match with a study description (if not already selected)
if ($(`#id_examination_to option`).length < 1) {
option = $(`#id_examination_from option[title*='${study_description}' i]`);
if (option.length) {
option.appendTo($("#id_examination_to"));
toastr.success(`Examination set to ${option.attr('title')} from dicom data`);
} else {
toastr.warning(
`Unable to set examination ${study_description} from dicom data (it needs creating)`);
}
}
} catch (err) {
console.log(err);
}
}
</script>
{{ form.media }}
+3 -3
View File
@@ -23,10 +23,10 @@
{% for finding in series.findings.all %}
<div class="finding-box">
<button class="view-finding-button" data-annotationjson={{finding.annotation_json}} data-viewportjson={{finding.viewport_json}}>Click to view</button>
Findings: {{finding.findings.all|join:", "}}<br />
Structure: {{finding.structure.all|join:", "}}<br />
Finding(s): {{finding.findings.all|join:", "}}<br />
Structure(s): {{finding.structure.all|join:", "}}<br />
Description: {{finding.description}}<br />
<a href="{% url 'atlas:delete_finding' pk=finding.pk %}">Delete finding</a>
<a href="{% url 'atlas:delete_finding' pk=finding.pk %}" class="delete-finding-link">Delete finding</a>
</div>
{% endfor %}