ASP源码
PHP源码
.NET源码
JSP源码
FHIR 问卷设计器是一个专门的框架,旨在弥合原始临床需求与标准化医疗数据结构之间的鸿沟。该技能使 AI 代理能够通过实时查询 LOINC 和 SNOMED CT 代码来生成符合 FHIR 标准的问卷定义,确保从源头准确采集临床数据。通过在开发工作流中使用 Openclaw Skills,您可以自动化创建复杂的医疗表单,同时严格遵守国际医疗信息化标准。
其核心是通过执行严格的临床术语查询政策来优先考虑数据完整性。它禁止使用记忆或幻觉的临床代码,要求针对官方术语服务器进行实时验证。这种方法确保了生成的 JSON 结构在技术上是可靠的,并可直接用于互操作医疗环境。
下载入口:https://github.com/openclaw/skills/tree/main/skills/elmariachi111/fhir-questionnaire
从源直接安装技能的最快方式。
npx clawhub@latest install fhir-questionnaire
将技能文件夹复制到以下位置之一
全局模式~/.openclaw/skills/
工作区
/skills/
优先级:工作区 > 本地 > 内置
将此提示词复制到 OpenClaw 即可自动安装。
请帮我使用 Clawhub 安装 fhir-questionnaire。如果尚未安装 Clawhub,请先安装(npm i -g clawhub)。
要实现此技能,您必须安装 Python 3.8 或更高版本以及所需的验证依赖项:
pip install jsonschema
该技能需要对 clinicaltables.nlm.nih.gov(用于 LOINC)和 tx.fhir.org(用于 SNOMED CT 和 ValueSet 扩展)的白名单网络访问权限。默认术语提供程序目前不需要专有 API 密钥。
该技能通过脚本和资产的结构化层次结构管理其操作:
| 组件 | 用途 |
|---|---|
scripts/ |
用于 LOINC/SNOMED 搜索、ValueSet 扩展和 JSON 验证的 Python 工具。 |
assets/templates/ |
从 minimal 到 advanced 复杂度的模块化 JSON 模板。 |
references/ |
涵盖 FHIR 规范和建模最佳实践的技术指南。 |
output/ |
准备好进行服务器部署的有效 FHIR 问卷 JSON 资源。 |
通过主要技能文件中的 YAML 标头跟踪元数据,以管理环境依赖项(如 python>=3.8)。
name: design-fhir-loinc-questionnaires
description: Helps creating FHIR conforming questionnaire definitions from plain requirement ideation docs. Contains scripts to look up LOINC and SNOMED CT codes for medical conditions, findings, observations, medications, procedures from a official coding APIs. No API keys required at the moment.
metadata:
dependencies: python>=3.8, jsonschema>=4.0.0
NEVER suggest LOINC or SNOMED CT codes from memory or training data. ALWAYS use the search and query scripts in this skill.
When any clinical code is needed:
python scripts/search_loinc.py "search term" FIRSTpython scripts/search_snomed.py "search term" FIRSTClinical codes from AI memory are highly unreliable and will cause incorrect clinical coding.
Requires whitelisted network access:
clinicaltables.nlm.nih.gov (LOINC search)tx.fhir.org (FHIR terminology server for LOINC answer lists and SNOMED CT search)If network access fails, STOP. Do not suggest codes.
ALWAYS run this before suggesting any LOINC code (clinical questions/observations):
python scripts/search_loinc.py "depression screening"
python scripts/search_loinc.py "blood pressure" --format fhir
ALWAYS run this before suggesting any SNOMED CT code (clinical concepts/conditions):
python scripts/search_snomed.py "diabetes"
python scripts/search_snomed.py "hypertension" --format fhir
python scripts/search_snomed.py "diabetes mellitus" --semantic-tag "disorder"
Note: The --semantic-tag filter works best when the semantic tag appears in the display name (e.g., "Diabetes mellitus (disorder)").
For questions with standardized answers:
python scripts/query_valueset.py --loinc-code "72166-2"
python scripts/query_valueset.py --loinc-code "72166-2" --format fhir
Before finalizing:
python scripts/validate_questionnaire.py questionnaire.json
Start with assets/templates/:
minimal.json - Bare bones structurebasic.json - Simple questionnaireadvanced.json - Complex with conditional logic# Step 1: Find panel code (NEVER skip this)
python scripts/search_loinc.py "PHQ-9 panel"
# Step 2: Find answer options
python scripts/query_valueset.py --loinc-code "FOUND-CODE" --format fhir
# Step 3: See examples/templates
# Check references/examples.md for complete implementations
# Step 1: Start with template
cp assets/templates/advanced.json my-questionnaire.json
# Step 2: For any clinical questions, search LOINC
python scripts/search_loinc.py "body weight"
# Step 3: Add answer options if available
python scripts/query_valueset.py --loinc-code "FOUND-CODE"
# Step 4: For custom questions without LOINC results, use inline answerOptions
# (no coding system needed - just code + display)
# Step 5: Validate
python scripts/validate_questionnaire.py my-questionnaire.json
When LOINC search returns no suitable answer list, use inline answerOption with system-less valueCoding by default. This is the simplest, spec-compliant approach for custom answer lists:
{
"linkId": "sleep-quality",
"type": "choice",
"text": "How would you rate your sleep quality?",
"answerOption": [
{"valueCoding": {"code": "good", "display": "Good"}},
{"valueCoding": {"code": "fair", "display": "Fair"}},
{"valueCoding": {"code": "poor", "display": "Poor"}}
]
}
Do NOT invent a coding system URI. Omitting system is valid FHIR and signals that these are local, questionnaire-scoped codes.
If the user explicitly requests reusable codes that can be shared across questionnaires, use the Welshare namespace (http://codes.welshare.app) via the helper script:
python scripts/create_custom_codesystem.py --interactive
This creates a CodeSystem + ValueSet pair. To convert an inline answer list to the reusable format, add "system": "http://codes.welshare.app/CodeSystem/ to each valueCoding and optionally reference the ValueSet via answerValueSet. See references/loinc_guide.md for details.
enableWhen to show/hide questions"repeats": true for medications, allergies, etc.query_valueset.py --loinc-code "CODE" for LOINC-backed answer listsanswerOption with valueCoding (no system) for non-standardized choicesSee references/examples.md for complete working examples.
python scripts/search_loinc.py "blood pressure"
python scripts/search_loinc.py "depression" --limit 10 --format fhir
python scripts/search_snomed.py "diabetes"
python scripts/search_snomed.py "hypertension" --limit 10 --format fhir
python scripts/search_snomed.py "asthma" --format table
python scripts/search_snomed.py "diabetes mellitus" --semantic-tag "disorder"
Formats: json (default), table, fhir Semantic tags (when present in results): disorder, finding, procedure, body structure, substance, organism Note: Semantic tag filtering only works when tags are included in the display name from the terminology server.
python scripts/query_valueset.py --loinc-code "72166-2"
python scripts/query_valueset.py --loinc-code "72166-2" --format fhir
python scripts/query_valueset.py --search "smoking"
Alternative servers (if tx.fhir.org fails):
--server https://hapi.fhir.org/baseR4--server https://r4.ontoserver.csiro.au/fhirpython scripts/validate_questionnaire.py questionnaire.json
python scripts/validate_questionnaire.py questionnaire.json --verbose
python scripts/extract_loinc_codes.py questionnaire.json
python scripts/extract_loinc_codes.py questionnaire.json --validate
python scripts/create_custom_codesystem.py --interactive
Only use when the user explicitly requests reusable codes across questionnaires. Uses the Welshare namespace: http://codes.welshare.app. Default for custom answers is inline answerOption without a coding system.
--server flagreferences/fhir_questionnaire_spec.md for requirementsanswerOption with system-less valueCoding (code + display only). Do NOT fall back to a custom coding system unless the user explicitly requests itWe've assembled deep knowledge for you to consult on specific topics. Checkout the index file on See REFERENCE.md and drill down the knowledge path for highly detailed instructions on modelling questionnaires.