Skip to content

Commit

Permalink
Modified Not Equal unit test cql to not use literal false
Browse files Browse the repository at this point in the history
  • Loading branch information
elsaperelli committed Dec 14, 2023
1 parent 6460ba4 commit ceb446f
Show file tree
Hide file tree
Showing 3 changed files with 479 additions and 35 deletions.
4 changes: 2 additions & 2 deletions test/unit/ClauseResultsHelper.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ describe('ClauseResultsHelpers', () => {
const localIds = ClauseResultsHelpers.findAllLocalIdsInStatementByName(libraryElm, statementName);

// For the fixture loaded for this test it is known that the localId for the Equal statement
// is 100 and the localId for the Not expression is 5 but we want the Equal clause to take
// is 100 and the localId for the Not expression is 23 but we want the Equal clause to take
// the result of the Not expression
expect(localIds[100]).toBeDefined();
expect(localIds[100]).toEqual({ localId: '100', sourceLocalId: '5' });
expect(localIds[100]).toEqual({ localId: '100', sourceLocalId: '23' });
});

test('finds localIds for an ELM Binary Expression with a comparison operator with a literal', () => {
Expand Down
16 changes: 15 additions & 1 deletion test/unit/fixtures/cql/NotEqual.cql
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,22 @@ library Test
using FHIR version '4.0.1'

include FHIRHelpers version '4.0.1'
include MATGlobalCommonFunctions version '5.0.000' called Global

codesystem "EXAMPLE": 'http://example.com'
codesystem "EXAMPLE-2": 'http://example.com/2'
codesystem "ConditionClinicalStatusCodes": 'http://terminology.hl7.org/CodeSystem/condition-clinical'

valueset "test-vs": 'http://example.com/test-vs'

code "Active": 'active' from "ConditionClinicalStatusCodes"
code "Recurrence": 'recurrence' from "ConditionClinicalStatusCodes"
code "Relapse": 'relapse' from "ConditionClinicalStatusCodes"

concept "Condition Active": { "Active", "Recurrence", "Relapse" } display 'Active'

context Patient

define "Not Equal Clause":
true != false
[Condition: "test-vs"] C
where C.id != 'notId'
Loading

0 comments on commit ceb446f

Please sign in to comment.