Add expected: blocks to Measles Low Transmission test YAML#137
Open
lambdabaa wants to merge 1 commit into
Open
Add expected: blocks to Measles Low Transmission test YAML#137lambdabaa wants to merge 1 commit into
expected: blocks to Measles Low Transmission test YAML#137lambdabaa wants to merge 1 commit into
Conversation
…t YAML
Augments the seven existing patient test cases for
IMMZD2DTMeaslesLowTransmissionLogic with an `expected:` block per case,
encoding the expected boolean and guidance-string outputs the Logic
library should produce.
The blocks are derived from existing artifacts in this repository:
- the `### …` natural-language outcomes already present at the top of
each patient document, and
- the `Test Validation` case-expression in
input/cql/IMMZD2DTMeaslesLowTransmissionLogic.cql
Schema (proposed convention):
expected:
row: <L2 row identifier> # optional human-readable cross-ref
today: <YYYY-MM-DD> # optional per-case anchor; default = harness-wide today
encounterId: <string> # optional override for the EncounterId CQL parameter
defines:
"<CQL define name>": <scalar> # exact equality (booleans/numbers/null/strings)
"<CQL define name>":
equals: <value> # explicit equality (use for multi-line strings)
# plus: matches: <regex>, isNull: true, isNotNull: true
Zero behaviour change to the build: tools/node/makeExample.js iterates a
fixed set of keys (id, birth, patient, immunization, contraindication,
medicationrequest) and ignores any others, so the new `expected:` key
flows through unmodified. tools/node/processDAK.js --existing preserves
arbitrary keys when re-emitting the file, so the block survives
regeneration from the L2 decision-table source.
The blocks are consumed by an out-of-tree harness
(github.com/lambdabaa/who-cql-agent-eval) that executes the Logic library
against the existing patient bundles via cqframework/cql-execution and
diffs per-define results. Today, WHO's "test cases shall exist and shall
pass" requirement (L3 CQL SOP) has no in-repo executable assertion path
for these YAMLs; this change makes the expected outputs machine-checkable
without prescribing a runner.
See RFC issue #XXX for the broader proposal.
lambdabaa
added a commit
to lambdabaa/who-cql-agent-eval
that referenced
this pull request
May 28, 2026
Tooling for the WHO upstream contribution path (§9.3): takes our augmented overlay YAML at tests/dak/<X>.yaml and injects only the expected: blocks into the corresponding upstream WHO YAML, preserving every other byte. Idempotent (re-running against an already-patched file is a no-op). Used to produce WorldHealthOrganization/smart-immunizations#137 from tests/dak/IMMZD2DTMeaslesLowTransmissionLogic.yaml. Co-Authored-By: Claude Opus 4.7 <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.
Summary
expected:block to each of the seven existing patient documents ininput/tests/plandefinition/IMMZD2DTMeaslesLowTransmissionLogic/IMMZD2DTMeaslesLowTransmissionLogic.yaml, encoding the expected boolean and guidance-string outputs of the Logic library per patient.makeExample.js, or the Karate.featuregeneration — purely additive YAML keys.expected:blocks in test YAMLs #136.Schema
Blocks follow the convention proposed in #136:
Identifiers correspond to the published CQL
define "<name>":declarations ininput/cql/IMMZD2DTMeaslesLowTransmissionLogic.cql.Provenance of the expected values
Each block was derived from existing artefacts already in this repository:
### …natural-language outcome lines already present at the top of each patient document, andTest Validationcase-expression ininput/cql/IMMZD2DTMeaslesLowTransmissionLogic.cql.The blocks were independently verified by running the published Logic library against the existing patient bundles using cqframework/cql-execution at submodule HEAD (b16245f); all 7 cases produce values that match the encoded
expected:blocks.Compatibility
tools/node/makeExample.jsaccesses YAML keys by name (id,birth,patient,immunization,contraindication,medicationrequest) and ignores others.tools/node/processDAK.js --existingre-emits arbitrary parsed keys, so the block survives regeneration from the L2 Excel source.qa.html, orinput/testing/features/plandefinition/<X>/<X>.feature.Test plan
expected:blocks in test YAMLs #136 for the cross-cutting convention discussion).tools/node/makeExample.jsagainst the patched YAML; per-resource JSON output should be identical to the unpatched run.qa.htmlis unchanged.