// data.jsx — copy strings, booking data, questionnaire, care options
// Bilingual TC + EN data model.

const COPY = {
  brand: { en: "Mobile Medical", tc: "美邦" },
  brandSub: { en: "Body Check Centre", tc: "身體檢查中心" },
  steps: [
    { en: "Check-in", tc: "登記" },
    { en: "Itinerary", tc: "行程確認" },
    { en: "Health Profile", tc: "健康問卷" },
    { en: "Care Options", tc: "跟進建議" },
    { en: "All Set", tc: "完成" },
  ],
};

// --- Booked items for today's package ----------------------------------------
const BOOKED_PACKAGE = {
  name: { en: "Premier Wellness Programme", tc: "尊尚全面身體檢查計劃" },
  code: "PWP-3",
  duration: "2h 40m",
  fasting: true,
};

const BOOKED_ITEMS = [
  { cat: { en: "Consultation", tc: "醫生諮詢" }, name: { en: "Pre-Check Consultation", tc: "檢前醫生會診" }, dur: "15 min", room: "C-04", done: true },
  { cat: { en: "Vitals", tc: "基本檢查" }, name: { en: "Anthropometry & Vitals", tc: "身高體重・血壓・脈搏" }, dur: "10 min", room: "V-01", done: true },
  { cat: { en: "Imaging", tc: "影像檢查" }, name: { en: "Chest X-Ray (PA)", tc: "胸肺 X 光" }, dur: "10 min", room: "I-12" },
  { cat: { en: "Imaging", tc: "影像檢查" }, name: { en: "Abdominal Ultrasound", tc: "上腹部超聲波掃描" }, dur: "20 min", room: "I-08" },
  { cat: { en: "Cardiology", tc: "心臟檢查" }, name: { en: "Resting ECG", tc: "靜態心電圖" }, dur: "15 min", room: "K-02" },
  { cat: { en: "Laboratory", tc: "化驗" }, name: { en: "Comprehensive Blood Panel", tc: "全面血液化驗" }, dur: "10 min", room: "L-01" },
  { cat: { en: "Laboratory", tc: "化驗" }, name: { en: "Urinalysis", tc: "小便常規" }, dur: "5 min", room: "L-02" },
  { cat: { en: "Vision & Hearing", tc: "視聽檢查" }, name: { en: "Visual Acuity & Tonometry", tc: "視力及眼壓測試" }, dur: "15 min", room: "V-04" },
  { cat: { en: "Bone Density", tc: "骨質檢查" }, name: { en: "DEXA Scan", tc: "骨質密度掃描" }, dur: "20 min", room: "I-15" },
  { cat: { en: "Consultation", tc: "醫生諮詢" }, name: { en: "Post-Check Doctor Review", tc: "檢後醫生講解" }, dur: "30 min", room: "C-04" },
];

const CHILD_BOOKED_PACKAGE = {
  name: { en: "Child Wellness Programme", tc: "兒童健康檢查計劃" },
  code: "CWP-1",
  duration: "1h 45m",
  fasting: false,
};

const CHILD_BOOKED_ITEMS = [
  { cat: { en: "Paediatrics", tc: "兒科" }, name: { en: "Paediatric Pre-Check Consultation", tc: "兒科檢前會診" }, dur: "20 min", room: "P-02", done: true },
  { cat: { en: "Vitals", tc: "基本檢查" }, name: { en: "Height, Weight & Growth Percentile", tc: "身高體重及生長百分位" }, dur: "10 min", room: "V-02", done: true },
  { cat: { en: "Laboratory", tc: "化驗" }, name: { en: "Child Blood Panel", tc: "兒童血液化驗" }, dur: "10 min", room: "L-01" },
  { cat: { en: "Vision & Hearing", tc: "視聽檢查" }, name: { en: "Child Vision & Hearing Screen", tc: "兒童視力及聽力測試" }, dur: "15 min", room: "V-04" },
  { cat: { en: "Development", tc: "發展評估" }, name: { en: "Development Milestone Review", tc: "發展里程碑評估" }, dur: "20 min", room: "P-03" },
  { cat: { en: "Paediatrics", tc: "兒科" }, name: { en: "Paediatric Doctor Review", tc: "兒科醫生講解" }, dur: "30 min", room: "P-02" },
];

