Most-recent sorts compare DateTimes as text: mixed offsets and same-instant ties depend on order (authored AND official measures)

Đang mở
#750 2 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
5/5
Thời gian dự kiến
Hơn một tuần
Mức phù hợp với người mới
35/100
Loại issue
Lỗi
Độ rõ ràng
Cần làm rõ
Mức độ hoạt động
Sôi nổi
Công nghệ
typescript
Lĩnh vực
data

Hướng nghiên cứu

Start with the review in #749 and trace the authored-measure sorting path, including normalize.ts and the cql-execution comparison behavior. Confirm how authored cms122 handles mixed offsets and same-instant ties, then get the owner’s decision on the tie rule before defining completion.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

backend bug

Two ordering edge cases are left after #749. Both affect only the authored measures; the official CMS measures don't use this sort.

1. Mixed timezone offsets order by text

cql-execution compares sort keys with <. A CQL DateTime has no valueOf, so it compares the toString() output, which ends in the offset. Results with the same offset sort correctly; results with different offsets can sort wrongly when they're close in time.

  • Example (authored cms122): 7.5% at 2026-05-13T23:00:00-10:00 (the newer result) against 10.5% at 2026-05-14T02:00:00+00:00 gives OVERDUE in both orders.
  • How it can happen: WebChart-sourced times carry a local offset (Maui is −10:00), while normalize.ts falls back to issued, usually in Z, when effectiveDateTime is missing.
  • Impact: at most one day on the day-window measures.
  • Fix options: normalise instants to UTC at ingest, or give the sort key one offset.

2. Ties keep input order

Two results at the same instant compare as "greater" both ways, so Last() picks the first-listed of the tied pair. That matters only for value-reading measures (authored cms122: 7.5 then 10.5 gives COMPLIANT; 10.5 then 7.5 gives OVERDUE). A tie needs a rule: a secondary key such as issued, or worst-value-wins. That choice is clinical, so it's an owner decision.

Found in #749's review. Low priority.

Ngôn ngữ chính
TypeScript
Star
0
Fork
0
Merge trung bình
15 giờ 16 phút
Pull request đã merge (30 ngày)
72

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của Taleef7/workwell

Tất cả issue của Taleef7/workwell

Issue tương tự

Thêm issue về TypeScript

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.