Authored measures' most-recent sort: mixed timezone offsets and same-instant ties still depend on order
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 35/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Active
- Tech stack
- typescript
- Domain
- data
Research direction
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.
Written by the indexing model from the issue text.
Description
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% at2026-05-14T02:00:00+00:00gives OVERDUE in both orders. - How it can happen: WebChart-sourced times carry a local offset (Maui is −10:00), while
normalize.tsfalls back toissued, usually inZ, wheneffectiveDateTimeis 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.
- Dominant language
- TypeScript
- Stars
- 0
- Forks
- 0
- Avg merge
- 3h 6m
- Merged PRs (30d)
- 113
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from Taleef7/workwell
-
documentation owner-ops waiting
Difficulty 1/5 1-3 hours Newbie friendliness 86/100
Maintainers usually reply within 1 day
-
owner-ops waiting
Difficulty 1/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day
-
infra maui-pilot
Difficulty 3/5 1-2 days Newbie friendliness 65/100
Maintainers usually reply within 1 day
-
cql-engine pilot-trust
Difficulty 3/5 1-2 days Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
backend enhancement
Difficulty 5/5 Over a week Newbie friendliness 35/100
Maintainers usually reply within 1 day
All issues in Taleef7/workwell
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
wardian-app/Wardian#1603 ·
Maintainers usually reply within 1 day
-
Sign the pledgeOpen
Difficulty 1/5 Under an hour Newbie friendliness 85/100
input-output-hk/devx-updates#168 ·
Maintainers usually reply within 1 day
-
triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
github/docs#46222 · 1 comment ·
Maintainers usually reply within 1 day
-
agent-ready area: config area: skills type: chore upstream: brain-kit
Difficulty 1/5 Under an hour Newbie friendliness 95/100
-
dev experience frontend good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
cuttle-cards/cuttle#1403 ·
Maintainers usually reply within 1 day