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

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

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

code: logic-library

Date: 2025-10-30 08:19:00+0000
Related Artifacts:

Dependencies

Parameters:
NameTypeMinMaxIn/Out
PatientPatient01Out
規則1-1=NTRK基因融合且無已知的後天阻抗性突變boolean01Out
規則1-2-1-1=ICD-10使用C18、C19、C20、C21boolean01Out
規則1-2-1-2=三個月內有影像檢查報告boolean01Out
規則1-2-1-3=癌症分期分數或結果為M≠0boolean01Out
規則1-2-1-4=三個月內有檢查報告boolean01Out
規則1-2-1=轉移性實體腫瘤boolean01Out
規則1-2-2-1=存在說明手術切除極可能造成嚴重病症boolean01Out
規則1-2-2=手術切除極可能造成嚴重病症boolean01Out
規則1-3=沒有合適的替代治療選項(包括免疫檢查點抑制劑)boolean01Out
規則1boolean01Out
規則2=需檢附NTRK基因融合檢測報告boolean01Out
規則3-1=檢核未滿18歲與定(符合採條件2不符合採條件3)boolean01Out
規則3-2=曾接受一線治療後無效或復發boolean01Out
規則3-3-3-2-1=先前已使用過FOLFIRI(folinic acid/5-fluorouracil/irinotecan)boolean01Out
規則3-3-3-2-2=先前已使用過FOLFOX(folinic acid/5-fluorouracil/oxaliplatin)boolean01Out
規則3-3-2=先前已使用過相關化學藥物治療失敗boolean01Out
規則3boolean01Out
規則1=影像證據顯示病情有無惡化boolean01Out
規則3-1=每次申請之療程以12週為限boolean01Out
MainRule1_Passboolean01Out
MainRule2_Passboolean01Out
MainRule3_Passboolean01Out
大腸直腸癌Larotrectinib申請結果string01Out
申請檢核結果string01Out
申請審核報告string01Out
Data Requirements:
TypeProfileMSCode Filter
Patient http://hl7.org/fhir/StructureDefinition/Patient
Claim http://hl7.org/fhir/StructureDefinition/Claim ;
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;;;;;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;
Claim http://hl7.org/fhir/StructureDefinition/Claim ;
DiagnosticReport http://hl7.org/fhir/StructureDefinition/DiagnosticReport ;;;
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;;;
DiagnosticReport http://hl7.org/fhir/StructureDefinition/DiagnosticReport ;;;
Claim http://hl7.org/fhir/StructureDefinition/Claim ;
Claim http://hl7.org/fhir/StructureDefinition/Claim ;
Observation http://hl7.org/fhir/StructureDefinition/Observation ;;;;;
DocumentReference http://hl7.org/fhir/StructureDefinition/DocumentReference ;;
Claim http://hl7.org/fhir/StructureDefinition/Claim ;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;
Claim http://hl7.org/fhir/StructureDefinition/Claim ;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;
Claim http://hl7.org/fhir/StructureDefinition/Claim ;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;
DiagnosticReport http://hl7.org/fhir/StructureDefinition/DiagnosticReport ;;;
MedicationRequest http://hl7.org/fhir/StructureDefinition/MedicationRequest ;;;;
Content: text/cql
//大腸直腸_Larotrectinib給付規定
library CRCLarotrectinibRule1 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=NTRK基因融合且無已知的後天阻抗性突變":
exists (
  [Observation] RasO
  where RasO.status = 'final'
  and exists (
    RasO.code.coding ObsCodeCoding
    where ObsCodeCoding.code = '69548-6'
    and ObsCodeCoding.system = 'http://loinc.org'
  )
  and exists (
    RasO.component ComponentRecord
    where exists (
      ComponentRecord.code.coding ComponentCodeCoding
      where ComponentCodeCoding.code in CodeConcept.LarotrectinibGeneTest
    )
  )
  and RasO.value is not null
  and RasO.value is FHIR.string
  and Matches((RasO.value as FHIR.string).value, '(?i).*fusion且無後天阻抗性突變.*')
   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.L01EX12
    )
  )
)
and Reusable."醫令類別為1"

//條件2-1-1
define "規則1-2-1-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-1-2
define "規則1-2-1-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.ImageReportTumorCode
    )
    and O.effective is not null
    and FHIRHelpers.ToDateTime(O.effective) >= Today() - 90 days
    and FHIRHelpers.ToDateTime(O.effective) <= Today()
  )

//條件2-1-3
define "規則1-2-1-3=癌症分期分數或結果為M≠0":
    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

//條件2-1-4
define "規則1-2-1-4=三個月內有檢查報告":
exists (
    [DiagnosticReport] O2
    where exists (
      O2.code.coding Cdg
      where Cdg.system = 'http://loinc.org'
      and Cdg.code = '65755-1'
    )
    and O2.effective is not null
    and FHIRHelpers.ToDateTime(O2.effective) >= Today() - 90 days
    and FHIRHelpers.ToDateTime(O2.effective) <= Today()
  ) 