// --- Questionnaire sections (dynamic later) ----------------------------------
const Q_SECTIONS = [
  { id: "preexam", en: "Pre-Exam Clinical Info", tc: "體檢前臨床資料" },
  { id: "femaleHealth", en: "Women's Health", tc: "婦科健康" },
  { id: "recent", en: "Recent Health Status", tc: "最近健康狀況" },
  { id: "childHealth", en: "Child Health", tc: "兒童健康" },
  { id: "history", en: "Medical & Family History", tc: "病歷及家族病歷" },
  { id: "ultrasound", en: "Previous Ultrasound", tc: "過往超聲波紀錄" },
  { id: "safety", en: "Safety & Consent", tc: "安全確認及同意" },
  { id: "review", en: "Review", tc: "覆核" },
];

// --- Patient-facing care options ---------------------------------------------
const RECOMMENDATIONS = [
  {
    id: "og-lmp",
    ruleId: "OG-Q-LMP",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G menstrual disorder assessment package", tc: "Prima O&G 月經失調評估套餐" },
    why: {
      en: "You indicated that your last menstrual period was more than 3 months ago. A women's health doctor can help review possible hormonal or gynaecological causes.",
      tc: "您表示最後一次月經已超過 3 個月。婦科醫生可協助評估是否與荷爾蒙或婦科情況有關。",
    },
    img: "WOMEN'S HEALTH",
    dur: "Menstrual assessment",
    fasting: false,
    sample: "O&G package",
    price: 0,
    fee: "HK$1,200–1,800",
    triggers: { gender: "female", lmpOver3m: true, menopause: "no" },
    featured: true,
  },
  {
    id: "og-irregular-cycle",
    ruleId: "OG-Q-IRREGULAR-CYCLE",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G menstrual disorder assessment package", tc: "Prima O&G 月經失調評估套餐" },
    why: {
      en: "You indicated that your menstrual cycle is clearly irregular. A women's health doctor can help review possible hormonal or gynaecological causes.",
      tc: "您表示月經週期明顯不規律。婦科醫生可協助評估是否與荷爾蒙或婦科情況有關。",
    },
    img: "WOMEN'S HEALTH",
    dur: "Cycle review",
    fasting: false,
    sample: "O&G package",
    price: 0,
    fee: "HK$1,200–1,800",
    triggers: { gender: "female", irregularCycle: true },
  },
  {
    id: "og-pap",
    ruleId: "OG-Q-PAP",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G Pap smear", tc: "Prima O&G 子宮頸抹片" },
    why: {
      en: "You indicated that your last Pap smear was more than 3 years ago or that you have not had one before. Our team can explain whether screening is suitable today.",
      tc: "您表示上次子宮頸抹片檢查已超過 3 年或未曾檢查。醫護團隊可為您解釋今天是否適合安排。",
    },
    img: "CERVICAL SCREENING",
    dur: "Pap smear",
    fasting: false,
    sample: "Screening service",
    price: 0,
    fee: "HK$1,200–1,800",
    triggers: { gender: "female", papOverdue: true },
  },
  {
    id: "og-pregnancy-plan",
    ruleId: "OG-Q-PREGNANCY-PLAN",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G pre-pregnancy assessment package", tc: "Prima O&G 備孕全面評估套餐" },
    why: {
      en: "You indicated that you may plan pregnancy within the next year. A clinician can explain pre-pregnancy checks that may be relevant.",
      tc: "您表示可能計劃在未來一年懷孕。醫護人員可為您解釋相關的孕前檢查。",
    },
    img: "PRE-PREGNANCY",
    dur: "Pre-pregnancy assessment",
    fasting: false,
    sample: "O&G package",
    price: 0,
    fee: "HK$2,200–3,500",
    triggers: { gender: "female", pregnancyPlan: true },
  },
  {
    id: "og-abnormal-bleeding",
    ruleId: "OG-Q-ABNORMAL-BLEEDING",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G urgent gynaecology assessment clinic", tc: "Prima O&G 婦科急症評估門診" },
    why: {
      en: "You indicated bleeding outside your menstrual period or abnormal discharge. Our clinical team can help arrange an appropriate review.",
      tc: "您表示有非月經期間出血或不正常分泌物。醫護團隊可協助安排合適評估。",
    },
    img: "TIMELY REVIEW",
    dur: "Priority follow-up",
    fasting: false,
    sample: "O&G clinic",
    price: 0,
    fee: "HK$1,000–1,500",
    triggers: { gender: "female", abnormalBleeding: true },
  },
  {
    id: "og-menopause-symptoms",
    ruleId: "OG-Q-MENOPAUSE-SYMPTOMS",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G menopause hormone management plan", tc: "Prima O&G 更年期荷爾蒙管理計劃" },
    why: {
      en: "You indicated symptoms such as hot flashes, night sweats, or mood changes. A clinician can help review whether menopause-related support is suitable.",
      tc: "您表示有潮熱、夜間盜汗或情緒波動等症狀。醫護人員可協助評估是否適合更年期相關支援。",
    },
    img: "MENOPAUSE HEALTH",
    dur: "HRT discussion",
    fasting: false,
    sample: "O&G plan",
    price: 0,
    fee: "HK$1,500–2,200",
    triggers: { gender: "female", minAge: 40, menopauseSymptoms: true },
  },
  {
    id: "og-pelvic-pain",
    ruleId: "OG-Q-PELVIC-PAIN",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G pelvic pain assessment package + ultrasound", tc: "Prima O&G 盆腔痛評估套餐 + 超聲波" },
    why: {
      en: "You indicated persistent lower abdominal pain or pain during intercourse. Our team can help arrange a suitable women's health review.",
      tc: "您表示有持續下腹痛或性交時疼痛。醫護團隊可協助安排合適的婦科評估。",
    },
    img: "TIMELY REVIEW",
    dur: "Priority follow-up",
    fasting: false,
    sample: "O&G package",
    price: 0,
    fee: "HK$1,500–2,200",
    triggers: { gender: "female", pelvicPain: true },
  },
  {
    id: "og-breast-symptom",
    ruleId: "OG-Q-BREAST-SYMPTOM",
    cat: { en: "Breast Health", tc: "乳房健康" },
    name: { en: "Prima O&G consultation + breast ultrasound", tc: "Prima O&G 婦科門診 + 乳房超聲波" },
    why: {
      en: "You indicated a breast lump, pain, or abnormal nipple discharge. Our team can help arrange the most appropriate review.",
      tc: "您表示乳房有硬塊、疼痛或乳頭異常分泌物。醫護團隊可協助安排最合適的評估。",
    },
    img: "BREAST HEALTH",
    dur: "Priority follow-up",
    fasting: false,
    sample: "O&G + imaging",
    price: 0,
    fee: "HK$1,500–2,200",
    triggers: { gender: "female", breastSymptom: true },
  },
  {
    id: "ped-child-present",
    ruleId: "PED-Q-CHILD-PRESENT",
    cat: { en: "Child Health", tc: "兒童健康" },
    name: { en: "PrimeCare paediatrics outpatient clinic (first visit)", tc: "PrimeCare 兒科門診（首診）" },
    why: {
      en: "You indicated that a child under 18 is also attending for examination. Our team can share same-day child health support options.",
      tc: "您表示有 18 歲以下小童同日受檢。醫護團隊可介紹同日兒童健康支援選項。",
    },
    img: "CHILD HEALTH",
    dur: "Same-day booking available",
    fasting: false,
    sample: "Paediatrics clinic",
    price: 0,
    fee: "HK$900–1,500",
    triggers: { childAttending: true },
  },
  {
    id: "ped-allergy",
    ruleId: "PED-Q-ALLERGY",
    cat: { en: "Child Health", tc: "兒童健康" },
    name: { en: "PrimeCare child allergy assessment package", tc: "PrimeCare 兒童過敏評估套餐" },
    why: {
      en: "You indicated recurrent respiratory infection, asthma, eczema, or food allergy for the child. A paediatric clinician can advise suitable follow-up.",
      tc: "您表示小童有反覆呼吸道感染、哮喘、濕疹或食物過敏。兒科醫護人員可建議合適跟進。",
    },
    img: "PAEDIATRICS",
    dur: "Allergy assessment",
    fasting: false,
    sample: "Paediatrics package",
    price: 0,
    fee: "HK$900–1,200",
    triggers: { childAttending: true, childAllergy: true },
  },
  {
    id: "ped-growth",
    ruleId: "PED-Q-GROWTH",
    cat: { en: "Child Health", tc: "兒童健康" },
    name: { en: "PrimeCare child growth and development assessment", tc: "PrimeCare 兒童生長發育評估" },
    why: {
      en: "You indicated concern about the child's growth, development, or weight. A paediatric clinician can review this with you.",
      tc: "您表示關注小童的生長發育或體重。兒科醫護人員可與您進一步了解。",
    },
    img: "PAEDIATRICS",
    dur: "Growth review",
    fasting: false,
    sample: "Paediatrics assessment",
    price: 0,
    fee: "HK$1,800",
    triggers: { childAttending: true, childGrowth: true },
  },
  {
    id: "ped-development",
    ruleId: "PED-Q-DEVELOPMENT",
    cat: { en: "Child Health", tc: "兒童健康" },
    name: { en: "PrimeCare child developmental assessment package", tc: "PrimeCare 兒童發展評估套餐" },
    why: {
      en: "You indicated that the child's language, social, or motor development may be slower than peers. A paediatric clinician can advise next steps.",
      tc: "您表示小童的語言、社交或動作發展可能較同齡兒童慢。兒科醫護人員可建議下一步。",
    },
    img: "PAEDIATRICS",
    dur: "Development review",
    fasting: false,
    sample: "Paediatrics package",
    price: 0,
    fee: "HK$1,200–1,800",
    triggers: { childAttending: true, childDevelopment: true },
  },
  {
    id: "og-early-menopause",
    ruleId: "OG-Q-EARLY-MENOPAUSE",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G early menopause comprehensive assessment", tc: "Prima O&G 早發更年期全面評估" },
    why: {
      en: "Menopause at a younger age may affect bone and cardiovascular health. We recommend discussing this with a women's health doctor.",
      tc: "較早停經可能影響骨骼及心血管健康，建議與婦科醫生進一步了解。",
    },
    img: "TIMELY REVIEW",
    dur: "Priority follow-up",
    fasting: false,
    sample: "O&G package",
    price: 0,
    fee: "HK$1,800–2,500",
    triggers: { gender: "female", menopause: "yes", maxAge: 44 },
  },
  {
    id: "og-family-cancer",
    ruleId: "OG-Q-FAMILY-CANCER",
    cat: { en: "Women's Health", tc: "婦女健康" },
    name: { en: "Prima O&G hereditary tumour high-risk screening package", tc: "Prima O&G 遺傳性腫瘤高風險篩查套餐" },
    why: {
      en: "You indicated a first-degree family history of breast cancer. A clinician can advise whether a more personalised screening plan is appropriate.",
      tc: "您表示一等親有乳癌家族病史。醫護人員可為您評估是否需要較個人化的篩查安排。",
    },
    img: "BREAST HEALTH",
    dur: "High-risk screening",
    fasting: false,
    sample: "O&G package",
    price: 0,
    fee: "HK$2,500–4,000",
    triggers: { gender: "female", familyBreast: true },
  },
  {
    id: "safety-gate",
    ruleId: "Q8-SAFETY-GATE",
    cat: { en: "Safety Review", tc: "安全評估" },
    name: { en: "Clinical safety review before examination", tc: "檢查前臨床安全評估" },
    why: {
      en: "One or more answers may affect which examinations are suitable today. Our clinical team will review this with you before proceeding.",
      tc: "您的一項或多項答案可能影響今天適合進行的檢查。醫護團隊會先與您覆核。",
    },
    img: "SAFETY REVIEW",
    dur: "Before examination",
    fasting: false,
    sample: "Clinical team",
    price: 0,
    triggers: { safetyAny: true },
  },
];

