cqframework / clinical_quality_language

Clinical Quality Language (CQL) is an HL7 specification for the expression of clinical knowledge that can be used within both the Clinical Decision Support (CDS) and Clinical Quality Measurement (CQM) domains. This repository contains complementary tooling in support of that specification.
https://confluence.hl7.org/display/CDS/Clinical+Quality+Language
Apache License 2.0
262 stars 121 forks source link

Merge Message operator tests #1402

Open antvaset opened 1 month ago

antvaset commented 1 month ago

Merged tests from engine/.../CqlErrorsAndMessagingOperatorsTest.cql into CqlErrorsAndMessagingOperatorsTest.xml.

Keeping the CQL library with the following define's:

1) These are used in Java tests to test the engine messages (logs) produced by the Message operator with the 'Message', 'Warning', and 'Trace' severities:

TestMessageInfo
TestMessageWarn
TestMessageTrace

2) These are used in Java tests to test that the runtime throws when the severity is 'Error' (I also adjusted the Java tests for these define's so that they fail if the engine does not throw):

TestMessageError
TestErrorWithNullSource
TestErrorWithNullCode
TestErrorWithNullMessage

Note that the TestErrorWithNullCondition is not supposed to throw but the old test was passing because it didn't fail when the engine didn't throw:

define TestErrorWithNullCondition:
  Message(1, null, '1', 'Error', 'This is a message')

At the moment this is a draft and depends on https://github.com/cqframework/clinical_quality_language/issues/1401. Once I'm sure we can have Message calls with nulls without casts, I'll raise a corresponding PR to update cql-tests.

github-actions[bot] commented 1 month ago

Formatting check succeeded!