Skip to content

feat(ogar-emitter): OptionFlagToOptionBool + TruncateDate FieldSource variants (medcare-rs W4)#215

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/review-medcare-rust-dt7MS
Jul 20, 2026
Merged

feat(ogar-emitter): OptionFlagToOptionBool + TruncateDate FieldSource variants (medcare-rs W4)#215
AdaWorldAPI merged 1 commit into
mainfrom
claude/review-medcare-rust-dt7MS

Conversation

@claude

@claude claude Bot commented Jul 20, 2026

Copy link
Copy Markdown
Contributor

What

Two additive FieldSource variants in ogar-emitter's projection-adapter codegen, driven by the medcare-rs read-arm W4 hand-off (docs/handoffs/W4-ogar-fieldsource-variants.md in medcare-rs). The FieldSource doc-comment already states the set "grows deliberately … when a new consumer needs a transform not here … Derived from the real Pattern-A projections in medcare-rs" — these are exactly that.

Variant Renders Option<iN>/type Unblocks
OptionFlagToOptionBool { column } r.col.map(|v| v != 0) Option<iN> flag → Option<bool> (nullable sibling of IntFlagToBool) dms (6 Option<i8>Option<bool> fields)
TruncateDate { column } r.col.date() NaiveDateTimeNaiveDate, non-optional (non-Option sibling of MapNaiveDate) lab_order (measured_on)

Both reproduce a spelling already present in the hand-written medcare projections byte-for-byte, so the value oracle replays green. No existing variant, golden, or emitter behaviour changes.

Consumer follow-up (medcare-rs, after this lands)

Add dms_projection_class() + lab_order_projection_class() recipes + generated_body_matches_handwritten_* parity tests to medcare-analytics/src/projection_codegen.rs, then adopt live (include! the generated From, delete the hand-roll) — the path patient already took.

Verification

cargo test -p ogar-emitter → 39 passed (incl. new option_flag_and_truncate_date_render_the_handwritten_spelling); cargo fmt --check + cargo clippy clean.


🤖 Generated with Claude Code

https://claude.ai/code/session_01Mwq1QKpw4zRd6oaGRoJhF2


Generated by Claude Code

…urce variants

Two additive projection-codegen transforms, driven by the medcare-rs read-arm
W4 hand-off (docs/handoffs/W4-ogar-fieldsource-variants.md in medcare-rs). The
FieldSource vocabulary is documented to "grow deliberately when a new consumer
needs a transform not here" — these are exactly that:

- OptionFlagToOptionBool { column } -> `r.col.map(|v| v != 0)`
  (`Option<iN>` flag -> `Option<bool>`; the nullable sibling of IntFlagToBool).
  Unblocks the `dms` projection (6 `Option<i8>` -> `Option<bool>` fields).
- TruncateDate { column } -> `r.col.date()`
  (`NaiveDateTime` -> `NaiveDate`, non-optional; the non-Option sibling of
  MapNaiveDate). Unblocks the `lab_order` projection (`measured_on`).

Both reproduce a spelling already present in the hand-written medcare
projections byte-for-byte, so the value oracle replays green. No existing
variant, golden, or emitter behaviour changes. New unit test asserts both
arms render the exact hand-written RHS.

Generated by Claude Code
@AdaWorldAPI
AdaWorldAPI merged commit d4eaa37 into main Jul 20, 2026
1 check passed
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