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.
Installer avec Codex ou Claude Copiez ce prompt, collez-le dans Codex, Claude ou un autre assistant, puis laissez-le vérifier la page du skill et l'installer pour vous.
Une commande directe contourne le prompt de vérification. Examinez la source avant de l'exécuter.
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"}
FHIR Questionnaire Skill
⚠️ CRITICAL RULES - READ FIRST
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:
For clinical questions/observations: ALWAYS run python scripts/search_loinc.py "search term" FIRST
For clinical concepts/conditions: ALWAYS run python scripts/search_snomed.py "search term" FIRST
ONLY use codes returned by the scripts
If search fails or returns no results, DO NOT make up codes
Clinical codes from AI memory are highly unreliable and will cause incorrect clinical coding.
Network Access Requirements
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.
Essential Scripts (Use These Every Time)
1. Search LOINC Codes
ALWAYS run this before suggesting any LOINC code (clinical questions/observations):
# Step 1: Start with templatecp 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
Custom Answer Lists (When LOINC Has No Match)
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.
Opt-in: Reusable Welshare Coding System
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:
This creates a CodeSystem + ValueSet pair. To convert an inline answer list to the reusable format, add "system": "http://codes.welshare.app/CodeSystem/<category>/<id>.json" to each valueCoding and optionally reference the ValueSet via answerValueSet. See references/loinc_guide.md for details.
Common Patterns
Conditional display: Use enableWhen to show/hide questions
Repeating groups: Set "repeats": true for medications, allergies, etc.
Standardized answers: Use query_valueset.py --loinc-code "CODE" for LOINC-backed answer lists
Custom answers: Use inline answerOption with valueCoding (no system) for non-standardized choices
See references/examples.md for complete working examples.
Formats:json (default), table, fhirSemantic 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.
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.
Troubleshooting
No LOINC results: Use broader search terms (e.g., "depression" not "PHQ-9 question 1")
Network errors: Try alternative servers with --server flag
Validation errors: Check references/fhir_questionnaire_spec.md for requirements
No answer list found: Use inline answerOption with system-less valueCoding (code + display only). Do NOT fall back to a custom coding system unless the user explicitly requests it
Deep Knowledge References
We'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.