Compare test case results with the expected populations in the MeasureReport

Aperta
#200 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
40/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
typescript, vscode
Ambito
testing, tooling

Direzione di ricerca

Read src/model/testCase.ts first: getMeasureReportData (lines 72-101) selects the MeasureReport* file and extractPopulations (lines 133-159) already returns group id, code and count; see how src/commands/execute-cql-file.ts around lines 376-378 consumes only the description. Then study fqm-execution's DetailedResultsBuilder.ts (lines 269-319) for the population-rule logic and cqf-skills/scripts/check_results.py as a working reference. Decide first where the measure's group definitions come from (Measure resource vs config.jsonc), since the test case folder has none. Done means pass/fail per case and population is written to the individual result files and surfaced in the CQL Explorer.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

A test case folder can hold a MeasureReport with the case's expected population counts, for example one exported from MADiE. The extension reads it, but never uses the counts, so nothing says whether a test case passes.

getMeasureReportData (src/model/testCase.ts, v1.0.0):

  • reads the first file in the test case folder whose name starts with MeasureReport;
  • returns the subject patient id, the description, and the expected populations (group id, code and count) via extractPopulations.

Only the description is used: Execute CQL writes it to testCaseDescription in an individual result file (execute-cql-file.ts#L376-L378). The patient id and expected populations aren't used anywhere.

Suggested behaviour: after Execute CQL, compare each case's expected counts with its results and report pass or fail per case and population, in the result files and the CQL Explorer. Two points to get right:

  1. Measure population rules apply. Raw definition values aren't the measure's population results. A case in the Denominator Exclusion isn't counted in the Numerator even when the "Numerator" definition is true. Other rules:

    • not in the Initial Population means in no population;
    • not in the Denominator clears the Denominator Exclusion, Denominator Exception, Numerator and Numerator Exclusion;
    • in the Numerator clears the Denominator Exception;
    • episode-based groups apply the rules per episode.

    This is what fqm-execution does, and therefore MADiE (DetailedResultsBuilder.ts#L269-L319 at v1.8.6). MADiE then compares truthiness for boolean groups and episode counts otherwise (CalculationService.ts#L319-L327).

  2. Mapping populations to definitions. This needs the measure's group definitions (population code to CQL expression, population basis and scoring), which a test case folder doesn't have. They could come from the Measure resource in the project, or be configured in config.jsonc.

The cqf-skills madie skill has a standalone script, scripts/check_results.py, that does this from Execute CQL's individual result files. It could serve as a reference.

🤖 Generated with Claude Code

Lingua principale
TypeScript
Stelle
14
Fork
8
Merge medio
1g 22h
PR unite (30g)
1

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di cqframework/vscode-cql

Tutte le issue di cqframework/vscode-cql

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.