Add forms and views for subspecialty, presentation, and pathological process management
This commit is contained in:
@@ -40,6 +40,8 @@ from atlas.models import (
|
||||
Condition,
|
||||
Structure,
|
||||
Subspecialty,
|
||||
Presentation,
|
||||
PathologicalProcess,
|
||||
UncategorisedDicom,
|
||||
UserReportAnswer,
|
||||
CaseDisplaySet,
|
||||
@@ -333,6 +335,24 @@ class StructureForm(ModelForm):
|
||||
}
|
||||
|
||||
|
||||
class SubspecialtyForm(ModelForm):
|
||||
class Meta:
|
||||
model = Subspecialty
|
||||
exclude = []
|
||||
|
||||
|
||||
class PresentationForm(ModelForm):
|
||||
class Meta:
|
||||
model = Presentation
|
||||
exclude = []
|
||||
|
||||
|
||||
class PathologicalProcessForm(ModelForm):
|
||||
class Meta:
|
||||
model = PathologicalProcess
|
||||
exclude = []
|
||||
|
||||
|
||||
class SeriesFindingForm(ModelForm):
|
||||
class Meta:
|
||||
model = SeriesFinding
|
||||
|
||||
@@ -87,6 +87,9 @@
|
||||
<li><a class="dropdown-item" href="{% url 'atlas:condition_create' %}">New condition</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'atlas:finding_create' %}">New finding</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'atlas:structure_create' %}">New structure</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'atlas:subspecialty_create' %}">New subspecialty</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'atlas:presentation_create' %}">New presentation</a></li>
|
||||
<li><a class="dropdown-item" href="{% url 'atlas:pathological_process_create' %}">New pathological process</a></li>
|
||||
{% endif %}
|
||||
</ul>
|
||||
</li>
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
{% extends "atlas/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block js %}
|
||||
{{ form.media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Add / Edit Pathological process</h2>
|
||||
<p>Use this form to create or edit a pathological process.</p>
|
||||
<p>Please check if it already <a href='{% url "atlas:pathological_process_view" %}'>exists</a> before doing so!</p>
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data" id="pathological-process-form">
|
||||
{% csrf_token %}
|
||||
{% crispy form %}
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<a class="btn btn-secondary ms-2" href="{% url 'atlas:pathological_process_view' %}">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,23 @@
|
||||
{% extends "atlas/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block js %}
|
||||
{{ form.media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Add / Edit Presentation</h2>
|
||||
<p>Use this form to create or edit a presentation.</p>
|
||||
<p>Please check if it already <a href='{% url "atlas:presentation_view" %}'>exists</a> before doing so!</p>
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data" id="presentation-form">
|
||||
{% csrf_token %}
|
||||
{% crispy form %}
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<a class="btn btn-secondary ms-2" href="{% url 'atlas:presentation_view' %}">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -0,0 +1,23 @@
|
||||
{% extends "atlas/base.html" %}
|
||||
{% load crispy_forms_tags %}
|
||||
|
||||
{% block js %}
|
||||
{{ form.media }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
<h2>Add / Edit Subspecialty</h2>
|
||||
<p>Use this form to create or edit a subspecialty.</p>
|
||||
<p>Please check if it already <a href='{% url "atlas:subspecialty_view" %}'>exists</a> before doing so!</p>
|
||||
|
||||
<form action="" method="post" enctype="multipart/form-data" id="subspecialty-form">
|
||||
{% csrf_token %}
|
||||
{% crispy form %}
|
||||
|
||||
<div class="mt-3">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
<a class="btn btn-secondary ms-2" href="{% url 'atlas:subspecialty_view' %}">Cancel</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
{% endblock %}
|
||||
@@ -423,6 +423,7 @@ urlpatterns = [
|
||||
path(
|
||||
"subspecialty/<int:pk>", views.subspecialty_detail, name="subspecialty_detail"
|
||||
),
|
||||
path("subspecialty/create", views.SubspecialtyCreate.as_view(), name="subspecialty_create"),
|
||||
path("condition/create", views.ConditionCreate.as_view(), name="condition_create"),
|
||||
path("finding/", views.FindingView.as_view(), name="finding_view"),
|
||||
path("finding/<int:pk>", views.finding_detail, name="finding_detail"),
|
||||
@@ -596,6 +597,7 @@ urlpatterns = [
|
||||
path(
|
||||
"presentation/<int:pk>", views.presentation_detail, name="presentation_detail"
|
||||
),
|
||||
path("presentation/create", views.PresentationCreate.as_view(), name="presentation_create"),
|
||||
path(
|
||||
"process/",
|
||||
views.PathologicalProcessView.as_view(),
|
||||
@@ -606,6 +608,7 @@ urlpatterns = [
|
||||
views.pathological_process_detail,
|
||||
name="pathological_process_detail",
|
||||
),
|
||||
path("process/create", views.PathologicalProcessCreate.as_view(), name="pathological_process_create"),
|
||||
path("combine_series/", views.combine_series, name="combine_series"),
|
||||
path(
|
||||
"case/<int:case_id>/linked/",
|
||||
|
||||
@@ -83,6 +83,9 @@ from .forms import (
|
||||
SeriesFindingForm,
|
||||
CaseDifferentialFormSet,
|
||||
StructureForm,
|
||||
SubspecialtyForm,
|
||||
PresentationForm,
|
||||
PathologicalProcessForm,
|
||||
UserQuestionAnswerForm,
|
||||
UserReportAnswerForm,
|
||||
)
|
||||
@@ -1686,6 +1689,24 @@ class StructureCreate(RevisionMixin, LoginRequiredMixin, CreateView):
|
||||
form_class = StructureForm
|
||||
|
||||
|
||||
class SubspecialtyCreate(RevisionMixin, LoginRequiredMixin, CreateView):
|
||||
model = Subspecialty
|
||||
form_class = SubspecialtyForm
|
||||
template_name = "atlas/subspecialty_form.html"
|
||||
|
||||
|
||||
class PresentationCreate(RevisionMixin, LoginRequiredMixin, CreateView):
|
||||
model = Presentation
|
||||
form_class = PresentationForm
|
||||
template_name = "atlas/presentation_form.html"
|
||||
|
||||
|
||||
class PathologicalProcessCreate(RevisionMixin, LoginRequiredMixin, CreateView):
|
||||
model = PathologicalProcess
|
||||
form_class = PathologicalProcessForm
|
||||
template_name = "atlas/pathological_process_form.html"
|
||||
|
||||
|
||||
class AtlasCreateBase(RevisionMixin, LoginRequiredMixin):
|
||||
model = Case
|
||||
form_class = CaseForm
|
||||
|
||||
Reference in New Issue
Block a user