{% extends "base.html" %} {% block title %}服藥觀察 S4-1{% endblock %} {% block content %}
← Inference 服藥觀察 · {{ obs.formula }} · ⏱ Day {{ obs.day }} v0.2.4 · 寫 session['medication_log']

{{ obs.formula }} — 服藥觀察 (S4-1)

{% if rag_analysis %}
典籍方證比較與加減建議 (RAG 七典 × LLM 分析)
{% if rag_analysis.relevance %}
相關性分析:{{ rag_analysis.relevance }}
{% endif %} {% if rag_analysis.suggestions %}
加減項建議:
{% endif %} {% if rag_hits %}
檢索到的典籍段落 ({{ rag_hits|length }}) {% for h in rag_hits %}
{{ h.book }}·{{ h.chapter }} {{ "%.0f"|format(h.score * 100) }}%
{{ h.text[:300] }}{% if h.text|length > 300 %}…{% endif %}
{% endfor %}
{% endif %}
{% elif rag_hits %}
典籍檢索段落 (LLM 分析不可用)
{% for h in rag_hits %}
{{ h.book }}·{{ h.chapter }} {{ "%.0f"|format(h.score * 100) }}%
{{ h.text[:400] }}
{% endfor %}
{% endif %} {% if med_log %}
📋 已記錄 {{ med_log|length }} 筆
{% for log in med_log %}
{{ log.node }} · {{ log.sweat }} · 症狀{{ log.symptom_change }} · 體溫 {{ log.temperature }}°C 脈 {{ log.pulse_rate }} 痛 {{ log.pain_scale }}/10 {% if log.notes %}
{{ log.notes }}{% endif %}
{% endfor %}
{% endif %}
Prescription & dosing
    {% for step in obs.sop %}
  1. {{ step.text }}
  2. {% endfor %}
⏹ STOP conditions: {% for c in obs.stop_conditions %} {{ c }} {% endfor %}
Observation timeline — 勾選目前節點
{% for n in obs.timeline_nodes %} {% endfor %}
汗出狀態 (中病即止核心)
{% for v, label in [('已汗', '✓ 已汗 (中病 → 停服)'), ('微汗', '微汗 (將癒)'), ('未汗', '未汗 (續服)'), ('大汗', '⚠ 大汗不止 (救逆)')] %} {% endfor %}
症狀變化
{% for v, label in [('better', '改善 ↓'), ('same', '持平 →'), ('worse', '加重 ↑ (救逆)')] %} {% endfor %}
Vital signs
備註 (自由記錄)
🚨 Escalation (符合任一條件請勾選)
← Inference
Trigger modification
Vital signs chart (demo {{ obs.vitals.temperature|length }} 筆)
體溫 °C
{% endblock %}