define "規則1-2-1=轉移性實體腫瘤":
"規則1-2-1-1=ICD-10使用C18、C19、C20、C21"
and "規則1-2-1-3=癌症分期分數或結果為M≠0"
and ("規則1-2-1-2=三個月內有影像檢查報告"
or  "規則1-2-1-4=三個月內有檢查報告")

//條件2-2-1
define "規則1-2-2-1=存在說明手術切除極可能造成嚴重病症":
exists (
  [Claim] C
  where exists (
    C.diagnosis Diag
    where Diag.type.text is not null
  )
)

//條件2-2
define "規則1-2-2=手術切除極可能造成嚴重病症":
"規則1-2-1-1=ICD-10使用C18、C19、C20、C21"
and "規則1-2-2-1=存在說明手術切除極可能造成嚴重病症"
and "規則1-2-1-2=三個月內有影像檢查報告"

//條件3(存在說明「沒有合適的替代治療選項(包括免疫檢查點抑制劑)」)
define "規則1-3=沒有合適的替代治療選項(包括免疫檢查點抑制劑)":
exists (
  [Claim] C
  where exists (
    C.diagnosis Diag
    where Diag.type.text is not null
      and exists (
        Diag.type.text T
        where Matches(T, '(?i).*沒有合適的替代治療選項.*')
      )
  )
)

define "規則1":
"規則1-1=NTRK基因融合且無已知的後天阻抗性突變"
and ("規則1-2-1=轉移性實體腫瘤"
or "規則1-2-2=手術切除極可能造成嚴重病症")
and "規則1-3=沒有合適的替代治療選項(包括免疫檢查點抑制劑)"

/*規則2*/
define "規則2=需檢附NTRK基因融合檢測報告":
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.LarotrectinibGeneTest
    )
  )
  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
    )
  )
)

/*規則3*/

//條件3-1
define "規則3-1=檢核未滿18歲與定(符合採條件2不符合採條件3)":
exists (
    [Claim] C
    where C.created is not null
    and AgeInYearsAt(C.created) < 18
  )

//條件3-2
define "規則3-2=曾接受一線治療後無效或復發":
exists (
  [MedicationRequest] FOLMR
  where FOLMR.intent = 'order'
    and exists (
      FOLMR.medication.coding UTCapCetBevaFOL
      where UTCapCetBevaFOL.system = 'https://nhicore.nhi.gov.tw/pas/CodeSystem/nhi-medication'
        and UTCapCetBevaFOL.code in CodeConcept.L01EX12
    )
    and Reusable."HasValidTiming"(FOLMR)
          )
and Reusable."醫令類別為1"
and 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 in { '2', '3', '4', '5' }
      )
    )
  )
)

//規則3-3-3-1 同 "規則1-2-1=轉移性實體腫瘤"

//條件3-3-2-1
define "規則3-3-3-2-1=先前已使用過FOLFIRI(folinic acid/5-fluorouracil/irinotecan)":
(
  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.L01CE02
    )
    and Reusable."HasValidTiming"(MROrder1)
    and Reusable."GetEndTime"(MROrder1) < Today()
  )
  and
  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.L01BC02
    )
    and Reusable."HasValidTiming"(MROrder2)
    and Reusable."GetEndTime"(MROrder2) < Today()
  )
)
and Reusable."醫令類別為1"

//條件3-3-2-2
define "規則3-3-3-2-2=先前已使用過FOLFOX(folinic acid/5-fluorouracil/oxaliplatin)":
(
  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.L01CE02
    )
    and Reusable."HasValidTiming"(MROrder1)
    and Reusable."GetEndTime"(MROrder1) < Today()
  )
  and
  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 Reusable."GetEndTime"(MROrder2) < Today()
  )
)
and Reusable."醫令類別為1"

define "規則3-3-2=先前已使用過相關化學藥物治療失敗":
"規則3-3-3-2-1=先前已使用過FOLFIRI(folinic acid/5-fluorouracil/irinotecan)"
or "規則3-3-3-2-2=先前已使用過FOLFOX(folinic acid/5-fluorouracil/oxaliplatin)"

define "規則3":
  if ("規則3-1=檢核未滿18歲與定(符合採條件2不符合採條件3)")
  then ("規則3-2=曾接受一線治療後無效或復發")
  else ("規則1-2-1=轉移性實體腫瘤" and "規則3-3-2=先前已使用過相關化學藥物治療失敗")

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

/*規則1*/
define "規則1=影像證據顯示病情有無惡化":
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.L01EX12
    )
and exists (
  [DiagnosticReport] Report
   where exists (
    Report.code.coding Cdg
    where 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"
and Reusable."續用註記為2"

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

/*規則1*/
//條件1
define "規則3-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.L01FG01
    )
    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
  )

//審核結果------------------------------------------

//最終審核結果報告======================
define "MainRule1_Pass":
  "規則1" and "規則2=需檢附NTRK基因融合檢測報告" and "規則3"

define "MainRule2_Pass":
  "規則1=影像證據顯示病情有無惡化" and Reusable."續用註記為2"

define "MainRule3_Pass":
  "規則3-1=每次申請之療程以12週為限"

// 總申請結果
define "大腸直腸癌Larotrectinib申請結果":
  if ("MainRule1_Pass" or "MainRule2_Pass") and "MainRule3_Pass"
  then
    case
      when "MainRule1_Pass" then 'NTRK基因融合實體腫瘤初次使用之用藥申請 - 通過'
      when "MainRule2_Pass" then 'NTRK基因融合實體腫瘤續用之用藥申請 - 通過'
      else '申請未通過'
    end
  else '申請未通過'

// 整合的申請結果總結
define "申請檢核結果":
  if ("大腸直腸癌Larotrectinib申請結果" = 'NTRK基因融合實體腫瘤初次使用之用藥申請 - 通過'
      or "大腸直腸癌Larotrectinib申請結果" = 'NTRK基因融合實體腫瘤續用之用藥申請 - 通過')
  then '通過:所有檢核項目均符合申請條件'
  else '不通過:存在不符合申請條件的項目'

//主要規定的條件間關係審核結果
define "申請審核報告":
  '\n' +
  '\n=== Larotrectinib 申請審核報告 ===\n' +
  '\n【檢核結果】\n' +
  '主要規定一(初次使用):' + case when "MainRule1_Pass" then '通過' else '未通過' end + '\n' +
  case when Reusable."醫令類別為1" then '● 符合:醫令類別為初次使用(1)' else '▲ 不符合:醫令類別為初次使用(1)' end + '\n' +
  case when "規則1-1=NTRK基因融合且無已知的後天阻抗性突變" then '● 符合:具NTRK基因融合且無已知的後天阻抗性突變(acquired resistance mutation)' else '▲ 不符合:具NTRK基因融合且無已知的後天阻抗性突變(acquired resistance mutation)' end + '\n' +
  case when "規則1-2-1-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 "規則1-2-1-3=癌症分期分數或結果為M≠0" then '● 符合:癌症分期為轉移性(M≠0)' else '▲ 不符合:癌症分期為轉移性(M≠0)' end + '\n' +
  case when "規則1-2-1-2=三個月內有影像檢查報告" then '● 符合:三個月內有影像檢查報告' else '▲ 不符合:三個月內有影像檢查報告' end + '\n' +
  case when "規則1-2-2=手術切除極可能造成嚴重病症" then '● 符合:手術切除極可能造成嚴重病症(severe morbidity)' else '▲ 不符合:手術切除極可能造成嚴重病症(severe morbidity)' end + '\n' +
  case when "規則1-3=沒有合適的替代治療選項(包括免疫檢查點抑制劑)" then '● 符合:沒有合適的替代治療選項(包括免疫檢查點抑制劑)' else '▲ 不符合:沒有合適的替代治療選項(包括免疫檢查點抑制劑)' end + '\n' +
  case when "規則2=需檢附NTRK基因融合檢測報告" then '● 符合:檢附NTRK基因融合檢測報告' else '▲ 不符合:檢附NTRK基因融合檢測報告' end + '\n' +
  case when "規則3-1=檢核未滿18歲與定(符合採條件2不符合採條件3)" then '● 符合:患者未滿18歲' else '▲ 不符合:患者未滿18歲' end + '\n' +
  case when "規則3-2=曾接受一線治療後無效或復發" then '● 符合:曾接受一線治療後無效或復發' else '▲ 不符合:曾接受一線治療後無效或復發' end + '\n' +
  case when "規則3-3-3-2-1=先前已使用過FOLFIRI(folinic acid/5-fluorouracil/irinotecan)" then '● 符合:先前已使用過FOLFIRI治療失敗' else '▲ 不符合:先前已使用過FOLFIRI治療失敗' end + '\n' +
  case when "規則3-3-3-2-2=先前已使用過FOLFOX(folinic acid/5-fluorouracil/oxaliplatin)" then '● 符合:先前已使用過FOLFOX治療失敗' else '▲ 不符合:先前已使用過FOLFOX治療失敗' end + '\n' +
  '\n主要規定二(續用條件):' + case when "MainRule2_Pass" then '通過' else '未通過' end + '\n' +
  case when Reusable."續用註記為2" then '● 符合:續用註記為續用(2)' else '▲ 不符合:續用註記為續用(2)' end + '\n' +
  case when "規則1=影像證據顯示病情有無惡化" then '● 符合:再次申請必須提出客觀證據(如:影像學)證實無惡化,才可繼續使用' else '▲ 不符合:再次申請必須提出客觀證據(如:影像學)證實無惡化,才可繼續使用' end + '\n' +
  '\n主要規定三(藥品使用規則):' + case when "MainRule3_Pass" then '通過' else '未通過' end + '\n' +
  case when "規則3-1=每次申請之療程以12週為限" then '● 符合:每次申請之療程以12週為限' else '▲ 不符合:每次申請之療程以12週為限' end + '\n' +
  '\n【申請結果】\n' +
  "大腸直腸癌Larotrectinib申請結果" + '\n' +
  '\n【最終審核結果】\n' +
  "申請檢核結果" + '\n' +
  '\n====================\n'
Content: application/elm+xml
Encoded data (175472 characters)
Content: application/elm+json
Encoded data (365500 characters)