-
Notifications
You must be signed in to change notification settings - Fork 7
Description
Summary
$subsumes returns a different subsumption outcome for post-coordinated SNOMED expressions compared to the Pascal server. The dev server says 404684003 (Clinical finding) "subsumes" the expression 22298006:363698007=80891009 (Myocardial infarction with Finding site = Heart structure), while the Pascal server says "not-subsumed".
Repro
# Prod (returns "not-subsumed")
curl -s -H 'Accept: application/fhir+json' \
'https://tx.fhir.org/r4/CodeSystem/$subsumes?system=http://snomed.info/sct&codeA=404684003&codeB=22298006%3A363698007%3D80891009'
# Dev (returns "subsumes")
curl -s -H 'Accept: application/fhir+json' \
'https://tx-dev.fhir.org/r4/CodeSystem/$subsumes?system=http://snomed.info/sct&codeA=404684003&codeB=22298006%3A363698007%3D80891009'Prod response:
{"resourceType": "Parameters", "parameter": [{"name": "outcome", "valueCode": "not-subsumed"}]}Dev response:
{"resourceType": "Parameters", "parameter": [{"name": "outcome", "valueCode": "subsumes"}]}Notes
The correct answer here is debatable. The focus concept of the post-coordinated expression is 22298006 (Myocardial infarction), which IS a descendant of 404684003 (Clinical finding). Adding a refinement (363698007=80891009, Finding site = Heart structure) only narrows the concept further, so an argument can be made that Clinical finding should still subsume it. However, prod's answer may reflect stricter handling of refined expressions in the subsumption logic.
The relevant code is in tx/cs/cs-snomed.js lines 886-923 (subsumesTest) and tx/sct/expressions.js (expressionSubsumes). Worth investigating whether the JS expressionSubsumes() implementation correctly handles refinement-based subsumption.