Repository navigation
Conversation
…operties and filters, full $lookup, CodeSystem $subsumes CodeSystem reads show what the OCL API holds about properties and filters (OpenConceptLab/ocl_issues#2262): - CodeSystem.property: the source version's own declarations, then OCL's conceptclass and datatype, and the standard inactive (boolean, was declared as a Coding) and status (code), each with its concept-properties uri. - CodeSystem.filter in R4's shape, replacing the non-FHIR filters key; R5-only operators are left out. Written CodeSystems take filter too, keeping what R4 can't show, and read inactive under any code they declare with the standard inactive meaning, so a read written back keeps a retired concept retired. - Each concept's property values, read from its extras as the API reads them (Concept.get_property_value, factored out of Concept.properties), as the declared type's value[x]. A retired concept also has status retired. $lookup takes property (repeating, *, lang.X): definition, designations, the declared properties, and parent and child with each one's display, read with the step the API's version views use (get_version_hierarchy_queryset), at most FHIR_LOOKUP_RELATED_LIMIT of each. Without property the answer is unchanged. CodeSystem/$subsumes and CodeSystem/{id}/$subsumes, GET and POST, with codeA/codeB and system (version) or codingA/codingB: equivalent, subsumes, subsumed-by or not-subsumed, on the same hierarchy step, whatever hierarchyMeaning says (ICD-10, ICD-11 and ATC declare grouped-by). Bounded by FHIR_SUBSUMES_HIERARCHY_LIMIT and FHIR_SEARCH_TIMEOUT_MS; a walk cut before the answer is too costly (422). The IG's errors: no system (SUBSUMPTION_NO_SYSTEM), an unknown code (404 code-invalid), two code systems or versions, an unresolved code system. Declared in the CapabilityStatement and documented in the FHIR Swagger with $lookup's property. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXmZjc3rGYio3yCj6V
…52-cascade) the FHIR hierarchy builds on Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXRkP3QEc5U3NfPZp9
…nd child read the hierarchy by $cascade's step - core.fhir.hierarchy no longer has its own step. $lookup's parents and children, and $subsumes's ancestors, take $cascade's hierarchy step (Concept.get_hierarchy_queryset, the one $cascade takes from each concept, retired concepts included), so FHIR and the API share one definition of the hierarchy, as fixed in the $cascade change it builds on (#1085). - FHIR keeps its bounded walk around that step, reading each concept once (a release can hold two rows of a code): parents and children are a probe of at most FHIR_LOOKUP_RELATED_LIMIT + 1 concepts; the walk up is a level at a time, one query a level (the step from each of its concepts in one union), reading at most FHIR_SUBSUMES_HIERARCHY_LIMIT + 1 concepts with the code itself, the first by concept across a level. The extra one only shows a cut, and what it found within the limit is kept. At HEAD a level also reads each concept's latest version (Concept.get_hierarchy_ids takes it from an annotation when a query gives one), so the walk stays one query a level. Both run within FHIR_SEARCH_TIMEOUT_MS. - Answers are unchanged on this branch's tests, the LOINC 2.81 shape included. Tests check the probes' limits, one query a level (at HEAD too), the last place in a cut level, and duplicate rows. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qXRkP3QEc5U3NfPZp9
…I PRs Two conflicts: - core/concepts/models.py: the API PRs' version. It holds this PR's two changes there (Concept.get_property_value, and the hierarchy step reading an annotated latest version), which now come with the API PRs, beside #1088's level-at-a-time hierarchy step. - core/settings.py: both sides' settings. 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
…d into fhir-452-stored-ops Takes #1083'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
…d into fhir-452-stored-ops Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qX3xher9sfoCLLKrTC
…d (with fhir-452-b9-valueset and phase C's storage and core) into fhir-452-stored-ops One conflict, in CodeSystemDetailSerializer.to_internal_value: this branch adds the codes a written CodeSystem declares the standard inactive property under (inactive_codes); B-9 reads whether it's a supplement and its language from HEAD, which an update saves onto (update_head). Both are kept: the context reads HEAD and carries inactive_codes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01AaZ4qWapJWFsFc1Xjopf9k
…d into fhir-452-stored-ops 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
…d into fhir-452-stored-ops 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
…d into fhir-452-stored-ops 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
This was referenced Dec 1, 2026
…d into fhir-452-stored-ops Takes #1083'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-engine Takes #1084'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-stored-ops, basefhir-452-capabilities(#1083). The second FHIR PR of the series for OpenConceptLab/ocl_online#452.Updated Nov 30: the series now sits on all of the OCL API PRs, which end in #1094. This branch merges #1083's new head (
5ccd6405). Its earlier merge of the$cascadefix is now the API PRs' own (#1085, with #1088's level-at-a-time step). Its two changes toConcept(get_property_value, and the hierarchy step reading an annotated latest version) moved to #1094, so no core change ships only in a FHIR PR. Two conflicts, both in the merge message:core/concepts/models.pytakes the API PRs' version, andcore/settings.pykeeps both sides. The diff now holds only the FHIR layer.What it does
For content OCL stores (sources and their versions):
CodeSystem.property: the source version's own declarations, then OCL's (conceptclass,datatype), and the standardinactive(boolean; it was declared as a Coding) andstatus(code), each with its concept-properties uri.CodeSystem.filterin R4's shape, replacing the non-FHIRfilterskey. R5-only operators are left out. Written CodeSystems acceptfilterand keep what R4 can't show.Concept.get_property_value, in OpenConceptLab/ocl_online#452 | An expansion evaluation narrowed to some codes; an import's codes matched as a code reference matches them #1094), typed as declared. A value that isn't of the declared type is left out. A retired concept is alsostatus: retired.$lookup:property(repeating,*,lang.X), returning definition, designations, the declared properties, andparent/childwith each one's display. GET and POST withcoding. Withoutproperty, the answer is unchanged.$subsumes, type and instance level, GET and POST, withcodeA/codeB+system(version) orcodingA/codingB. Outcomesequivalent,subsumes,subsumed-by,not-subsumed. The IG's errors: no system (SUBSUMPTION_NO_SYSTEM, 400), an unknown code (404code-invalid, naming the code, the code system and the input), two code systems or versions, an unresolved code system (422).$cascadehierarchy:$subsumesand$lookup's parent and child take$cascade's own step (Concept.get_hierarchy_queryset, through the model), so FHIR and the API share one definition of the hierarchy. With OpenConceptLab/ocl_online#452 | $cascade in a source version or a collection follows a link to any row of a concept #1085, a release whose links point at an older row of a parent still has that parent.$subsumesa walk up of one query a level. At HEAD a level also reads each concept's latest version, which the query annotates (get_level_hierarchy_idsreads the annotation, in OpenConceptLab/ocl_online#452 | An expansion evaluation narrowed to some codes; an import's codes matched as a code reference matches them #1094).hierarchyMeaningsays. ICD-10, ICD-11 and ATC declaregrouped-by, and clients expect chapter and block subsumption from them.FHIR_SUBSUMES_HIERARCHY_LIMIT(1,000) andFHIR_SEARCH_TIMEOUT_MS; a walk cut before the answer is a 422 (too costly).$lookup's parents and children are bounded byFHIR_LOOKUP_RELATED_LIMIT(1,000). Both are fixed server settings, the same for every caller.$subsumes; the Swagger documents$lookup'sproperty.Why
The IG asks for
$lookupwithpropertyand for$subsumes(requirements.md; thesimple-cases,parametersandthosuites test them). FHIR's CodeSystem resource haspropertyandfilter, and OCL'sfilterskey wasn't FHIR.How it was tested
core.fhir,core.code_systems,core.conceptsand their integration tests); CI runs the full suite once it's pushed. The whole stack's full gate is in the last PR of the series.$lookupand$subsumes(core/fhir/tests_properties.py,tests_ops_hierarchy.py,tests_capabilities.py,tests_swagger.py,core/integration_tests/tests_code_systems.py).$cascade's step: Codex checks, every finding answered (two about the API's HEAD hierarchy and$cascade's own walk, outside this PR, are recorded for a later fix).What changes for existing callers
filterreplacesfilters. A client that readsfiltersmust readfilter(FHIR's name and shape).inactiveis declared as boolean;statusis declared; concept property values are typed as their source declares them (CIEL'sdatatypeisvalueCode); a retired concept carriesstatus: retired.filter; the legacyfilterskey is no longer read, so a writer must sendfilter. It also readsinactiveunder any code the written CodeSystem declares with the standard inactive meaning, so a read written back keeps a retired concept retired.CodeSystem/$subsumesandCodeSystem/{id}/$subsumes.$lookupwithoutpropertyanswers as before.$lookup's parent and child, and$subsumes, read the hierarchy as the API's HEAD hierarchy does.Risks
filterstofilterrename is the one breaking change for API clients that read or write FHIR CodeSystems.$subsumesreads up to the limit's ancestors per code, one query a level. The limit and the search timeout bound it.Rollback
Revert this PR. No migrations; the two new settings have defaults.
Rechecked on the updated branch (Nov 30)
On
68818bd7: pylint 10.00 (core); the FHIR, CodeSystem, ValueSet, concept and their integration tests with Elasticsearch: 1,372 OK, 2 skipped, and one failure that passes run alone (ConceptRetiredFacetCountsTest.test_global_facets: a search-index test that can see another test's documents when they run together; 12 of 12 OK alone).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_01AaZ4qTFRu4tcrkh4W8bA4T
https://claude.ai/code/session_01AaZ4qV2gzsF5GhF5BwTJ6x