-
Notifications
You must be signed in to change notification settings - Fork 6
Open
Labels
Description
Bug
When the same code is provided as both codeA and codeB, the server should always return equivalent (reflexivity). For four code systems, it incorrectly returns not-subsumed. SNOMED CT works correctly.
| Code System | codeA=codeB | Expected | Actual |
|---|---|---|---|
| LOINC | 1963-8 | equivalent | not-subsumed |
| UCUM | kg | equivalent | not-subsumed |
| BCP-47 | en | equivalent | not-subsumed |
| ISO-3166 | US | equivalent | not-subsumed |
| SNOMED CT | 22298006 | equivalent | equivalent (correct) |
Root cause is likely that the subsumption logic doesn't check code equality before attempting hierarchy traversal, and for systems without hierarchy support it falls through to not-subsumed.
Repro
# LOINC — returns not-subsumed (WRONG)
curl -s 'https://tx-dev.fhir.org/r4/CodeSystem/$subsumes?system=http://loinc.org&codeA=1963-8&codeB=1963-8' \
-H 'Accept: application/fhir+json'
# UCUM — returns not-subsumed (WRONG)
curl -s 'https://tx-dev.fhir.org/r4/CodeSystem/$subsumes?system=http://unitsofmeasure.org&codeA=kg&codeB=kg' \
-H 'Accept: application/fhir+json'
# SNOMED — returns equivalent (CORRECT, for comparison)
curl -s 'https://tx-dev.fhir.org/r4/CodeSystem/$subsumes?system=http://snomed.info/sct&codeA=22298006&codeB=22298006' \
-H 'Accept: application/fhir+json'Spec reference
Subsumption is reflexive by definition — every concept subsumes itself. The outcome equivalent means "A subsumes B and B subsumes A", which must always be true when A=B. The fix is simple: check codeA === codeB before hierarchy lookup.
Reactions are currently unavailable