Repository navigation
Map CCLF3 procedure codes to icd-10-pcs and icd-9-pcs - #107
Merged
mkrahu-z2 merged 2 commits intoOct 30, 2026
Merged
Conversation
int_institutional_claim_deduped mapped DGNS_PRCDR_ICD_IND on the CCLF3
procedure codes to icd-10-cm ('0') and icd-9-cm ('9'), the diagnosis code
systems. The codes are ICD procedure codes, and the Tuva input layer
accepts only icd-10-pcs and icd-9-pcs for procedure_code_type. Tuva Core's
normalized__medical_claim_procedures joins its ICD-10-PCS and ICD-9-PCS
terminology on those values, so every inpatient ICD procedure from CCLF
was left without a normalized code.
Add a unit test for both indicator values and a fixture test that every
medical_claim row with a procedure code has an ICD-PCS code type.
Contributor
Author
|
@aneiderhiser @thuxuan-vu gentle ping on this one (fixes #106). |
mkrahu-z2
approved these changes
Oct 30, 2026
Merged
DG47
pushed a commit
to DG47/medicare_cclf_connector
that referenced
this pull request
Nov 3, 2026
Patch release with the bug fixes merged since v1.0.0: tuva-health#105, tuva-health#107, tuva-health#109, tuva-health#111.
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.
Summary
Fixes #106. Label:
bug.int_institutional_claim_dedupedmapped the CCLF3DGNS_PRCDR_ICD_INDtoicd-10-cm(0) andicd-9-cm(9) forprocedure_code_type. Those are the diagnosis code systems. The CCLF3 codes are ICD procedure codes, and the Tuva input layer accepts onlyicd-10-pcsandicd-9-pcsforprocedure_code_type.Why it matters: Tuva Core 1.0
normalized__medical_claim_proceduresjoinsterminology__icd_10_pcsonraw_code_system = 'icd-10-pcs'andterminology__icd_9_pcson'icd-9-pcs'. Withicd-10-cm, neither join matches, so every inpatient ICD procedure from CCLF ended up with a nullnormalized_codeandnormalized_description.data_quality__medical_claim_line_flagsalso flagged every one of those rows as having an invalidprocedure_code_type. The diagnosis mapping (diagnosis_code_type) was already correct and is unchanged.Tests:
int_institutional_claim_deduped_maps_procedure_code_type_to_icd_pcs: one claim with indicator0(0DTJ4ZZ) and one with9(4701), expectingicd-10-pcsandicd-9-pcs.fixture_procedure_code_type_icd_pcs: everymedical_claimrow with a procedure code hasicd-10-pcsoricd-9-pcs. It uses the existing seeds (inpatient claims 0000000001001, 0000000001021 and 0000000001022, which carry5A1D70Zand30233N1); no fixture rows change.Evidence
DuckDB, run locally with the uv-locked toolchain (dbt-core 1.10.20, dbt-duckdb 1.10.1).
fixture_procedure_code_type_icd_pcsFAIL 12: all 12 inpatient rows with procedure codes haveicd-10-cm.int_institutional_claim_deduped_maps_procedure_code_type_to_icd_pcsFAIL: goticd-10-cmandicd-9-cm.build --full-refresh --select package:medicare_cclf_connector package:integration_tests --exclude package:integration_tests,resource_type:seed --indirect-selection cautious):PASS=109 WARN=0 ERROR=0 SKIP=0.test --select "package:medicare_cclf_connector,test_type:unit"):PASS=18 WARN=0 ERROR=0.uv lock --check: passes.Merge Danger
Door: two-way
Blast Radius:
procedure_code_typeon institutional claimsUsers downstream will see
icd-10-pcs/icd-9-pcsinstead oficd-10-cm/icd-9-cmon institutional rows that carry ICD procedure codes. Tuva Core then normalizes those procedures, socore.proceduregains normalized codes and descriptions for inpatient ICD procedures it previously left null. Anything that filtered on the oldicd-10-cmvalue for procedures would need updating.