{
  "template": {
    "code": "diabetes_core",
    "name": "Diabetes assessment",
    "category": "disease",
    "version": 1,
    "is_current": true,
    "is_active": true,
    "scoring_strategy": null,
    "description": "Core diabetes review: glycaemia, feet, eyes, kidney markers, lifestyle, and insulin regimen.",
    "meta": {
      "capture_roles": ["doctor", "nurse"],
      "specialty": "endocrinology",
      "estimated_minutes": 12,
      "pathway_codes": ["diabetes"],
      "attribution": "Ladill Care diabetes core assessment (platform-authored checklist aligned to common clinic review items)."
    }
  },
  "questions": [
    {
      "code": "hba1c",
      "section": "Glycaemia",
      "label": "HbA1c (%)",
      "help_text": "Optional manual entry. Prefer lab results when available.",
      "answer_type": "number",
      "is_required": false,
      "sort_order": 10,
      "options": { "min": 3, "max": 20, "unit": "%" },
      "validation": { "min": 3, "max": 20 }
    },
    {
      "code": "hba1c_date",
      "section": "Glycaemia",
      "label": "HbA1c date",
      "answer_type": "date",
      "is_required": false,
      "sort_order": 20
    },
    {
      "code": "hypoglycaemia_episodes",
      "section": "Glycaemia",
      "label": "Hypoglycaemia episodes (last 3 months)",
      "answer_type": "integer",
      "is_required": false,
      "sort_order": 30,
      "options": { "min": 0, "max": 100 },
      "validation": { "min": 0, "max": 100 }
    },
    {
      "code": "insulin_regimen",
      "section": "Treatment",
      "label": "Insulin regimen",
      "answer_type": "textarea",
      "is_required": false,
      "sort_order": 40,
      "validation": { "max": 2000 }
    },
    {
      "code": "diet_adherence",
      "section": "Treatment",
      "label": "Diet adherence",
      "answer_type": "single_choice",
      "is_required": false,
      "sort_order": 50,
      "options": {
        "choices": [
          { "code": "good", "label": "Good" },
          { "code": "fair", "label": "Fair" },
          { "code": "poor", "label": "Poor" },
          { "code": "unknown", "label": "Unknown" }
        ]
      }
    },
    {
      "code": "foot_assessment",
      "section": "Complications",
      "label": "Foot assessment",
      "answer_type": "single_choice",
      "is_required": true,
      "sort_order": 60,
      "options": {
        "choices": [
          { "code": "normal", "label": "Normal" },
          { "code": "at_risk", "label": "At risk" },
          { "code": "ulcer", "label": "Ulcer present" },
          { "code": "amputation", "label": "Prior amputation" },
          { "code": "not_examined", "label": "Not examined" }
        ]
      }
    },
    {
      "code": "monofilament",
      "section": "Complications",
      "label": "Monofilament test",
      "answer_type": "single_choice",
      "is_required": false,
      "sort_order": 70,
      "options": {
        "choices": [
          { "code": "intact", "label": "Sensation intact" },
          { "code": "reduced", "label": "Reduced" },
          { "code": "absent", "label": "Absent" },
          { "code": "not_done", "label": "Not done" }
        ]
      }
    },
    {
      "code": "eye_examination",
      "section": "Complications",
      "label": "Eye examination / retinopathy status",
      "answer_type": "single_choice",
      "is_required": false,
      "sort_order": 80,
      "options": {
        "choices": [
          { "code": "normal", "label": "No retinopathy" },
          { "code": "non_proliferative", "label": "Non-proliferative" },
          { "code": "proliferative", "label": "Proliferative" },
          { "code": "maculopathy", "label": "Maculopathy" },
          { "code": "unknown", "label": "Unknown / pending" },
          { "code": "not_done", "label": "Not examined this visit" }
        ]
      }
    },
    {
      "code": "microalbuminuria",
      "section": "Complications",
      "label": "Microalbuminuria / ACR",
      "answer_type": "single_choice",
      "is_required": false,
      "sort_order": 90,
      "options": {
        "choices": [
          { "code": "normal", "label": "Normal" },
          { "code": "elevated", "label": "Elevated" },
          { "code": "unknown", "label": "Unknown" },
          { "code": "not_done", "label": "Not done" }
        ]
      }
    },
    {
      "code": "neuropathy_score",
      "section": "Complications",
      "label": "Neuropathy score (0–10 clinical impression)",
      "answer_type": "scale",
      "is_required": false,
      "sort_order": 100,
      "options": { "min": 0, "max": 10 },
      "validation": { "min": 0, "max": 10 }
    },
    {
      "code": "notes",
      "section": "Notes",
      "label": "Clinical notes",
      "answer_type": "textarea",
      "is_required": false,
      "sort_order": 110,
      "validation": { "max": 5000 }
    }
  ]
}
