臺灣健保預檢規則實作指引
0.0.1 - CI Build

臺灣健保預檢規則實作指引, published by Example Publisher. This guide is not an authorized publication; it is the continuous build for version 0.0.1 built by the FHIR (HL7® FHIR® Standard) CI Build. This version is based on the current content of https://github.com/TWNHIFHIR/cql/ and changes regularly. See the Directory of published versions

Library: 大腸直腸癌_Panitumumab給付規定

Official URL: https://nhicore.nhi.gov.tw/cql/Library/CRCPanitumumabRule1 Version: 1.0.0
Draft as of 2025-12-09 Computable Name: CRCPanitumumabRule1

此 Library 為轉移性大腸或直腸癌病人申請使用 Panitumumab 之給付檢核條件。

Metadata
Title 大腸直腸癌_Panitumumab給付規定
Version 1.0.0
Status Draft
Description

此 Library 為轉移性大腸或直腸癌病人申請使用 Panitumumab 之給付檢核條件。

Type logic-library from http://terminology.hl7.org/CodeSystem/library-type
Parameters
Parameter None
Library Content
CQL Content
//大腸直腸_Panitumumab給付規定
library CRCPanitumumabRule1 version '1.0.0'

using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1' called FHIRHelpers

include CRCCodeConcept version '1.0.0' called CodeConcept

include Reusable version '1.0.0' called Reusable
 
context Patient

//============================================
// 申請類型判斷
//============================================

define "初次申請":
  "申請類型" = '初次使用'

define "續用申請":
  "申請類型" = '續用'

define "申請類型未知":
  "申請類型" = '無法判斷申請類型'

define "申請類型":
  case
    when Reusable."續用註記為1" then '初次使用'
    when Reusable."續用註記為2" then '續用'
    else '無法判斷申請類型'
  end


//============================================
// 主要規定一:初次使用條件
//============================================

/*規則1*/
//條件1
define "規則1-1=初次使用Panitumumab需與FOLFOX(folinicacid/5-fluorouracil/oxaliplatin)合併使用":
  (
    // 存在 Fluorouracil 處方
    exists (
      [MedicationRequest] MROrder1
      where MROrder1.intent = 'order'
      and exists (
        MROrder1.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and Cdg.code in CodeConcept.L01BC02
      )
      and Reusable."HasValidTiming"(MROrder1)
    )
    and
    // 存在 Oxaliplatin 處方  
    exists (
      [MedicationRequest] MROrder2
      where MROrder2.intent = 'order'
      and exists (
        MROrder2.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and Cdg.code in CodeConcept.L01XA03
      )
      and Reusable."HasValidTiming"(MROrder2)
    )
    and
    // Panitumumab 申請
    exists (
      [MedicationRequest] MRPlan
      where MRPlan.intent = 'plan'
      and exists (
        MRPlan.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and Cdg.code in CodeConcept.L01FE02
      )
    )
  )
  and Reusable."醫令類別為1"

//條件2
define "規則1-2=初次使用Panitumumab與FOLFIRI(folinic acid/ 5-fluorouracil/irinotecan)合併使用":
  (
    // 存在 Fluorouracil 處方
    exists (
      [MedicationRequest] MROrder1
      where MROrder1.intent = 'order'
      and exists (
        MROrder1.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and Cdg.code in CodeConcept.L01BC02
      )
      and Reusable."HasValidTiming"(MROrder1)
    )
    and
    // 存在 Irinotecan 處方  
    exists (
      [MedicationRequest] MROrder2
      where MROrder2.intent = 'order'
      and exists (
        MROrder2.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and Cdg.code in CodeConcept.L01CE02
      )
      and Reusable."HasValidTiming"(MROrder2)
    )
    and
    // Panitumumab 申請
    exists (
      [MedicationRequest] MRPlan
      where MRPlan.intent = 'plan'
      and exists (
        MRPlan.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and Cdg.code in CodeConcept.L01FE02
      )
    )
  )
  and Reusable."醫令類別為1"

define "規則1":
  "規則1-1=初次使用Panitumumab需與FOLFOX(folinicacid/5-fluorouracil/oxaliplatin)合併使用"
  or "規則1-2=初次使用Panitumumab與FOLFIRI(folinic acid/ 5-fluorouracil/irinotecan)合併使用"

/*規則2*/
define "規則2=K-RAS基因及N-RAS基因沒有突變":
  exists (
    [Observation] RasObs
    where RasObs.status = 'final'
    and exists (
      RasObs.code.coding Cdg
      where Cdg.code = '69548-6'
      and Cdg in CodeConcept.LOINC
    )
    and exists (
      RasObs.component C
      where exists (
        C.code.coding Cdg
        where Cdg.code in CodeConcept.GeneTest
      )
    )
    and exists (
      RasObs.interpretation.coding I
      where I.code = 'NEG'
    )
  )

