Skip to content

T9: Complex logic: calculation, relevance, constraint #9

Description

@PrjShrestha

Importance: Must have · Size: L · Depends on: T1, T8

Why. The logic columns are where clinical intent actually lives. The design doc places them in
Phase 2, but they are marked must-have: without them the tool can only edit wording, and a
program cannot own its own decision support.

Scope. (audited 2026-10-01 under 9g, #20; each line names the test or commit that proves it)

Not in scope. Grouping beyond one level. Deeper nesting multiplies the precedence and polarity
surface for very little expressive gain, and an expression that complex belongs in a computed field
instead.

Acceptance.

  1. Every value in every builder can be picked; no path requires typing an identifier or a
    reference expression. — met in the inline strip and the Validation panel (feat(ui): searchable, grouped field picker with labels; technical rows hidden; choice labels in pickers (#16) #25, feat(validation): Validation panel with presets per question type, messages beside the rule; never normalises (#18) #27); the modal's
    optional custom-name escape goes with 9f (T9f: Sentence-shaped inline rule editor for relevant and choice_filter; advanced panel regrouped #19).
  2. An expression the builder cannot represent round-trips byte-identically. — feat(parser): . as a subject, ../field as an alias of ${field}, function forms on . (#14) #24, feat(validation): Validation panel with presets per question type, messages beside the rule; never normalises (#18) #27 (see above).
  3. An automated test drives all four builders and asserts the emitted cells on disk.
    — client/tests/four-builders.spec.ts (test(e2e): one journey drives all four builders; a picked relevance and constraint match at runtime on a live CHT (#20) #28).
  4. A condition authored through the picker matches at runtime on a live instance — verified with
    real data, not by reading the generated expression. — client/tests/live-instance-check.spec.ts (test(e2e): one journey drives all four builders; a picked relevance and constraint match at runtime on a live CHT (#20) #28):
    deployed with cht-conf 6.5.0 inside the image to the local CHT 5.2.0 instance; as the CHW the question
    hides, shows after "Pass", rejects 25 with the authored message, accepts 10 → report
    01a0f7da-9c2b-766d-90aa-3aabfd8dd6be (2026-10-01).

Epic status (2026-10-01). Sub-issues: #15 (9b) PR #23 · #14 (9a) PR #24 · #16 (9c) PR #25 · #17 (9d) PR #26 ·
#18 (9e) PR #27 · #20 (9g) PR #28 · #19 (9f) open. Plan and 777-rule counts:
docs/plans/9_complex_logic_calculation_relevant_constraint/README.md on branch
9_complex_logic_calculation_relevant_constraint. Merge order for the stacked PRs: #23 → #24 → #25 → #26 → #27 → #28.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions