nhi-cql-generator
БесплатноБез исполняемых скриптовНе проверенGenerate CQL Library and FHIR ValueSet artifacts for Taiwan NHI (National Health Insurance) reimbursement rules from rule text. Use when user asks to create…
от FDU-INS★ 84 звезды на GitHubОб этом скилле
NHI CQL Generator
Generate CQL Library (.cql) and FHIR ValueSet (.json) files from Taiwan NHI reimbursement rules text.
Overview
This skill generates standardized clinical decision support artifacts for Taiwan's National Health Insurance system:
- CQL Library - Clinical Quality Language for payment審查邏輯
- FHIR ValueSet - Code sets (適應症, 禁忌症, 藥品, etc.)
- Dependency Libraries - Required CQL libraries that must accompany every generated CQL file
Critical: All patterns are learned from 50+ GT examples. Do NOT deviate from documented patterns.
Required Dependency Libraries
Every generated CQL file depends on two shared libraries located in .github/skills/nhi-cql-generator/assets/:
FHIRHelpers.cql (version 4.0.1)
- Provides FHIR data model interaction helpers
- Converts FHIR types to CQL types
- Required by all FHIR-based CQL libraries
CDSConnectCommonsForFHIRv401.cql (version 2.1.0, aliased as C3F)
- Provides common clinical decision support functions that can be used directly
- Frequently used functions:
C3F.Confirmed(Conditions)- Filter confirmed conditionsC3F.Verified(Observations)- Filter verified observationsC3F.MostRecent(Observations)- Get most recent observationC3F.QuantityValue(Observation)- Extract quantity valueC3F.ObservationLookBack(Observations, LookBack)- Observations in time windowC3F.MostRecentProcedure(Procedures)- Get most recent procedureC3F.ActiveCondition(Conditions)- Filter active conditionsC3F.PeriodToInterval(Period)- Convert FHIR Period to CQL Interval
- Usage: Directly use C3F functions with the
C3F.prefix (e.g.,C3F.Confirmed([Condition: "code"])) - Note: GT examples redundantly redefine these functions, but this is unnecessary - you should use C3F functions directly
IMPORTANT: When generating CQL artifacts, you MUST copy these two files to the output directory alongside the generated .cql files. Without them, the CQL will fail with error:
Could not load source for library CDSConnectCommonsForFHIRv401, version 2.1.0, namespace uri null.
CQL Structure Patterns
Library Declaration
library "[規則編號]" version '0.0.1'
- Library name: Exact rule code (e.g., "08111B", "12216C", "69041B")
- Version: Always
'0.0.1'
Standard Headers (Fixed Order)
library "[規則編號]" version '0.0.1'
using FHIR version '4.0.1'
include "FHIRHelpers" version '4.0.1' called FHIRHelpers
include "CDSConnectCommonsForFHIRv401" version '2.1.0' called C3F
Never change: FHIR version, FHIRHelpers version, C3F version, or aliases.
ValueSet Declarations
After include statements, before codesystem declarations:
valueset "[中文名稱] valueset": '[ValueSet URL]'
URL Pattern: https://example.org/fhir/ValueSet/2.16.840.1.113762.1.4.1287.[sequential-number]
Examples:
valueset "17022B 呼氣一氧化氮監測(FeNO) valueset": 'https://example.org/fhir/ValueSet/2.16.840.1.113762.1.4.1287.6'valueset "糖尿病合併慢性腎病變 valueset": 'https://example.org/fhir/ValueSet/2.16.840.1.113762.1.4.1287.46'
CodeSystem URLs (Complete Approved List)
Use ONLY these codesystem URLs:
codesystem "ICD-10-CM": 'http://hl7.org/fhir/sid/icd-10-cm'
codesystem "ICD-10-PCS": 'http://www.cms.gov/Medicare/Coding/ICD10'
codesystem "LOINC": 'http://loinc.org'
codesystem "SCT": 'http://snomed.info/sct'
codesystem "TWMedicalServicePayment": 'https://twcore.mohw.gov.tw/ig/twcore/CodeSystem/medical-service-payment-tw'
codesystem "CONDVERSTATUS": 'http://terminology.hl7.org/CodeSystem/condition-ver-status'
codesystem "CONDCLINSTATUS": 'http://terminology.hl7.org/CodeSystem/condition-clinical'
codesystem "ActCode": 'http://terminology.hl7.org/CodeSystem/v3-ActCode'
Context Declaration
context Patient
Always use Patient context.
Define Statements Pattern
Standard structure observed in all examples:
define "[適應症或條件名稱]":
exists ( C3F.Confirmed([Condition: "[valueset名稱]"]) )
define "MeetsInclusionCriteria":
"[主要適應症]"
define "InPopulation":
"MeetsInclusionCriteria"
define "Recommendation":
if "InPopulation" then '健保給付[點數]點'
else null
define "Rationale":
null
define "Links":
null
define "Suggestions":
null
define "Errors":
null
Using C3F Helper Functions
Direct Usage - Use C3F library functions directly without redefining them:
// ✅ Correct: Use C3F functions directly
define "適應症":
exists ( C3F.Confirmed([Condition: "適應症 valueset"]) )
define "Recent Observations":
C3F.ObservationLookBack([Observation: "code"], 1 year)
define "Lab Value":
C3F.QuantityValue( C3F.MostRecent([Observation: "code"]) )
Common C3F Functions:
C3F.Confirmed(Conditions)- Filters to confirmed conditions (verificationStatus = 'confirmed')C3F.Verified(Observations)- Filters to verified observations (status = 'final', '
Установить nhi-cql-generator в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
Без ограничений — скилл может использовать любой инструмент.
Вложенные файлы
FAQ
Что делает скилл nhi-cql-generator?
Generate CQL Library and FHIR ValueSet artifacts for Taiwan NHI (National Health Insurance) reimbursement rules from rule text. Use when user asks to create CQL/ValueSet for 健保給付規則, 藥品審查, NHI CQL, 健保代碼, or payment審查. This skill applies patterns learned from 50+ GT examples.
Как установить скилл nhi-cql-generator?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл nhi-cql-generator запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
theme-factory
Toolkit for styling artifacts with a theme. These artifacts can be slides, docs, reportings, HTML landing pages, etc. There are 10 pre-set themes with…
от Anthropicaccess
Manage Discord channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropicconfigure
Set up the Discord channel — save the bot token and review access policy. Use when the user pastes a Discord bot token, asks to configure Discord, asks "how…
от Anthropicaccess
Manage iMessage channel access — approve pairings, edit allowlists, set DM/group policy. Use when the user asks to pair, approve someone, check who's allowed…
от Anthropic