Add chapter 08 — Conditional & Coalescing Sources (Case / Coalesce) - #3
Merged
Conversation
New example chapter demonstrating the Case and Coalesce combinator primitives: - Case on a unit flag (kg vs lbs) selecting a per-branch conversion - Case with multi-operand branches (feet+inches / meters+cm summed via combine) - Coalesce picking the first populated source (age in years OR months) Built to the chapter convention (build_rules.py source of truth; rules.json + rules.yaml; run_python/run_yaml/run_cli; expected_output.csv golden master). All three interfaces pass and agree. The Clinical Intake Showcase moves from 08 to 09 so the realistic blend-of-all chapter stays last. Catalog and chapter headers renumbered accordingly. Requires the Case/Coalesce primitives (harmonization-framework PR #113). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Adds a new example chapter demonstrating the
CaseandCoalescecombinator primitives (harmonization-framework PR bmir-radx/harmonization-framework#113).What's new
Chapter 08 — Conditional & Coalescing Sources (
examples/08-conditional-and-coalesce/):Caseon a unit flag —weight_units(1=kg, 2=lbs) selects a per-branch conversion: lbs as-is, or kg→lbs.Casewith multi-operand branches — height as feet+inches OR meters+cm, each branch summing two converted operands viacombine: sum.Coalesce— age reported in years OR months (no flag); first populated source wins, months→years rounded.Built to the chapter convention:
build_rules.pyis the source of truth;rules.json+rules.yaml;run_python.py/run_yaml.py/run_cli.sh;expected_output.csvgolden master. All three interfaces pass and agree.Reordering
The Clinical Intake Showcase moves from chapter 08 to 09, so the realistic blend-of-everything chapter stays last. Catalog table and chapter headers renumbered accordingly (
git mvpreserves the showcase's history).Dependency
Requires the
Case/Coalesceprimitives, which are in bmir-radx/harmonization-framework#113 — merge that first.🤖 Generated with Claude Code