// --- Executive / CEO deck: static scope story (Vercel; no backend) ----------------
// Lab rule count matches the team’s rule CSV scale (rule-demo/test_rule_excel_oct16.csv).
const EXECUTIVE_LAB_RULE_ROWS = 160;

const EXECUTIVE_FRAMEWORK = {
  eyebrow: { en: "Scope & rigour", tc: "範圍與嚴謹度" },
  title: { en: "A single framework for data and rules", tc: "數據與規則一體化框架" },
  lede: {
    en: "We register every input, map it to stable signals, apply clinically owned rules, and only then show patients clear follow-up options. The same thinking covers lab results, questionnaires, and specialist playbooks — not a one-off form.",
    tc: "我們把每項輸入登記在案、對應成可追蹤訊號、再按臨床擁有的規則處理，最後才向客人呈現清晰的跟進建議。化驗、問卷與專科路線圖沿用同一套方法，而不是單次表格。",
  },
  pipeline: [
    {
      id: "sources",
      en: "Sources",
      tc: "來源",
      detail: { en: "Questionnaires (EN / ZH / v3), LIS extracts, specialist PDFs", tc: "問卷（中／英／v3）、化驗數據、專科 PDF 原件" },
    },
    {
      id: "signals",
      en: "Signals",
      tc: "訊號",
      detail: { en: "Stable Field IDs, normalised lab keys, branching / skip logic", tc: "固定 Field ID、標準化化驗代碼、分支／跳題邏輯" },
    },
    {
      id: "rules",
      en: "Rules",
      tc: "規則",
      detail: { en: "O&G & paediatrics catalogues, lab rule book, safety gates", tc: "婦科／兒科規則表、化驗規則庫、安全關卡" },
    },
    {
      id: "outcomes",
      en: "Outcomes",
      tc: "輸出",
      detail: { en: "Patient wording, reference fees (v1.3), clinician review", tc: "病人用語、參考價（v1.3）、醫生覆核" },
    },
  ],
  metrics: [
    {
      n: 9,
      label: { en: "Wiki articles (Git)", tc: "Wiki 文章（Git）" },
      hint: { en: "Methodology, maps, rules, surveys", tc: "方法論、對照表、規則、問卷" },
    },
    {
      n: 7,
      label: { en: "Registered PDF sources", tc: "登記 PDF 來源" },
      hint: { en: "Questionnaires + rule guides", tc: "問卷與規則指引" },
    },
    {
      n: EXECUTIVE_LAB_RULE_ROWS,
      label: { en: "Lab rule catalogue (rows)", tc: "化驗規則庫（列）" },
      hint: { en: "Example batch — Key × Result paths", tc: "示例批次 — 代碼×結果 路徑" },
    },
    {
      n: RECOMMENDATIONS.length,
      label: { en: "Care option templates", tc: "跟進建議模板" },
      hint: { en: "Mapped to rule IDs in this demo", tc: "本示範對應規則 ID" },
    },
  ],
  pillars: [
    {
      title: { en: "Breadth of inputs", tc: "輸入廣度" },
      body: {
        en: "Pre-exam intake, women’s and child branches, family history, safety — plus laboratory bands and flags in the operational rule engine.",
        tc: "體檢前問卷、婦科與兒童分支、家族病史與安全確認 — 另配合日常營運中的化驗規則引擎（數值帶與標記）。",
      },
    },
    {
      title: { en: "Traceability", tc: "可追溯" },
      body: {
        en: "Source register, versioned Markdown wiki, and explicit rule IDs so clinical and data teams audit the same chain.",
        tc: "來源登記、版本化 Markdown 知識庫及明確規則 ID，讓臨床與數據團隊覆核同一條鏈。",
      },
    },
    {
      title: { en: "Governance", tc: "管治" },
      body: {
        en: "Separation of patient answers, lab facts, and VAS actions — documented in methodology so AI and humans stay aligned.",
        tc: "區分病人自述、化驗事實與增值服務動作 — 方法論有記載，方便 AI 與真人對齊。",
      },
    },
    {
      title: { en: "CEO-ready narrative", tc: "面向管理層" },
      body: {
        en: "One story: comprehensive data discipline, not scattershot automation — suitable for boardrooms and department heads.",
        tc: "同一套敘事：數據與規則有章法，而非零碎自動化 — 適合向董事會及部門主管展示。",
      },
    },
  ],
  threeLenses: {
    title: { en: "How teams read the same system", tc: "不同角色如何閱讀同一系統" },
    items: [
      {
        title: { en: "System & cohort", tc: "系統／群組" },
        body: {
          en: "Coverage counts, rule breadth, and where inputs sit in the knowledge tree.",
          tc: "涵蓋範圍、規則廣度，以及輸入在知識樹中的位置。",
        },
      },
      {
        title: { en: "Patient journey", tc: "客人旅程" },
        body: {
          en: "This tablet flow — check-in, questionnaire branching, care options — illustrates signal capture end to end.",
          tc: "平板流程 — 登記、問卷分支、跟進建議 — 展示訊號如何端到端收集。",
        },
      },
      {
        title: { en: "Rule & source", tc: "規則與原件" },
        body: {
          en: "Each recommendation traces to a documented rule line and PDF / wiki source for doctors who ask “why”.",
          tc: "每項建議可對應到文件化的規則列與 PDF／Wiki 原件，方便醫生追問「為何」。",
        },
      },
    ],
  },
  footnote: {
    en: "This screen summarises our operating model. The following steps demonstrate the guest experience; the Knowledge Wiki step lists Git-linked sources. Lab batch rules run in the operational engine — numbers above reflect our current catalogue scale.",
    tc: "此頁概述運作模式；隨後步驟示範客人體驗；知識庫步驟列出 Git 連結來源。化驗批次規則在營運引擎執行 — 上方數字反映現有目錄規模。",
  },
};

window.COPY = COPY;
window.BOOKED_PACKAGE = BOOKED_PACKAGE;
window.BOOKED_ITEMS = BOOKED_ITEMS;
window.CHILD_BOOKED_PACKAGE = CHILD_BOOKED_PACKAGE;
window.CHILD_BOOKED_ITEMS = CHILD_BOOKED_ITEMS;
window.Q_SECTIONS = Q_SECTIONS;
window.RECOMMENDATIONS = RECOMMENDATIONS;
window.EXECUTIVE_FRAMEWORK = EXECUTIVE_FRAMEWORK;
window.EXECUTIVE_LAB_RULE_ROWS = EXECUTIVE_LAB_RULE_ROWS;
