| name | loinc-lookup |
| description | Look up LOINC codes for standardized clinical observations and panels via fhir.loinc.org. Use when populating Questionnaire.code / item.code with the right LOINC for a validated instrument item, or to map a draft question onto an existing LOINC observation. |
LOINC lookup
When to use this
- You're authoring items that map to a known LOINC observation
(e.g. "PHQ-9 total score" = LOINC
44261-6).
- You're populating
Questionnaire.code or item.code and want
the canonical LOINC.
- You need to distinguish "LOINC for the panel" vs "LOINC for the
individual item".
How to do it
LOINC's terminology server speaks FHIR $lookup and $expand:
https://fhir.loinc.org/CodeSystem/$lookup?system=http://loinc.org&code=<code>
https://fhir.loinc.org/CodeSystem/$find-matches?system=http://loinc.org&...
https://fhir.loinc.org/ValueSet/$expand?url=<panel-url>
Auth: requires a free LOINC account; the orchestrator passes
LOINC_USERNAME / LOINC_PASSWORD if set.
Panels vs items
A panel LOINC code denotes the entire instrument; each item has its
own LOINC. PHQ-9 example:
- Panel total:
44249-1
- Item 1 ("Little interest"):
44250-9
- Total score:
44261-6
Populate Questionnaire.code with the panel; item.code with the
per-item LOINC; and (optionally) the score-result's code with the
score LOINC.
LOINC parts
LOINC parts (component, property, system, scale, method, time) help
when no exact code exists. If you can't find one, do NOT invent —
say so in reply.md and leave code empty.
Pitfalls
- LOINC for the score vs LOINC for "the question". They are
different codes; use the one that matches the field semantics.
- LOINC for adult vs pediatric versions — separate codes.
- Localized translations can change the LOINC; check the
localizedLanguage part if you're authoring non-English items.