-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
In the VisitReports table, the levelOfSupervision field gets nulled unexpectedly in a new version when the state changes to 'approved'. Heres a couple sample visit reports:
select id, "versionCreatedAt", "levelOfSupervision", "visitType", "state"
where id in (1585945, 1589351)
order by id, "versionCreatedAt"
This seems to have been the case since 2018.
The visitType field what is used for billing and dashboard. The levelOfSupervision field does not contradict visitType:
-- demonstrating that levelOfSupervision does not contradict visitType
select "levelOfSupervision", "visitType", *
from replica."VisitReports" where
state <> 'approved'
AND date > '2025-01-01'
AND coalesce("levelOfSupervision", "visitType") <> "visitType"
LIMIT 500;
Some options:
- Document the levelOfSupervision field should not be used
- Drop the levelOfSupervision field
- Fuller fix - straighten out the difference between supervision level (unsupervised, monitored, supervised), transport needs (yes or no) and whether it's a parent or sibling visit (also called visit type in some places)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels