{% extends "layouts/base.html" %} {% load i18n %} {% block title %}{% if template %}Edit {{ template.name }}{% else %}Create Journey Template{% endif %} - PX360{% endblock %} {% block extra_css %} {% endblock %} {% block content %}
{% trans "Back to Templates" %}

{% if template %} {% trans "Edit" %} {{ template.name }} {% else %} {% trans "Create Journey Template" %} {% endif %}

{% trans "Define stages and surveys for patient journeys" %}

{% csrf_token %}

{% trans "Template Details" %}

{{ form.name }} {% if form.name.errors %}
{{ form.name.errors }}
{% endif %}
{{ form.name_ar }} {% if form.name_ar.errors %}
{{ form.name_ar.errors }}
{% endif %}
{{ form.journey_type }} {% if form.journey_type.errors %}
{{ form.journey_type.errors }}
{% endif %}
{{ form.hospital }} {% if form.hospital.errors %}
{{ form.hospital.errors }}
{% endif %}
{{ form.is_active }}
{% if form.is_active.errors %}
{{ form.is_active.errors }}
{% endif %}
{{ form.send_post_discharge_survey }}
{% if form.send_post_discharge_survey.errors %}
{{ form.send_post_discharge_survey.errors }}
{% endif %}
{{ form.post_discharge_survey_delay_hours }} {% if form.post_discharge_survey_delay_hours.errors %}
{{ form.post_discharge_survey_delay_hours.errors }}
{% endif %}
{% trans "Hours after discharge to send the survey" %}
{{ form.description }} {% if form.description.errors %}
{{ form.description.errors }}
{% endif %}

{% trans "Journey Stages" %}

{{ formset.management_form }}
{% for form in formset %} {{ form.id }} {% endfor %}
{% trans "Order" %} {% trans "Name (EN)" %} {% trans "Code" %} {% trans "Trigger Event" %} {% trans "Survey" %} {% trans "Opt" %} {% trans "Act" %} {% trans "Actions" %}
{{ form.order }} {{ form.name }} {{ form.name_ar }} {{ form.code }} {{ form.trigger_event_code }} {{ form.survey_template }}
{{ form.is_optional }}
{{ form.is_active }}
{% trans "Stages" %}: {% trans "Define stages for patient journeys. Each stage has a trigger event code that completes the stage. Survey templates assigned here will have their questions merged into the post-discharge survey." %}
{% trans "Stages will be executed in order. After creating the template, you can assign surveys to each stage." %}
{% trans "Cancel" %}
{% endblock %} {% block extra_js %} {% endblock %}