臺灣健保預檢規則實作指引
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: CRCBevacizumabRule2

Official URL: https://nhicore.nhi.gov.tw/cql/Library/CRCBevacizumabRule2 Version: 1.0.0
Active as of 2025-10-30 Computable Name: CRCBevacizumabRule2
Id: CRCBevacizumabRule2
Version: 1.0.0
Url: CRCBevacizumabRule2
Type:

system: http://terminology.hl7.org/CodeSystem/library-type

code: logic-library

Date: 2025-10-30 08:19:00+0000
Content: text/cql
//大腸直腸癌_Bevacizumab給付規定(RAS基因沒有突變的轉移性大腸或直腸癌病人的第二線治療)
library CRCBevacizumabRule2 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


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

/*規則1*/
//條件1
define "規則1-1=Bevacizumab(除Zirabev以外)與含有5-fluorouracil/leucovorin/oxaliplatin的化學療法合併使用":
(
  // 存在 Fluorouracil 處方
  exists (
    [MedicationRequest] MROrder1
    where MROrder1.intent = 'order'
    and exists (
      MROrder1.medication.coding Cdg
      where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
      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.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
      and Cdg.code in CodeConcept.L01XA03
    )
    and Reusable."HasValidTiming"(MROrder2)
  )
  and
  // Bevacizumab(不包含Zirabev)申請
  exists (
    [MedicationRequest] MRPlan
    where MRPlan.intent = 'plan'
    and exists (
      MRPlan.medication.coding Cdg
      where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
      and Cdg.code in CodeConcept.L01FFexceptL01FF02
    )
  )
)
and Reusable."醫令類別為1"

//條件2
define "規則1-2=先前接受過以fluoropyrimidine為基礎的化學療法併用cetuximab無效":
exists (
  [MedicationRequest] CurrentBevacizumab
  where CurrentBevacizumab.intent = 'plan'
  and exists (
    CurrentBevacizumab.medication.coding BevaCoding
    where BevaCoding.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
    and BevaCoding.code in CodeConcept.L01FFexceptL01FF02
  )
  and Reusable."HasValidTiming"(CurrentBevacizumab)
  and exists (
    [MedicationRequest] FluoropyrimidineMR
    where FluoropyrimidineMR.intent = 'order'
    and exists (
      FluoropyrimidineMR.medication.coding FluoroCoding
      where FluoroCoding.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
      and FluoroCoding.code in CodeConcept.L01BC59 
      or FluoroCoding.code in CodeConcept.L01BC02 
      or FluoroCoding.code in CodeConcept.L01BC03 
      or FluoroCoding.code in CodeConcept.L01BC06 
      or FluoroCoding.code in CodeConcept.L01BC53
    )
    and Reusable."HasValidTiming"(FluoropyrimidineMR)
    // fluoropyrimidine 在申請藥品之前使用
    and Reusable."GetEndTime"(FluoropyrimidineMR) <= Reusable."GetStartTime"(CurrentBevacizumab)
    and exists (
      [MedicationRequest] CetuximabMR
      where CetuximabMR.intent = 'order'
      and exists (
        CetuximabMR.medication.coding CetuximabCoding
        where CetuximabCoding.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
        and CetuximabCoding.code in CodeConcept.L01FE01
      )
      // cetuximab 與 fluoropyrimidine 時間重疊且在申請藥品之前
      and Reusable."MedicationTimesOverlap"(CetuximabMR, FluoropyrimidineMR)
      and Reusable."GetEndTime"(CetuximabMR) <= Reusable."GetStartTime"(CurrentBevacizumab)
    )
  )
)
and Reusable."醫令類別為1"

