Generate CQL Library and FHIR ValueSet artifacts for Taiwan NHI reimbursement rules. Use for NHI CQL, and payment logic.
npx clawhub@latest install nhi-cql-generatorNHI CQL Generator converts Taiwan National Health Insurance reimbursement rule text into production-ready CQL Library (.cql) and FHIR ValueSet (.json) artifacts. It applies patterns from 50+ ground-truth examples to ensure every output conforms to NHI coding conventions, FHIR R4 standards, and Taiwan-specific codesystem requirements. Install this skill when you need to automate clinical decision support artifact creation for 健保給付規則 without manually authoring CQL or FHIR resources.
npx clawhub@latest install nhi-cql-generatorClick the Install button at the top of this page for one-click setup
Produces .cql files with correct library declarations, FHIR 4.0.1 headers, valueset/codesystem declarations, and define logic (MeetsInclusionCriteria, InPopulation, Recommendation, etc.) following documented NHI GT patterns exactly.
Creates ValueSet files using OID-based IDs (2.16.840.1.113762.1.4.1287.[N]), selects the correct filter operator (descendent-of, is-a, =, or in) based on code granularity, and populates all required metadata including the 4-part purpose field.
Directly uses CDSConnectCommonsForFHIRv401 (C3F) functions — Confirmed, Verified, MostRecent, ObservationLookBack, QuantityValue, and more — without redundant redefinition, keeping generated CQL clean and maintainable.
Translates NHI frequency rules ("一年限申報三次", "限住院期間申報一次", "每人以申報一次為原則") into correct CQL using ProcedureLookBack time windows or Encounter-reference checks as appropriate.
Automatically distinguishes regulations that must become executable CQL (specialist restrictions, contraindications, procedure type checks) from those that belong only in Recommendation text (material fee add-ons, administrative requirements).
Every output includes FHIRHelpers.cql (v4.0.1) and CDSConnectCommonsForFHIRv401.cql (v2.1.0) copied from the skill assets directory, preventing the Could not load source for library runtime error.
Convert a single-indication NHI rule (e.g., 08111B for Von Willebrand disease screening at 800 points) into a CQL library and matching ICD-10-CM ValueSet with correct filter operators.
Generate CQL for rules like 17022B (FeNO monitoring) that require age range checks (6–12 years), annual frequency limits (≤3 times/year), and pediatric specialty encounter validation.
Handle rules with multiple 適應症 groups each carrying different frequency constraints — such as 12216C where HIV patients get annual testing and dialysis patients get quadrennial testing — using the subpopulation pattern.
Produce CQL that checks both positive indications and the absence of contraindications, generating separate ValueSets for each and branching the Recommendation string to explain denial reasons.
[digits][letter] (e.g., 08111B, 12216C, 69041B)FHIRHelpers.cql (v4.0.1) and CDSConnectCommonsForFHIRv401.cql (v2.1.0) must exist at .github/skills/nhi-cql-generator/assets/npx clawhub@latest install nhi-cql-generatorLog in to write a review
No reviews yet. Be the first to share your experience!