In #64 it seems there were two bugs introduced when creating artificial visits.
-
The inner join of events and visit_occurrence_person on visit_occurrence_id removes all events without visit_occurrence_id , which is not the intention if you want to construct artificial visits for those.
-
The age for concepts in artificial visits will be NULL since the age is computed before that step.