//條件3
define "規則1-3=先前接受過以fluoropyrimidine為基礎的化學療法併用panitumumab無效":
exists (
  [MedicationRequest] CurrentBevacizumab
  where CurrentBevacizumab.intent = 'plan'
  and exists (
    CurrentBevacizumab.medication.coding BevaCoding
    where BevaCoding.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
    and BevaCoding.code in CodeConcept.L01FFexceptL01FF02
  )
  and Reusable."HasValidTiming"(CurrentBevacizumab)
  and exists (
    [MedicationRequest] FluoropyrimidineMR
    where FluoropyrimidineMR.intent = 'order'
    and exists (
      FluoropyrimidineMR.medication.coding FluoroCoding
      where FluoroCoding.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
      and FluoroCoding.code in CodeConcept.L01BC59 
      or FluoroCoding.code in CodeConcept.L01BC02 
      or FluoroCoding.code in CodeConcept.L01BC03 
      or FluoroCoding.code in CodeConcept.L01BC06 
      or FluoroCoding.code in CodeConcept.L01BC53
    )
    and Reusable."HasValidTiming"(FluoropyrimidineMR)
    // fluoropyrimidine 在申請藥品之前使用
    and Reusable."GetEndTime"(FluoropyrimidineMR) <= Reusable."GetStartTime"(CurrentBevacizumab)
    and exists (
      [MedicationRequest] PanitumumabMR
      where PanitumumabMR.intent = 'order'
      and exists (
        PanitumumabMR.medication.coding PanitumumabCoding
        where PanitumumabCoding.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
        and PanitumumabCoding.code in CodeConcept.L01FE02
      )
      // panitumumab 與 fluoropyrimidine 時間重疊且在申請藥品之前
      and Reusable."MedicationTimesOverlap"(PanitumumabMR, FluoropyrimidineMR)
      and Reusable."GetEndTime"(PanitumumabMR) <= Reusable."GetStartTime"(CurrentBevacizumab)
    )
  )
)
and Reusable."醫令類別為1"


define "規則1=化學療法合併使用":
"規則1-1=Bevacizumab(除Zirabev以外)與含有5-fluorouracil/leucovorin/oxaliplatin的化學療法合併使用"
and ("規則1-2=先前接受過以fluoropyrimidine為基礎的化學療法併用cetuximab無效"
or "規則1-3=先前接受過以fluoropyrimidine為基礎的化學療法併用panitumumab無效")




/*規則2*/
//條件1
define "規則2=未曾接受過Bevacizumab治療":
not exists (
  [MedicationRequest] NoBevacizumabMR
  where NoBevacizumabMR.intent = 'order'
  and exists (
    NoBevacizumabMR.medication.coding Cdg
    where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
    and Cdg.code in CodeConcept.L01FFexceptL01FF02
  )
  and Reusable."HasValidTiming"(NoBevacizumabMR)
)


/*規則3*/
//條件1
define "規則3=RAS基因沒有突變":
exists (
  [Observation] RasObs
  where RasObs.status = 'final'
  and exists (
    RasObs.code.coding Cdg
    where Cdg.code = '69548-6'
    and Cdg.system = 'http://loinc.org'
  )
  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'
  )
)

/*規則4*/
//條件1
define "規則4-1=ICD-10使用C18、C19、C20、C21":
   exists (
    [Claim] C
      where exists (
        C.diagnosis D
          where exists ( 
            D.diagnosis.coding Cdg
              where  (
                Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/icd-10-cm-2023-tw'
                or Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/icd-10-cm-2014-tw'
              )
              and Cdg.code in CodeConcept.ICDCRC
          )
      )
  )

//條件2
define "規則4-2=三個月內有影像檢查報告":
exists (
    [DiagnosticReport] O
    where exists (
      O.code.coding Cdg
      where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/icd-10-pcs-2023-tw'
      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 "規則4-3=三個月內有檢查報告":
exists (
    [DiagnosticReport] O2
    where exists (
      O2.code.coding Cdg
      where Cdg.system = 'http://loinc.org'
      and Cdg.code in { '65755-1' }
    )
    and O2.effective is not null
    and FHIRHelpers.ToDateTime(O2.effective) >= Today() - 90 days
    and FHIRHelpers.ToDateTime(O2.effective) <= Today()
  ) 

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

//條件5
define "規則4-5=用藥線別為第二線":
  exists (
    [Claim] C
      where exists (
        C.item I
          where exists (
            I.modifier M
              where exists (
                M.coding Cdg
                  where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-line-of-therapy'
                    and Cdg.code = '2'
              )
          )
      )
  )

define "規則4=轉移性大腸或直腸癌病人的第二線治療":
"規則4-1=ICD-10使用C18、C19、C20、C21"
or "規則4-2=三個月內有影像檢查報告"
or "規則4-3=三個月內有檢查報告"
and "規則4-4=癌症分期分數或結果為M>=1"
and "規則4-5=用藥線別為第二線"

/*規則5*/
//條件1
define "規則5=需檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告":
exists (
  [Observation] RasObservation
  where RasObservation.status = 'final'
  and exists (
    RasObservation.code.coding ObsCodeCoding
    where ObsCodeCoding.code = '69548-6'
    and ObsCodeCoding.system = 'http://loinc.org'
  )
  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 (DerivedFromRef.reference = 'DocumentReference/' + DocumentRef.id
            or DerivedFromRef.reference = DocumentRef.id)
    )
    and exists (
      DocumentRef.content ContentRecord
      where ContentRecord.attachment.url is not null
    )
  )
)



