Skip to content

MIABIS CQL#342

Merged
enola-dkfz merged 1 commit intosamply:feature/miabisfrom
a-tuerk:miabis-cql
Apr 9, 2026
Merged

MIABIS CQL#342
enola-dkfz merged 1 commit intosamply:feature/miabisfrom
a-tuerk:miabis-cql

Conversation

@a-tuerk
Copy link
Copy Markdown

@a-tuerk a-tuerk commented Mar 23, 2026

MIABIS CQL

Copy link
Copy Markdown
Member

@enola-dkfz enola-dkfz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't checked the CQL against MIABIS profiles. I can confirm that the PR doesn't interfere with existing Focus functions. It also doesn't seem to introduce any security issues.

Comment thread src/flavours/miabis/template.cql Outdated
else 'Unknown'
end

define StorageTemperature:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is a storage temperature stratifier needed? The frontend is not displaying it.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good point — the BBMRI.de flavour doesn't include a storage temperature stratifier either. I'll remove the StorageTemperature define from template.cql and the corresponding stratifier entry from body.json.

Comment thread src/cql.rs Outdated
Flavour::Miabis,
)
.unwrap();
assert!(cql.contains("'whole-blood'"));
Copy link
Copy Markdown
Member

@enola-dkfz enola-dkfz Mar 31, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those should fail because in MIABIS BBMRI.de codes get replaced with MIABIS codes.

Always run the tests locally: cargo test

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The tests do pass — cargo test confirms all 7.

'whole-blood' appears in template.cql unconditionally, in the SampleType stratifier function which maps MIABIS codes back to Lens labels for the MeasureReport output:

when Code 'WholeBlood' from MiabisDetailedSampleType then 'whole-blood'

That line is always present in the generated CQL regardless of the query criteria, so cql.contains("'whole-blood'") was trivially true and didn't test the workaround at all. The assertion that actually
verifies the workaround ran is cql.contains("'WholeBlood'") — that checks the MIABIS code was substituted into the filter criteria.

I've removed the misleading 'whole-blood' assertions and updated the Specimen.processing assertion to S.processing to match the filter snippet.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then my code is wrong! I'm gonna clone your repo and fix it.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is OK, BBMRI codes are only present in the template (in the stratifier mapping), will write specific negative tests for the conditions.

@enola-dkfz enola-dkfz self-requested a review April 9, 2026 16:43
@enola-dkfz enola-dkfz merged commit 949637f into samply:feature/miabis Apr 9, 2026
@a-tuerk a-tuerk deleted the miabis-cql branch April 10, 2026 13:04
a-tuerk pushed a commit to a-tuerk/headlights that referenced this pull request Apr 17, 2026
…e wait

samply/focus#342 merged 2026-04-09; develop tag updated 2026-04-13 includes MIABIS CQL.
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