Skip to content

Commit

Permalink
drop milliseconds while finding observation for accuracy calculation …
Browse files Browse the repository at this point in the history
…in automated daily rounds
  • Loading branch information
khavinshankar committed Jul 16, 2024
1 parent 1ebcca2 commit 95159bf
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 @@ -270,12 +270,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 95159bf

Please sign in to comment.