LEGLINK-639: Terminology reads value-set membership status - #1769
Merged
MikeAtPinnacle merged 1 commit intoJul 29, 2026
Conversation
ValueSet CSV files may now carry an optional trailing Status column (system,code,display,status), mirroring the CodeSystem support added in LEGLINK-541/580. Value-set membership status is independent of the code system: a code can remain active in its code system yet be dropped from a value set's membership. When a member carries a membership status it is authoritative and overrides the code system; a member with no membership status falls back to the code-system rejoin (LEGLINK-580 behavior). - Add ValueSetCode : Code carrying its own CodeStatus. - CsvValueSetRecord gains an optional [Index(3)] Status column ([Default(Active)] + [EnumIgnoreCase]). - ProcessValueSetCsv accepts 3 or 4 columns and selects the member type by header width (4-col -> ValueSetCode, 3-col -> plain Code). This also fixes a latent bug where a 4-column value-set file threw and was silently swallowed by LoadCache, leaving that value set absent from the cache. - LoadCache tolerates a missing trailing field for ValueSet as well. - FhirService.ResolveIsActive treats a ValueSetCode status as authoritative, falling through to the code-system rejoin only for plain Codes. Testing: 59/59 Terminology unit tests pass, including 4 new value-set status-parsing tests and 2 override-semantics tests.
Contributor
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
johnbritton
approved these changes
Jul 29, 2026
MikeAtPinnacle
deleted the
users/mtherien/leglink-639-valueset-verification
branch
July 29, 2026 15:47
1 task
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.
🛠️ Description of Changes
Extends the optional
Status(active/inactive) column support from CodeSystem CSV files to ValueSet CSV files, so value-set membership status is honored independently of code-system status.Per Irene Zhuo, value-set membership carries its own active/inactive status: an intensional value set is expanded from a code system, and a code can remain active in the code system yet be dropped from the value set's membership. When a member carries a membership status it is authoritative and overrides the code system; a member with no membership status falls back to the existing code-system rejoin (LEGLINK-580 behavior).
ValueSetCode : Codecarrying its ownCodeStatus.CsvValueSetRecordgains an optional[Index(3)] Statuscolumn ([Default(Active)]+[EnumIgnoreCase]), mirroringCsvCodeSystemRecord.CodeGroupCacheService.ProcessValueSetCsvnow accepts 3 or 4 columns (system,code,display[,status]) and selects the member type by header width — 4-col →ValueSetCode, 3-col → plainCode. This also fixes a latent bug where a 4-column value-set file threw inProcessValueSetCsvand was silently swallowed byLoadCache, leaving that value set absent from the cache.CodeGroupCacheService.LoadCachenow tolerates a missing trailing field for ValueSet (not just CodeSystem).FhirService.ResolveIsActivetreats aValueSetCodestatus as authoritative, falling through to the code-system rejoin only for plainCodemembers.This is a Terminology-service-only change. The terminology service already emits the same
Code is inactive.OperationOutcome whenever a code is inactive, so value-set-membership inactivation surfaces and categorizes through the identical Validation path — no Java,categories.json,app-config.yaml, or migration changes.🧪 Testing Performed
dotnet test DotNet/ServiceTests/ServiceTests.csproj --filter "FullyQualifiedName~Terminology"→ 62/62 passing (includes the new value-set tests below and the existing CodeSystem/rejoin coverage).dev(including LEGLINK-814 duplicate-CSV-code handling) with tests still green.🧑🔬 Unit Testing
Coverage: 100.0%
CodeGroupCacheServiceTests.LoadCache_ValueSetWithStatusColumn_LoadsValueSetCodeWithStatus— 4-col file loadsValueSetCodewith the file's Active/Inactive status.CodeGroupCacheServiceTests.LoadCache_ValueSetBlankStatus_DefaultsToActive— blank status defaults to Active.CodeGroupCacheServiceTests.LoadCache_ValueSetNoStatusColumn_LoadsPlainCode— 3-col file loads plainCode(no membership status → rejoin path preserved).CodeGroupCacheServiceTests.LoadCache_ValueSetMixedCaseStatus_ParsesCaseInsensitively— mixed-case status parses correctly.FhirServiceTests.ValidateCodeInValueSet_ValueSetCodeInactive_OverridesActiveCodeSystem_ReturnsInactiveIssue— inactive membership overrides an active code system.FhirServiceTests.ValidateCodeInValueSet_ValueSetCodeActive_OverridesInactiveCodeSystem_ReturnsNoIssue— active membership overrides an inactive code system.Updated
ProcessValueSetCsv_InvalidColumnCount_ThrowsException(4 columns is now valid; asserts on a 5-column header) and switchedProcessValueSetCsv_WithValidData_CallsSetCodeGroupto the sharedCreateCsvReaderhelper.📓 Documentation Updated
No documentation changes required — this is a data-format extension to an existing feature with no new config keys or public API surface.
Summary by CodeRabbit
New Features
Bug Fixes