Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UCAM: ensure patient_by_wear_period considers same day checkin and out #84

Open
davidverweij opened this issue Apr 20, 2021 · 1 comment
Labels
bug Oh my UCAM UCAM service

Comments

@davidverweij
Copy link
Member

In the (very unlikely, but realistic) scenario that a device is being worn by two different patients on the same day, our pipeline will not associate the data to the correct patient. This is due to our use of normalise_day in combination with UCAM only containing the granularity of days and not hours. Relatedly, NCL reported that in UCAM they couldn't check in a device for a patient if it was only checked out that day.

The core issue is in the granularity of check in and out times (now only days) in UCAM, though once this is improved, our pipeline might still miss this edge case.

To illustrate, if a user worn a Dreem device at night, but only after 00:00, data will be:

last user:  from last week - to today
next user: from today - next week
data: from today - today

Due to normalise day, the recording from today - today will satisfy being within both end and start days of both patients, and data actually belonging to the second patient is lost.

At this time, this isn't of too importance; but a good edge case to catch in high-turnaround environments (and this case has been reported in NCL)

@davidverweij davidverweij added bug Oh my UCAM UCAM service labels Apr 20, 2021
@jawrainey
Copy link
Member

The core issue is in the granularity of check in and out times (now only days) in UCAM, though once this is improved, our pipeline might still miss this edge case.

This is true if we continue to use normalise_day. Previously, complete datetimes were compared within the inventory but introduced some problems as devices may be checked out before patients actually have them or multiple patients use the device in one day (e.g., on testing accounts). If UCAM provide hours/minutes (ISO 8601 formatted) the comparsion with normalise_day could be removed and it'll work as-is.

Having said that, I suspect that asking staff to input hours/minutes is not ideal given they enter data into UCAM days after a patient is onboarded. Perhaps this is something that UCAM could do behind the scenes, e.g., if a device was returned on Day X and checked out on Day X, then the former could be 10:00 and the latter 12:00. That way we could tell the difference without having to ask clinicans to input such datetimes. What's your thoughts @davidverweij and sounds like something to raise with UCAM.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Oh my UCAM UCAM service
Projects
None yet
Development

No branches or pull requests

2 participants