Skip to content

Use capability codes from the CQL Language Capabilities CodeSystem - #174

Open
bryantaustin13 wants to merge 1 commit into
cqframework:mainfrom
bryantaustin13:capability-codes-from-codesystem
Open

bryantaustin13 wants to merge 1 commit into
cqframework:mainfrom
bryantaustin13:capability-codes-from-codesystem

Conversation

@bryantaustin13

@bryantaustin13 bryantaustin13 commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

tests/testSchema.xsd says a capability code must come from the CQL Language Capability Codes (http://cql.hl7.org/CodeSystem/cql-language-capabilities). 20 of the 41 codes the tests use aren't in that CodeSystem. They were added in b3b1318 before the CodeSystem's date-and-time-operators.* child codes existed. This PR moves the tests onto the CodeSystem's codes.

Replaced with an existing code (15):

Was Now
component-extraction date-and-time-operators.from
constructor.date / .datetime / .time date-and-time-operators.date / .datetime / .time
date-time-arithmetic date-and-time-operators.add (Add, Today) / .subtract (Subtract)
difference-in date-and-time-operators.difference
duration-between, precision-based-timing date-and-time-operators.duration
function.Now / .Today / .TimeOfDay date-and-time-operators.now / .today / .timeofday
timing-phrases.before-after date-and-time-operators.before / .after / .same-or-before / .same-or-after, by group
timing-phrases.same-as date-and-time-operators.same-as
queries single-source-query, where-clause-query, let-clause-query, return-clause-query, relationships-query (With/Without), aggregate-clause-query, by group
types system.date, system.datetime, system.time, system.quantity, system.string, system.long, by group; the Any group and the suite use system-data-types

Removed (2): timing-phrases.within and interval-comparisons. Each appeared only in the CqlDateTimeOperatorsTest suite header, and no test uses within.

Kept, added to the CodeSystem by HL7/cql#106 (4): literals, timezone-offset, uncertainty-intervals, and the new sort-clause-query for the Sort group.

The Today group's tests now list only the operators their expressions use, and the group itself keeps only date-and-time-operators.today. The runner combines a test's codes with its group's codes, so a group-level code would otherwise be reported for every test. For example, Today() = Today() now reports only date-and-time-operators.today.

Only <capability> lines change, in CqlDateTimeOperatorsTest.xml, CqlQueryTests.xml and CqlTypesTest.xml. No test changes result: before and after are both 1841/167/29 (pass/fail/skip) on HAPI 8.12.0 / CQL 5.5.0 and 1862/89/86 on cql-execution. All files validate against tests/testSchema.xsd. The runner loads the same 2037 tests, and every one of the 55 codes now in use is in the CodeSystem once HL7/cql#106 merges.

Follow-up: #88 and #166 add more uses of the old codes (timezone-offset, component-extraction, function.Now, constructor.datetime, types). Whichever merges second should be updated to match.

🤖 Generated with Claude Code

20 of the capability codes used by the tests were not in
http://cql.hl7.org/CodeSystem/cql-language-capabilities, which
testSchema.xsd says they must come from.

- Replace 15 with their existing equivalents: the
  date-and-time-operators.* child codes, the query clause codes
  (single-source, where, let, return, relationships, aggregate) and
  the system.* type codes, chosen per group.
- Drop timing-phrases.within and interval-comparisons, which only
  appeared in the CqlDateTimeOperatorsTest suite header.
- Keep literals, timezone-offset and uncertainty-intervals, and use a
  new sort-clause-query for the Sort group; these four are added to
  the CodeSystem in HL7/cql.
- In the Today group, list only the operators each test uses; the
  group itself keeps just date-and-time-operators.today.

Only <capability> elements change. Results on HAPI 8.12.0 (CQL 5.5.0)
and cql-execution are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

1 participant