define "主要規定一":
"規則1=化學療法合併使用" 
and "規則2=未曾接受過Bevacizumab治療"
and "規則3=RAS基因沒有突變"
and "規則4=轉移性大腸或直腸癌病人的第二線治療"
and "規則5=需檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告"
and Reusable."續用註記為1"


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

/*規則1*/
define "規則1=再次申請必須提出客觀證據(如:RECIST criteria)證實無惡化, 才可繼續使用。":
exists (
  [MedicationRequest] MRPlan
   where MRPlan.intent = 'plan'
   and exists (
      MRPlan.medication.coding Cdg
      where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
      and Cdg.code in CodeConcept.L01FFexceptL01FF02
    )
and
// 必須存在治療評估記錄
exists (
 [Observation] TxAst
 where TxAst.status = 'final'
 and exists (
  TxAst.code.coding C
  where C.code = 'REC1'
  and C.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-tx-ast'
 )
  and (TxAst.value as string in { 'CR', 'PR' })
)
)
and Reusable."醫令類別為1"
and Reusable."續用註記為2"


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

/*規則1*/
define "規則1=每次申請事前審查之療程以12週為限":
Reusable."醫令類別為1"
and exists [MedicationRequest] MRPlan
where MRPlan.intent = 'plan'
and exists (
MRPlan.medication.coding Cdg
where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
and Cdg.code in CodeConcept.L01FFexceptL01FF02
 )
and days between
start of (MRPlan.dosageInstruction[0].timing.repeat.bounds as Period)
and
end of (MRPlan.dosageInstruction[0].timing.repeat.bounds as Period)
<= 84

