From c99fb5a3d6c8f9dd1b188f7e778ac5819f9c9cde Mon Sep 17 00:00:00 2001 From: Ross Date: Mon, 12 Jun 2023 16:31:08 +0100 Subject: [PATCH] Start improving atlas forms --- atlas/forms.py | 5 +++++ atlas/templates/atlas/series_form.html | 7 +++++-- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/atlas/forms.py b/atlas/forms.py index fc8eb7fa..4bdb6e27 100755 --- a/atlas/forms.py +++ b/atlas/forms.py @@ -1,3 +1,4 @@ +from django import forms from django.contrib.admin import widgets from django.forms import ( BaseInlineFormSet, @@ -9,6 +10,7 @@ from django.forms import ( CharField, ValidationError, modelformset_factory, + CheckboxSelectMultiple ) from django.forms import inlineformset_factory from django.shortcuts import get_object_or_404 @@ -25,6 +27,7 @@ from atlas.models import ( SeriesFinding, Condition, Structure, + Subspecialty, ) from anatomy.models import Modality @@ -315,6 +318,8 @@ class CaseForm(ModelForm): "presentation": autocomplete.ModelSelect2Multiple( url="atlas:presentation-autocomplete" ), + "subspecialty": CheckboxSelectMultiple(), + "pathological_process": CheckboxSelectMultiple() } def save(self, commit=True): diff --git a/atlas/templates/atlas/series_form.html b/atlas/templates/atlas/series_form.html index 5a291e66..52b03afb 100755 --- a/atlas/templates/atlas/series_form.html +++ b/atlas/templates/atlas/series_form.html @@ -318,10 +318,13 @@ } else { - toastr.info(`Unable to automatically set modality: ${modality}`) + toastr.info(`Unable to automatically set modality: ${modality}`); } - to_replace = ["lt", "rt", "contrast", "LT", "RT", "Contrast"] + // If the dicom study_description contains multiple values select the first + study_description = study_description.split(",")[0].trim(); + + to_replace = ["lt", "rt", "contrast", "LT", "RT", "Contrast"]; for (let i = 0; i < to_replace.length; i++) {