Skip to content

Comments

Add golden test for Colorado claims extract SQL formatting#16

Merged
datastx merged 2 commits intomainfrom
claude/colorado-claims-extract-m4M3g
Feb 23, 2026
Merged

Add golden test for Colorado claims extract SQL formatting#16
datastx merged 2 commits intomainfrom
claude/colorado-claims-extract-m4M3g

Conversation

@datastx
Copy link
Owner

@datastx datastx commented Feb 23, 2026

Summary

Added a new golden test case for SQL formatting validation of a complex dbt model that generates Colorado APCD (All Payers Claims Database) medical claims extracts.

Changes

  • New test file: tests/data/unformatted/222_colorado_claims_extract.sql

    • Contains a dbt model for Colorado claims medical data extraction and formatting
    • Includes complex SQL with multiple CTEs (Common Table Expressions) for claims processing, aggregation, and report generation
    • Demonstrates formatting of pipe-delimited output for compliance reporting
    • Marked with disable-parser comment due to conditional logic in the model
  • Updated test registry: tests/golden_test.rs

    • Added new golden test macro golden_unformatted_222_colorado_claims_extract to validate formatting of the Colorado claims extract model

Implementation Details

The test file includes a complete dbt model that:

  • Processes Colorado all-payers claims data with multiple transformation stages
  • Calculates aggregated amounts by claim type (vision, dental, other)
  • Generates header, data, and trailer records in pipe-delimited format
  • Uses dynamic column selection via Jinja templating to exclude internal fields
  • Implements surrogate key generation for claim identification

https://claude.ai/code/session_014YynqZn3ATqFB64gfvD8m9

claude and others added 2 commits February 23, 2026 17:44
This test exposes a bracket validation bug where jinja if/else branches
containing SQL with closing parens cause the validator to see brackets
from *both* mutually exclusive branches, driving depth negative.

https://claude.ai/code/session_014YynqZn3ATqFB64gfvD8m9
@datastx datastx merged commit 8d8857c into main Feb 23, 2026
9 checks passed
@datastx datastx deleted the claude/colorado-claims-extract-m4M3g branch February 24, 2026 07:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants