ccsm-cds-tools / ccsm-cds-with-tests

This repository contains clinical decision support (CDS) which provides recommendations for cervical cancer screening and management (CCSM).
Apache License 2.0
7 stars 3 forks source link

Investigate date sorting in Dashboard #27

Open mickohanlon23 opened 2 years ago

mickohanlon23 commented 2 years ago

See https://github.com/ccsm-cds-tools/ccsm-cds-with-tests/pull/23#discussion_r918222259

In DashboardLibrary.cql, we group resources together, and then sort them by the date field associated with the Tuple for each resource. However, this date is a string value, not a date value. Moreover, the string value can follow different formats for different instances of a resource, for example when the strings are different lengths (ex. YYYY-MM vs YYYY-MM-DD). Or where the word "to" is included in the string you are sorting with, to concatenate the start and end date strings (end date may not always be present).

Investigate the way we sort by date, make any updates that are needed, and add testing to show that the resource instances can be properly sorted by date for each resource type.