/*規則2*/
define "規則2=使用總療程以24週為上限":
Reusable."醫令類別為1"
and (
Sum(
 [MedicationRequest] MRTotal
where (MRTotal.intent = 'plan' or MRTotal.intent = 'order')
and (MRTotal.status is null or MRTotal.status in { 'active', 'completed', 'on-hold' })
and exists MRTotal.dosageInstruction
and MRTotal.dosageInstruction[0].timing.repeat.bounds is Period
and (start of (MRTotal.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
and (end of (MRTotal.dosageInstruction[0].timing.repeat.bounds as Period)) is not null
and exists (
MRTotal.medication.coding Cdg
where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
and Cdg.code in CodeConcept.L01FFexceptL01FF02
 )
return
days between
start of (MRTotal.dosageInstruction[0].timing.repeat.bounds as Period)
and
end of (MRTotal.dosageInstruction[0].timing.repeat.bounds as Period)
 ) <= 168
 )

/*規則3*/
define "規則3-3=限5mg/kg每兩週一次":
exists (
 [MedicationRequest] M
where M.intent = 'plan'
and exists (
M.medication.coding Cdg
where Cdg.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
and Cdg.code in CodeConcept.L01FFexceptL01FF02
 )
and exists (
M.dosageInstruction DI
where DI.timing.code.coding[0].code = 'Q2W'
and exists (
DI.doseAndRate DR
where DR.dose.unit = 'mg'
and DR.dose.value <= 5
 )
 )
)

define "主要規定三":
"規則1=每次申請事前審查之療程以12週為限"
and "規則2=使用總療程以24週為上限"
and "規則3-3=限5mg/kg每兩週一次"



//最終審核結果報告======================

// 主要規定一:初次使用條件(第二線治療)
define "MainRule1_Pass":
  Reusable."續用註記為1" 
  and "規則1=化學療法合併使用"
  and "規則2=未曾接受過Bevacizumab治療"
  and "規則3=RAS基因沒有突變"
  and "規則4=轉移性大腸或直腸癌病人的第二線治療"
  and "規則5=需檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告"

// 主要規定二:續用條件
define "MainRule2_Pass":
  Reusable."續用註記為2" 
  and "規則1=再次申請必須提出客觀證據(如:RECIST criteria)證實無惡化, 才可繼續使用。"

// 主要規定三:藥品使用規則
define "MainRule3_Pass":
  "規則1=每次申請事前審查之療程以12週為限"
  and "規則2=使用總療程以24週為上限"
  and "規則3-3=限5mg/kg每兩週一次"

// 總申請結果
define "大腸直腸癌Bevacizumab申請結果":
  if ("MainRule1_Pass" or "MainRule2_Pass") and "MainRule3_Pass"
  then 
    case 
      when "MainRule1_Pass" then '第二線治療初次使用之用藥申請 - 通過'
      when "MainRule2_Pass" then '第二線治療續用之用藥申請 - 通過'
      else '申請未通過'
    end
  else '申請未通過'

// 整合的申請結果總結
define "申請檢核結果":
  if ("大腸直腸癌Bevacizumab申請結果" = '第二線治療初次使用之用藥申請 - 通過'
      or "大腸直腸癌Bevacizumab申請結果" = '第二線治療續用之用藥申請 - 通過')
  then '通過:所有檢核項目均符合申請條件'
  else '不通過:存在不符合申請條件的項目'

// 主要規定的條件間關係審核結果
define "申請審核報告":
'\n' +
'\n=== Bevacizumab(二線治療) 申請審核報告 ===\n' +
'\n【檢核結果】\n' +
'主要規定一(初次使用):' + case when "MainRule1_Pass" then '通過' else '未通過' end + '\n' +
case when Reusable."續用註記為1" then '● 符合:續用註記為初次使用(1)' else '▲ 不符合:續用註記為初次使用(1)' end + '\n' +
case when "規則1=化學療法合併使用" then '● 符合:Bevacizumab(除Zirabev以外)與含有5-fluorouracil/leucovorin/oxaliplatin的化學療法合併使用,且先前接受過以fluoropyrimidine為基礎的化學療法併用cetuximab或panitumumab無效' else '▲ 不符合:Bevacizumab(除Zirabev以外)與含有5-fluorouracil/leucovorin/oxaliplatin的化學療法合併使用,且先前接受過以fluoropyrimidine為基礎的化學療法併用cetuximab或panitumumab無效' end + '\n' +
case when "規則2=未曾接受過Bevacizumab治療" then '● 符合:未曾接受過Bevacizumab治療' else '▲ 不符合:未曾接受過Bevacizumab治療' end + '\n' +
case when "規則3=RAS基因沒有突變" then '● 符合:RAS基因沒有突變' else '▲ 不符合:RAS基因沒有突變' end + '\n' +
case when "規則4-1=ICD-10使用C18、C19、C20、C21" then '● 符合:診斷為轉移性大腸或直腸癌(ICD-10: C18、C19、C20、C21)' else '▲ 不符合:診斷為轉移性大腸或直腸癌(ICD-10: C18、C19、C20、C21)' end + '\n' +
case when ("規則4-2=三個月內有影像檢查報告" or "規則4-3=三個月內有檢查報告") then '● 符合:影像檢查報告條件' else '▲ 不符合:影像檢查報告條件' end + '\n' +
case when "規則4-4=癌症分期分數或結果為M>=1" then '● 符合:癌症分期為轉移性(M>=1)' else '▲ 不符合:癌症分期為轉移性(M>=1)' end + '\n' +
case when "規則4-5=用藥線別為第二線" then '● 符合:作為第二線治療使用' else '▲ 不符合:作為第二線治療使用' end + '\n' +
case when "規則5=需檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告" then '● 符合:檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告' else '▲ 不符合:檢附認證實驗室檢驗之All-RAS基因突變分析檢測報告' end + '\n' +
'\n主要規定二(續用條件):' + case when "MainRule2_Pass" then '通過' else '未通過' end + '\n' +
case when Reusable."續用註記為2" then '● 符合:續用註記為續用(2)' else '▲ 不符合:續用註記為續用(2)' end + '\n' +
case when "規則1=再次申請必須提出客觀證據(如:RECIST criteria)證實無惡化, 才可繼續使用。" then '● 符合:再次申請必須提出客觀證據(如:RECIST criteria)證實無惡化, 才可繼續使用' else '▲ 不符合:再次申請必須提出客觀證據(如:RECIST criteria)證實無惡化, 才可繼續使用' end + '\n' +
'\n主要規定三(藥品使用規則):' + case when "MainRule3_Pass" then '通過' else '未通過' end + '\n' +
case when "規則1=每次申請事前審查之療程以12週為限" then '● 符合:每次申請事前審查之療程以12週為限' else '▲ 不符合:每次申請事前審查之療程以12週為限' end + '\n' +
case when "規則2=使用總療程以24週為上限" then '● 符合:使用總療程以24週為上限' else '▲ 不符合:使用總療程以24週為上限' end + '\n' +
case when "規則3-3=限5mg/kg每兩週一次" then '● 符合:限5mg/kg每兩週一次' else '▲ 不符合:限5mg/kg每兩週一次' end + '\n' +
'\n【申請結果】\n' +
"大腸直腸癌Bevacizumab申請結果" + '\n' +
'\n【最終審核結果】\n' +
"申請檢核結果" + '\n' +
'\n====================\n'



Content: application/elm+xml
Encoded data (223196 characters)
Content: application/elm+json
Encoded data (466320 characters)