Repository navigation
Conversation
…ate-code on content the request carries - Membership (core.fhir.workspace.membership): whether a value set holds a code, as OCL's own evaluation answers it over the request's workspace. The value set's definition is read as $expand reads it; each include is evaluated on its own by OCL's expansion model, narrowed to the code asked about (ExpansionEvaluation.narrowed_to), with the value set's exclusions applied as OCL applies them. A value set reached by several routes is prepared once for the request. - ValueSet and CodeSystem $validate-code (core.fhir.engine.validate) as the HL7 Terminology Ecosystem IG sets them out: a code, a Coding or a CodeableConcept, with the version rules, display checks and the IG's issues and message ids. core.fhir.ops.validate_code hands a request that carries terminology resources to the engine, as $expand does. - $batch-validate-code at the type level, for ValueSet and CodeSystem (core.fhir.ops.batch_validate): many validations in one request, the top-level inputs applying to each, at most FHIR_TX_BATCH_LIMIT. POST only. The capability statement leaves it out: it has no R4 OperationDefinition, and the IG's cases expect each resource type to list exactly FHIR's own. - The engine's answers are written as R4 Parameters as they come. - Tests: the engine's $validate-code, membership, batch validation, and the engine over stored code systems and value sets. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qV2gzsF5GhF5BwTJ6x
This was referenced Nov 30, 2026
Draft
…to fhir-452-b-validate Takes #1097's new head, which brings in master's #1085, #1086 and #1082. No change to this branch's own code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWUTom6BGgjQy6oehZ
paynejd
added a commit
that referenced
this pull request
Dec 1, 2026
…into fhir-452-b-ops Takes #1098's new head, which brings in master's #1085, #1086 and #1082. No change to this branch's own code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWUTom6BGgjQy6oehZ
…to fhir-452-b-validate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWUTom6BGgjQy6oehZ
…to fhir-452-b-validate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qX3xher9sfoCLLKrTC
…ith fhir-452-b9-valueset and phase C's storage and core) into fhir-452-b-validate Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWapJWFsFc1Xjopf9k
…to fhir-452-b-validate Phase C's storage migrations and collections/0081 bound their lock waits; an import's stored expansion isn't read as it is when a supplement may apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWapJWFsFc1Xjopf9k
…to fhir-452-b-validate An import is evaluated again only when a supplement applies to a version it used. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWapJWFsFc1Xjopf9k
…to fhir-452-b-validate The migrations bound their lock waits before their first DDL, both ways. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWapJWFsFc1Xjopf9k
…as $expand does A carried value set that imports a value set OCL stores: its membership now asks OCL's evaluation of the import (core.collections.imports), narrowed to the code in question, which is what $expand reads. The stored expansion is read as before only where nothing the request brings can change what it holds. Where the request's version parameters can (system-version, force-system-version and the like), the import is evaluated again under them, so $validate-code and $expand give the same members. A coding's own version is held only in that release, as the stored expansion is read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…is asked within it; a member in each release Review fixes to e3e7bfc: - An include of a code system and a value set OCL stores is their intersection, which OCL evaluates release by release. The import is now asked within that code system part: OCL's evaluation of the part with that import alone, narrowed to the code, as $expand evaluates the include. An include pinning another release than a version parameter names now agrees with $expand. - An import evaluated again can hold a code in several releases: each is a member, so an exclusion of one release leaves the others (Workspace.held_entries). - A row the reader finds no concept for (a reserved code's) is no member, as $expand lists none; it no longer reaches the validation without a concept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…tersect as OCL's; version checks in each release Review fixes to 870fa43: - An include of value sets alone takes the first one's members, each in its version, that the others hold there, as OCL intersects them. A stored value set after the first is now answered by OCL's evaluation of the include, narrowed to the code, and the first one's members are kept in the releases that evaluation holds the code in. - A stored import's member is checked against check-system-version in each release the import's evaluation selected the code in, not only the one the answer picks, as $expand fails on any of them. - A code's exact spelling is preferred within each release, so a case-insensitive match in another release isn't dropped (Workspace.held_entries). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…CL's evaluation of the include decides Review fixes to 05da1ac. Of value sets alone, more than one and one of them stored, OCL's evaluation of the include, narrowed to the code, now gives the members: the first one's members, each in its version, that the others hold there, as $expand evaluates it. A carried one is asked only whether it leaves the answer open (it may hold the code in the first one's release though not on its own), and the first one only for its own entry for the code. A member is no longer one release the first one's own reading picked. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…filter, one parity helper From the simplification review: an evaluation's rows of a code, kept to a coding's own version, come from one helper (held_in); the paired $expand and $validate-code test of a carried import after a stored one uses the class's parity helper; Validation.member takes the members it picks from. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…settles it; its own members kept Fixes to c72e47d from the final review check: - Of value sets alone, more than one and one stored, the first one not holding the code settles it: OCL's intersection takes the first one's members, so a later one leaving the answer open (a fragment) can't make it a member. - Where the first one holds the code in a release OCL's evaluation keeps, its own members there are the members, each with its own entry for the code (two includes listing the code with their own displays both count). - A coding's wildcard version keeps the rows of the releases it matches (held_in). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…nswered by OCL's evaluation alone Fixes to a236bbe from the second final review check. An include of value sets alone, more than one and one of them stored, now has its own path (together_say): OCL's evaluation of the include, narrowed to the code, gives the members, one from each of its rows. The others are asked only whether they leave the answer open, and the first one for its own entries for the code: - a no from the first one counts only when OCL's evaluation holds nothing (a code in another case in a case-insensitive code system is held through the intersection); - each member keeps the first one's entry of its own include, and is checked as a stored import's member is, against check-system-version in every release it's in; - a wildcard version never keeps a row in no release (held_in). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…n open import keeps the answer open Fixes to 4e50dd6 from the third final review check: - When OCL's evaluation of the include holds the code but another value set leaves the answer open (an exclusion whose code system version can't be read), the answer stays open, as before the together path. - When the first value set doesn't hold the code, OCL's evaluation is asked before the others: holding nothing settles it, so a later one isn't read at the coding's release, where its filter may not apply. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…n the release kept; an unknown version reported - Of value sets alone, more than one and one of them stored, another's open answer is judged in the releases OCL's evaluation keeps once the value set's exclusions apply: those of the members they leave, else those of the first one's members they leave. Each is asked about the code in those releases, so one that is open only in a release the intersection doesn't use (a fragment) no longer overrides OCL's evaluation and the value set's exclusions. $validate-code agrees with $expand. - A stored import evaluated again whose code system a version parameter of the request names in a version that doesn't exist is now answered as a carried include of that code system is: open on the unknown version (x-caused-by-unknown-system), not "not in the value set". Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…pen answers; unknown versions where they apply Review fixes to 43d9543: - Another value set of an intersection is asked about the code in a release OCL's evaluation keeps only for whether it leaves the answer open: a filter of one of its includes it can't apply in that release is no open answer, as OCL's evaluation of the include doesn't fail on it. - When the first value set leaves the answer open, what the others leave open counts too, an unknown version among it, as for value sets alone that are all carried. - An unknown version a version parameter names is reported for a stored import only where its own reference that failed could select the code (one naming no single code, or that code): a value set listing other codes says the code isn't in it, as a carried include listing them does. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…their release; unknown versions through imports Review fixes to 0456bf1: - When the first value set of an intersection leaves the answer open, a later one not holding the code settles it, as when all are carried. - A carried value set whose includes of the code system can't be at a release OCL's evaluation keeps is no open answer there: it no longer answers from another release. - An unknown version a version parameter names, met through a stored value set the import imports, is reported where that value set's own failing reference could select the code, when the caller may view every value set on the route. - Only a concept reference counts as one that could select a code, not a mapping reference. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…h members isn't settled by a later no Review fixes to 535a15b: - When the first value set of an intersection leaves the answer open with members of its own (an exclusion that can't say), a later one's no doesn't settle it: OCL may hold those members in their releases through it. - A later value set asked about a coding's own version, when the first leaves the answer open, that can't apply one of its filters there is inconclusive, not an error. - An unknown version met only through a stored value set's exclusion isn't reported: no member can come of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
… flag, no sentinel From the simplification review: an import asked about a coding's own version that can't apply one of its filters there gives no answer (None), as the code reading it already treats one; whether another leaves the answer open is a flag; a test compares its two answers directly. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…ter error stands Fix to 36ea663 from the final review check: when the first value set of an intersection leaves the answer open, a later one asked about a coding that names no version is in its own evaluation, so a filter of it that can't be applied fails the request, as before; only one asked about the release a coding names is inconclusive. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXgSvP7oUQhCRnPJAH
…to fhir-452-b-validate Takes #1097's new head, which brings in master (#1089, #1109 and #1106): REFERENCE_SEARCH_OPTIONS_TOGGLE is on in every environment, as on master. Merged cleanly; no change to this branch's own code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVQviVc1p6MQwqUUed
paynejd
added a commit
that referenced
this pull request
Dec 2, 2026
…into fhir-452-b-ops Takes #1098's new head, which brings in master (#1089, #1109 and #1106): REFERENCE_SEARCH_OPTIONS_TOGGLE is on in every environment, as on master. Merged cleanly; no change to this branch's own code. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qVQviVc1p6MQwqUUed
This branch has not been deployed
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.
Branch
fhir-452-b-validate, basefhir-452-b-expand(#1097).Updated Dec 1: a value set carried in a request that imports a value set OCL stores is now read the same way by
$validate-codeand$expand.core/collections/imports.py), narrowed to the code in question. The stored expansion is read as before only where nothing the request brings can change it; under version parameters that can (system-version,force-system-versionand the like), the import is evaluated again under them.Include.held_within,Include.together_say). Whether another value set of such an include leaves the answer open is judged in the releases that evaluation keeps, after the value set's exclusions.check-system-versionin each.x-caused-by-unknown-system), where its failing reference could select the code.e3e7bfc8to45d8f960; tests incore/fhir/workspace/tests_membership.py. On this branch: pylint 10.00; the FHIR tests 1,124 OK (2 skipped), and 165 with Elasticsearch.What it does
core/fhir/workspace/membership.py): whether a value set holds a code, as OCL's own evaluation answers it over the request's workspace.$expandreads it.ExpansionEvaluation.narrowed_to, in OpenConceptLab/ocl_online#452 | An expansion evaluation narrowed to some codes; an import's codes matched as a code reference matches them #1094). The value set's exclusions apply as OCL applies them.$validate-code(core/fhir/engine/validate.py), as the HL7 Terminology Ecosystem IG sets them out: a code, a Coding or a CodeableConcept, with the version rules, display checks, and the IG's issues and message ids.core/fhir/ops/validate_code.pyhands a request that carries terminology resources to the engine, as$expanddoes.$batch-validate-codeat the type level, for ValueSet and CodeSystem (core/fhir/ops/batch_validate.py):FHIR_TX_BATCH_LIMIT.core/fhir/adapters/r4.py).Reading order
core/fhir/workspace/membership.py,core/fhir/engine/validate.py,core/fhir/ops/validate_code.py,core/fhir/ops/batch_validate.py, then the tests:core/fhir/engine/tests_validate.py,core/fhir/workspace/tests_membership.py,core/fhir/tests_batch_validate.py, andcore/fhir/tests_stored.py's engine-over-stored cases.What a reviewer checks
What changes for existing callers
$validate-codewith carried terminology resources is now answered for them. Before, the stored path didn't read them.ValueSet/$batch-validate-codeandCodeSystem/$batch-validate-code(POST).Size
About 1.4k lines of code and 1.5k of tests.
Rollback
Revert this PR and the ones after it, or turn
FHIR_WORKSPACE_TOGGLEoff. No migrations.How it was tested
core); the FHIR, CodeSystem and ValueSet tests with Elasticsearch: 1,313 OK, 2 skipped.The series
The FHIR layer for OpenConceptLab/ocl_online#452. It is one linear series, and each PR is based on the one before:
$lookup,$subsumes$expandon carried content, and dispatch$validate-codeand$batch-validate-code$lookup,$subsumesand$translateon carried contentEach diff is its own. The last one's tree is the whole that was tested: 707 of the HL7 Terminology Ecosystem IG's 707 in-scope test cases pass (
hl7.fhir.uv.tx-ecosystem1.11.0, general mode; supplements are out of scope). The series stays in draft until the whole ships, after the OCL API PRs. As those land on master, each PR here is retargeted, never force-pushed.🤖 Generated with Claude Code
https://claude.ai/code/session_01AaZ4qV2gzsF5GhF5BwTJ6x