Skip to content

Commit

Permalink
Merge pull request #139 from coronasafe/improve_accuracy_calculation
Browse files Browse the repository at this point in the history
Drop milliseconds while finding observation for accuracy calculation in automated daily rounds
  • Loading branch information
khavinshankar authored Jul 16, 2024
2 parents cb67248 + 95159bf commit 02bec3f
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/cron/automatedDailyRounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -274,12 +274,17 @@ export function getVitalsFromObservationsForAccuracy(
.reduce((acc, curr) => {
return [...acc, ...curr.data];
}, [] as Observation[][])
.find(
(observation) =>
.find((observation) => {
const observationTime = new Date(observation[0]["date-time"]);
observationTime.setMilliseconds(0);
const imageTime = new Date(time);
imageTime.setMilliseconds(0);

return (
observation[0].device_id === deviceId &&
new Date(observation[0]["date-time"]).toISOString() ===
new Date(time).toISOString(),
);
observationTime.toISOString() === imageTime.toISOString()
);
});

if (!observations) {
return null;
Expand Down

0 comments on commit 02bec3f

Please sign in to comment.