/*規則3*/
//條件1
//Reusable."ICD-10使用C18、C19、C20、C21"
define "ICD代碼檢核_布林值": Reusable."ICD-10使用C18、C19、C20、C21"

//條件2
define "規則3-2=三個月內有影像檢查報告":
  exists (
    [DiagnosticReport] O
    where exists (
      O.code.coding Cdg
      where (
        Cdg in CodeConcept.ICD10PCS2023Image
        or Cdg in CodeConcept.ICD10PCS2014Image
      )
      and Cdg.code in CodeConcept.ImageReportCode
    )
    and O.effective is not null
    and FHIRHelpers.ToDateTime(O.effective) >= Today() - 90 days
    and FHIRHelpers.ToDateTime(O.effective) <= Today()
  )

//條件3
define "規則3-3=癌症分期分數或結果為M1>=1":
  Count(
    [Observation] O
    where exists (
      O.code.coding Cdg
      where Cdg.code = '399390009'
        and Cdg in CodeConcept.SNOMED
    )
    and O.value is not null
    and O.value is FHIR.string
    and Matches((O.value as FHIR.string).value, '.*M[1-9].*')
  ) > 0

//條件4
define "規則3-4=三個月內有檢查報告":
  exists (
    [DiagnosticReport] O2
    where exists (
      O2.code.coding Cdg
      where Cdg in CodeConcept.LOINC
      and Cdg.code in CodeConcept.DiagnosticReport
    )
    and O2.effective is not null
    and FHIRHelpers.ToDateTime(O2.effective) >= Today() - 90 days
    and FHIRHelpers.ToDateTime(O2.effective) <= Today()
  ) 

//條件5
define "規則3-5=用藥線別為第一線":
  exists (
    [Claim] C
      where exists (
        C.item I
          where exists (
            I.modifier M
              where exists (
                M.coding Cdg
                  where Cdg in CodeConcept.NHILOT
                    and Cdg.code = '1'
              )
          )
      )
  )

define "規則3":
  Reusable."ICD-10使用C18、C19、C20、C21"
  and ("規則3-2=三個月內有影像檢查報告" or "規則3-4=三個月內有檢查報告")
  and "規則3-3=癌症分期分數或結果為M1>=1"
  and "規則3-5=用藥線別為第一線"

/*規則4*/
define "規則4=需檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告":
  exists (
    [Observation] RasObservation
    where RasObservation.status = 'final'
    and exists (
      RasObservation.code.coding ObsCodeCoding
      where ObsCodeCoding.code = '69548-6'
      and ObsCodeCoding in CodeConcept.LOINC
    )
    and exists (
      RasObservation.component ComponentRecord
      where exists (
        ComponentRecord.code.coding ComponentCodeCoding
        where ComponentCodeCoding.code in CodeConcept.GeneTest
      )
    )
    and exists (
      RasObservation.derivedFrom DerivedFromRef
      where DerivedFromRef.reference is not null
    )
    and exists (
      [DocumentReference] DocumentRef
      where exists (
        RasObservation.derivedFrom DerivedFromRef
        where EndsWith(DerivedFromRef.reference, DocumentRef.id)
      )
      and DocumentRef.status = 'current'
      and exists (
        DocumentRef.content ContentRecord
        where ContentRecord.attachment.url is not null
      )
    )
  )

define "主要規定一":
  "初次申請" and
  "規則1"
  and "規則2=K-RAS基因及N-RAS基因沒有突變"
  and "規則3"
  and "規則4=需檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告"


//============================================
// 主要規定二:續用條件-治療持續給付
//============================================

/*規則1*/
define "規則1=再次申請必須提出客觀證據(如:影像學)證實無惡化,才可繼續使用":
  exists (
    [MedicationRequest] MRPlan
     where MRPlan.intent = 'plan'
     and exists (
        MRPlan.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and Cdg.code in CodeConcept.L01FE02
      )
  and exists (
    [DiagnosticReport] Report
     where exists (
      Report.code.coding Cdg
        where (
          Cdg in CodeConcept.ICD10PCS2023Image
          or Cdg in CodeConcept.ICD10PCS2014Image
        )
        and Cdg.code in CodeConcept.ImageReportCode
      )
      and Report.effective is not null
      and FHIRHelpers.ToDateTime(Report.effective) >= Today() - 90 days
      and FHIRHelpers.ToDateTime(Report.effective) <= Today()
      )
    )
  and Reusable."醫令類別為1"

define "主要規定二":
  "續用申請" and
  "規則1=再次申請必須提出客觀證據(如:影像學)證實無惡化,才可繼續使用"


//============================================
// 主要規定三:藥品使用規則
//============================================

