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
251 stars 121 forks source link

difference in weeks not counting correctly #1335

Open lukeaduncan opened 4 months ago

lukeaduncan commented 4 months ago

Difference in weeks looks to be working like duration in weeks instead of counting boundaries. Difference in months is working as expected. This can be replicated using the vscode plugin. The following expressions give these outputs:

For example: define "start": @2024-02-29 define "end": @2024-03-04 define "weeks difference": difference in weeks between "start" and "end" define "weeks duration": duration in weeks between "start" and "end" define "months difference": difference in months between "start" and "end" define "months duration": duration in months between "start" and "end"

outputs: start=2024-02-29 end=2024-03-04 weeks difference=0 weeks duration=0 months difference=1 months duration=0

"weeks difference" should be 1 since it crosses the Sunday boundary as defined in the specification.

See: https://chat.fhir.org/#narrow/stream/179220-cql/topic/difference.20vs.20duration.20in.20weeks.20in.20vscode.20plugin/near/423808646