MyClaw
HomeProductsUse CasesPricingSkillsResourcesCompany
HomeUse CasesPricingSkills
Sign In
Home
ProductsOpenClaw HostingHermes Agent Hosting
Use CasesPricingSkills
ResourcesCompareTutorialLearnBlogUpdatesResourcesCommunity
CompanyAboutSupport
Sign In
MyClaw.ai

Your AI agent, already running.

Product

OpenClaw HostingHermes Agent HostingUse CasesPricingCompareAlibaba Cloud

Resources

BlogUpdatesSkillsModelsSupportCommunityCapybara

Legal

TermsPrivacyCookieGDPRContact

© 2023 Cubo World Inc. All rights reserved.

← Back to Skills
Data & Analytics
💻

NHI CQL Generator

Generate CQL Library and FHIR ValueSet artifacts for Taiwan NHI reimbursement rules. Use for NHI CQL, and payment logic.

by FDU-INSv1.0.0
Connecting to VM...
Connecting to VM...
npx clawhub@latest install nhi-cql-generator
3.4kStars
2.6kDownloads
1Current Installs
📦
v1.0.0Version
View Source

NHI CQL Generator Skill Overview

NHI 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.

How to Use It

Step 1: Run in your terminal or install this skill on MyClaw

npx clawhub@latest install nhi-cql-generator
or

Click the Install button at the top of this page for one-click setup

When to Use NHI CQL Generator

Best Fit

  • You have an NHI rule code and full rule text and need to produce a deployable CQL library and FHIR ValueSet in one step
  • You are building or maintaining a Taiwan NHI clinical decision support system and need consistent, pattern-compliant artifacts
  • You need to encode frequency limits, contraindications, specialist restrictions, or multi-subpopulation logic from 健保給付規則 into executable CQL
  • You want to generate multiple related ValueSets (indication + contraindication) with correct OID-based naming and filter operators

When Not to Use

  • You need CQL for non-Taiwan health insurance systems (e.g., US Medicare, EU payers) — this skill's codesystems and patterns are NHI-specific
  • Your rule text is incomplete or missing 適應症 and 點數 — the skill requires structured rule input to produce valid output
  • You need a FHIR terminology server or ValueSet expansion service — this skill generates authoring artifacts, not expanded code lists

Key Features

CQL Library Generation with NHI Patterns

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.

FHIR ValueSet JSON Generation

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.

C3F Helper Function Integration

Directly uses CDSConnectCommonsForFHIRv401 (C3F) functions — Confirmed, Verified, MostRecent, ObservationLookBack, QuantityValue, and more — without redundant redefinition, keeping generated CQL clean and maintainable.

Frequency & Encounter Constraint Encoding

Translates NHI frequency rules ("一年限申報三次", "限住院期間申報一次", "每人以申報一次為原則") into correct CQL using ProcedureLookBack time windows or Encounter-reference checks as appropriate.

Pre-Authorization vs Post-Payment Logic Separation

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).

Dependency Package Bundling

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.

Use Cases

Simple Indication Rule

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.

Frequency-Constrained Pediatric Rule

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.

Multi-Subpopulation Rule

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.

Contraindication-Aware Rule

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.

Requirements

  • NHI Rule ID: Code in format [digits][letter] (e.g., 08111B, 12216C, 69041B)
  • Full Rule Text: Complete 給付規則 including 適應症, 禁忌症, 支付規範, and 點數
  • Skill Asset Files: FHIRHelpers.cql (v4.0.1) and CDSConnectCommonsForFHIRv401.cql (v2.1.0) must exist at .github/skills/nhi-cql-generator/assets/
  • No external API keys or services required
Connecting to VM...
npx clawhub@latest install nhi-cql-generator
3.4kStars
2.6kDownloads
1Current Installs
📦
v1.0.0Version
View Source

Reviews

0 reviews

Log in to write a review

No reviews yet. Be the first to share your experience!