Repository navigation
Conversation
A ValueSet filter such as concept in 41000147108 or concept is-a 584021000052104, naming a concept the edition does not have, threw a plain Error, so $expand answered 500 (exception / invalid-data). The concept filter helpers (=, is-a, descendent-of, child-of, generalizes, descendent-leaf, is-not-a, in) now throw a 400 OperationOutcome issue, error / invalid / vs-invalid, with the same "The SNOMED CT Concept X is not known" text. This is the same form an unknown concept in ECL already gets (tx-ecosystem snomed-expand-ecl-unknown-concept). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
|
How I feel about this depends on https://chat.fhir.org/#narrow/channel/437028-Terminology-Service-Test-Cases/topic/Filter.20on.20an.20invalid.20Conceptwhat/with/638487832. There is not consistency on this form FHIRsmith or in the test cases, and there should be, but there's two possible outcomes: silently drop the invalid code wherever it is found, or make it an error. I favour silently dropping it, but will see based on the discussion |
Contributor
|
I think this is superceded by #396 now |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A
$expandwhose SNOMED CT filter names a concept that the edition does not have now answers 400 (error /invalid/ tx-issue-typevs-invalid). Before this change it answered 500 (exception/invalid-data). Examples areconcept in 41000147108(a refset that only exists in another edition) andconcept is-a 584021000052104. The value set is invalid, so this is a client error, not a server failure.HTTP 500,{"severity":"error","code":"exception","details":{"text":"The SNOMED CT Concept 41000147108 is not known","coding":[{"system":".../tx-issue-type","code":"invalid-data"}]},"diagnostics":"..."}HTTP 400,{"severity":"error","code":"invalid","details":{"text":"The SNOMED CT Concept 41000147108 is not known","coding":[{"system":".../tx-issue-type","code":"vs-invalid"}]}}This matches what an unknown concept in ECL already gets: the same
Issue, error /invalid/vs-invalid,handleAsOO(400)(tx-ecosystemsnomed-expand-ecl-unknown-concept). The text stays "The SNOMED CT Concept X is not known". That is the text ECL wraps inINVALID_ECL, and there is no ECL expression to quote here, so the issue carries no message id.Change. In
tx/cs/cs-snomed.js, the concept filter helpers throw this issue instead of a plainError. That covers=,is-a,descendent-of,child-of,generalizes,descendent-leaf,is-not-aandin, for both theconceptandcodeproperties. ECL evaluation also calls these helpers, and its result does not change: it re-wraps the error asINVALID_ECLas before.Tests. 13 new tests, all of which fail on main:
tests/cs/cs-snomed.test.js: 9 tests, one per operator, plusinwith a known concept followed by an unknown one. Each test checks for a 400 issue with this code, tx-issue-type and text.tests/tx/expand-snomed-whole.test.js: 4 tests. Each runs$expandover HTTP forin(an unknown refset),is-a,=anddescendent-of, expects 400, and checks that the issue matches the one<< Xin ECL gives.Results with this change:
tests/txwithout test-cases: 1356 passed.tests/tx/test-cases.test.js: 5182 passed.tests/cs: 1483 passed. 4 failed, and the same 4 fail on unchanged main in the same environment (3 LOINC external-mapping tests from a stale local test database, and 1 RXNATOMARCHIVE read-only test).🤖 Generated with Claude Code