{% extends 'base.html' %} {% load static %} {% block title %}{% if metric %}Edit Metric Definition{% else %}Create Metric Definition{% endif %} - Hospital Management{% endblock %} {% block content %}
{% csrf_token %}
Basic Information
Formula Configuration
Use mathematical expressions and field references. Example: (field1 + field2) / field3 * 100
Advanced: Custom SQL query for complex calculations. Leave empty to use formula above.
Parameters
{% if metric.parameters %} {% for param in metric.parameters %}
{% endfor %} {% endif %}
{% if not metric.parameters %}

No parameters defined. Click "Add Parameter" to create configurable parameters for this metric.

{% endif %}
Display Configuration
Tags & Metadata
Use tags to organize and categorize metrics. Separate multiple tags with commas.
Formula Validation
Test Calculation
{% if metric %} {% endif %} Cancel
Help
Metric Types:
  • Count: Simple counting metrics
  • Percentage: Ratio expressed as percentage
  • Average: Mean value calculation
  • Sum: Total aggregation
  • Ratio: Division of two values
  • Custom: Complex custom formulas
Formula Examples:
  • COUNT(*) - Count records
  • (A / B) * 100 - Percentage
  • SUM(field) - Total sum
  • AVG(field) - Average value
{% endblock %}