/*規則1*/
//條件1
define "規則1-1=Panitumumab與cetuximab二者僅能擇一使用":
  not (
    exists (
      [MedicationRequest] M1
      where exists (
        M1.medication.coding Cdg1
        where Cdg1.code in CodeConcept.L01FE02
      )
      and Reusable."HasValidTiming"(M1)
    )
    and
    exists (
      [MedicationRequest] M2
      where exists (
        M2.medication.coding Cdg2
        where Cdg2.code in CodeConcept.L01FE01
      )
      and Reusable."HasValidTiming"(M2)
    )
  )

//條件2
define "規則1-2=無法忍受化療(其副作用)時(有註記)":
  exists (
    [Claim] C
    where exists (
      C.diagnosis D
      where D.type.text contains '無法忍受副作用'
    )
  )

//條件3
define "規則1-3=Panitumumab與Cetuximab使用時間不重疊":
  not (
    exists (
      [MedicationRequest] M1
      where 
        exists (
          M1.medication.coding Cdg1
          where Cdg1 in CodeConcept.NHIMedication
          and Cdg1.code in CodeConcept.L01FE02
        )
        and Reusable."HasValidTiming"(M1)
        and M1.dosageInstruction[0].timing.repeat.bounds is Period
        and (start of (M1.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
        and (end of (M1.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
    )
    and exists (
      [MedicationRequest] M2
      where 
        exists (
          M2.medication.coding Cdg2
          where Cdg2 in CodeConcept.NHIMedication
          and Cdg2.code in CodeConcept.L01FE01
        )
        and Reusable."HasValidTiming"(M2)
        and M2.dosageInstruction[0].timing.repeat.bounds is Period
        and (start of (M2.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
        and (end of (M2.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
        
        and exists (
          [MedicationRequest] M1_inner
          where 
            exists (
              M1_inner.medication.coding Cdg1_inner
              where Cdg1_inner in CodeConcept.NHIMedication
              and Cdg1_inner.code in CodeConcept.L01FE02
            )
            and Reusable."HasValidTiming"(M1_inner)
            and M1_inner.dosageInstruction[0].timing.repeat.bounds is Period
            and (start of (M1_inner.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
            and (end of (M1_inner.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
            
            and (
              (end of (M1_inner.dosageInstruction[0].timing.repeat.bounds as Period)) >= 
              (start of (M2.dosageInstruction[0].timing.repeat.bounds as Period))
              and
              (end of (M2.dosageInstruction[0].timing.repeat.bounds as Period)) >= 
              (start of (M1_inner.dosageInstruction[0].timing.repeat.bounds as Period))
            )
        )
    )
  )

//條件4
define "規則1-4=每次申請事前審查之療程以18週為限":
  exists [MedicationRequest] MRPlan
  where MRPlan.intent = 'plan'
  and exists (
      MRPlan.medication.coding Cdg
      where Cdg in CodeConcept.NHIMedication
  )
  and days between
      start of (MRPlan.dosageInstruction[0].timing.repeat.bounds as Period)
      and
      end of (MRPlan.dosageInstruction[0].timing.repeat.bounds as Period)
        <= 126

define "3規則1":
  (
    ("規則1-2=無法忍受化療(其副作用)時(有註記)" and "規則1-3=Panitumumab與Cetuximab使用時間不重疊")
    or
    (not "規則1-2=無法忍受化療(其副作用)時(有註記)" and "規則1-1=Panitumumab與cetuximab二者僅能擇一使用")
  )
  and "規則1-4=每次申請事前審查之療程以18週為限"

/*規則2*/
//條件1
define "規則2-1=未使用bevacizumab藥品":
  not exists (
    [MedicationRequest] M
    where exists (
      M.medication.coding Cdg
      where Cdg in CodeConcept.NHIMedication
      and Cdg.code in CodeConcept.L01FG01
    )
    and Reusable."HasValidTiming"(M)
  )

//條件2
define "規則2-2=本藥品未與bevacizumab併用":
  exists (
    [MedicationRequest] MRmed
    where MRmed.intent = 'plan'
    and exists (
      MRmed.medication.coding Cdg
      where Cdg in CodeConcept.NHIMedication
      and Cdg.code in CodeConcept.L01FE02
    )
    and exists MRmed.dosageInstruction
    and MRmed.dosageInstruction[0].timing.repeat.bounds is Period
    and (start of (MRmed.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
    and (end of (MRmed.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
    and not exists (
      [MedicationRequest] M
      where M.intent = 'plan'
      and exists (
        M.medication.coding Cdg
        where Cdg in CodeConcept.NHIMedication
        and (Cdg.code in CodeConcept.L01FG01)
      )
      and exists M.dosageInstruction
      and M.dosageInstruction[0].timing.repeat.bounds is Period
      and (start of (M.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
      and (end of (M.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
      and (start of (M.dosageInstruction[0].timing.repeat.bounds as Period)) <= 
          (end of (MRmed.dosageInstruction[0].timing.repeat.bounds as Period))
      and (end of (M.dosageInstruction[0].timing.repeat.bounds as Period)) >= 
          (start of (MRmed.dosageInstruction[0].timing.repeat.bounds as Period))
    )
  )

define "規則2":
  "規則2-1=未使用bevacizumab藥品"
  or "規則2-2=本藥品未與bevacizumab併用"

define "主要規定三":
  "3規則1" and "規則2"


//============================================
// 審核結果
//============================================

define "MainRule1_Pass":
  if "初次申請"
  then "主要規定一"
  else null

define "MainRule2_Pass":
  if "續用申請"
  then "主要規定二"
  else null

define "MainRule3_Pass":
  "主要規定三"

define "大腸直腸癌Panitumumab申請結果_布林":
  case
    when "初次申請" then ("MainRule1_Pass" and "MainRule3_Pass")
    when "續用申請" then ("MainRule2_Pass" and "MainRule3_Pass")
    else false
  end

define "大腸直腸癌Panitumumab申請結果":
  case
    when "申請類型未知" then '申請未通過:無法判斷申請類型'
    when "初次申請" and "MainRule1_Pass" and "MainRule3_Pass" then '初次使用大腸直腸癌之Panitumumab用藥申請 - 通過'
    when "初次申請" then '初次使用大腸直腸癌之Panitumumab用藥申請 - 未通過'
    when "續用申請" and "MainRule2_Pass" and "MainRule3_Pass" then '續用大腸直腸癌之Panitumumab用藥申請 - 通過'
    when "續用申請" then '續用大腸直腸癌之Panitumumab用藥申請 - 未通過'
    else '申請未通過'
  end


//============================================
// 申請審核報告(根據申請類型顯示相關檢核)
//============================================

define "申請審核報告":
  '\n' +
  '\n=== 大腸直腸癌之Panitumumab 申請審核報告 ===\n' +
  '\n【申請類型】' + "申請類型" + '\n' +
  
  case
    when "初次申請" then
      '\n【初次使用條件檢核】\n' +
      '主要規定一:' + case when "MainRule1_Pass" then '通過' else '未通過' end + '\n' +
      case when ("規則1-1=初次使用Panitumumab需與FOLFOX(folinicacid/5-fluorouracil/oxaliplatin)合併使用" or "規則1-2=初次使用Panitumumab與FOLFIRI(folinic acid/ 5-fluorouracil/irinotecan)合併使用")
        then '● 符合:Panitumumab與FOLFOX或FOLFIRI併用'
        else '▲ 不符合:未與FOLFOX或FOLFIRI併用'
      end + '\n' +
      case when "規則2=K-RAS基因及N-RAS基因沒有突變"
        then '● 符合:K-RAS基因及N-RAS基因沒有突變'
        else '▲ 不符合:K-RAS基因及N-RAS基因沒有突變'
      end + '\n' +
      case when "規則3"
        then '● 符合:作為轉移性大腸直腸癌病患之第一線治療'
        else '▲ 不符合:作為轉移性大腸直腸癌病患之第一線治療'
      end + '\n' +
      case when "規則4=需檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告"
        then '● 符合:檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告'
        else '▲ 不符合:檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告'
      end + '\n'
    
    when "續用申請" then
      '\n【續用條件檢核】\n' +
      '主要規定二:' + case when "MainRule2_Pass" then '通過' else '未通過' end + '\n' +
      case when "規則1=再次申請必須提出客觀證據(如:影像學)證實無惡化,才可繼續使用"
        then '● 符合:須提出客觀證據(如:影像學)證實無惡化'
        else '▲ 不符合:須提出客觀證據(如:影像學)證實無惡化'
      end + '\n'
    
    else '\n【錯誤】無法判斷申請類型\n'
  end +
  
  '\n【藥品使用規則檢核】\n' +
  '主要規定三:' + case when "MainRule3_Pass" then '通過' else '未通過' end + '\n' +
  case when "規則1"
    then '● 符合:Panitumumab與cetuximab使用規定'
    else '▲ 不符合:Panitumumab與cetuximab使用規定'
  end + '\n' +
  case when "規則1-4=每次申請事前審查之療程以18週為限"
    then '● 符合:每次申請事前審查之療程以18週為限'
    else '▲ 不符合:每次申請事前審查之療程超過18週限制'
  end + '\n' +
  case when "規則2"
    then '● 符合:本藥品未與bevacizumab併用'
    else '▲ 不符合:本藥品與bevacizumab併用或曾使用bevacizumab'
  end + '\n' +
  
  '\n【申請結果】\n' +
  "大腸直腸癌Panitumumab申請結果" + '\n' +
  '\n====================\n'
ELM XML Content
Encoded data 
ELM JSON Content
Encoded data 
Generated using version 0.5.3-cibuild of the sample-content-ig Liquid templates