avniproject / calcutta-kids

0 stars 0 forks source link

[CK Support] Migrate Child Due Visit List to ETL #89

Closed nupoorkhandelwal closed 4 months ago

nupoorkhandelwal commented 7 months ago

Context

Reference Support ticket - https://avni.freshdesk.com/a/tickets/3271

Currently, this report - https://reporting.avniproject.org/question/207-child-visit-due-list is taking longer time to load. In order to improve the performance need to update it to use ETL table available.

Tech Approach

  1. Update the new report to use ETL table and save it with as a new report - [DO NOT USE ETL] Child Visit Due List
  2. Couple of columns are not available in ETL table, for now we can put them in comment
  3. Add same set of filters
  4. Once QA is done, replace the original report with the new report.
vedfordev commented 7 months ago

Notes:

Report Link

https://reporting.avniproject.org/question/2843-do-not-use-etl-child-visit-due-list

Points

@sachsk Need to conform, we see that in old report we see row related to "Doctor Visit Followup at Home". which is not related to child program. Currently I not included it in new etl report.

vinayvenu commented 6 months ago

@sachsk ping

vedfordev commented 6 months ago

Dev Test Scenario :

  1. In some data we find out that schedule date is diffrent in old and new report. To check used below query and findout old report has some problem.
set role calcutta_kids;

select *
from encounter_type where is_voided = false and name = 'Child Home Visit';
-- 33

select *
from program_encounter where encounter_type_id = 33 and individual_id = 891601 and encounter_date_time isnull ;

select *
from program_enrolment where id = 189979;
  1. For missing data of individual 1335874, new report doesn't have value. To check that used below query and find out that old report shows visit which program was exited.
set role calcutta_kids;

select *
from encounter_type where is_voided = false and name = 'Child Home Visit';
-- 33

select *
from program_encounter where encounter_type_id = 33 and individual_id = 1335874 and encounter_date_time isnull ;

select *
from calcutta_kids.individual_child_child_home_visit where individual_id = 1335874 and encounter_date_time isnull ;

select *
from program_enrolment where individual_id = 1335874;
vedfordev commented 6 months ago

currently facing issue in Metabase .Raised ticket : https://avni.freshdesk.com/a/tickets/3354

vedfordev commented 6 months ago

moved report to prerelease : https://reporting.avniproject.org/question/2867-do-not-use-etl-child-visit-due-list-prerelease

nupoorkhandelwal commented 6 months ago

@vedfordev please remove commented code from the sql.

vedfordev commented 6 months ago

@nupoorkhandelwal @sachsk moving card to support ready and unassigned me

  1. some part are commented because we have to add decision concept.
  2. filter work is decide by tech lead
  3. old report has some problem mentioned some scenario in above card.
Dinesh2019 commented 5 months ago
Gojo-Taqi commented 5 months ago

@Dinesh2019 added A,B,C,D as options in age group filter.

Dinesh2019 commented 5 months ago

Report showing error

Screenshot 2024-02-03 at 8.55.38 AM.png
Gojo-Taqi commented 4 months ago

Machi read the error message. It says the date filter is a required parameter. Unless you don't give a date, it won't run.

Gojo-Taqi commented 4 months ago

I am not able to add an encounter_name filter in this report. Need to pair on this with someone, to move the card forward. Hence moving the card in QA failed.

Gojo-Taqi commented 4 months ago

After Nupoor's help, the issue has been fixed. Moving it to QA ready.

Dinesh2019 commented 4 months ago

Created the data for visit child pnc but data is not reflected in the metabase report

Individual name : Testdin Feb0212

Screenshot from metabase:

Screenshot 2024-02-14 at 10.46.38 AM.png

Screenshot for app :

Screenshot 2024-02-14 at 10.52.39 AM.png
Gojo-Taqi commented 4 months ago

Since the encounter is completed, the individuals details are not coming in the report. If the encounter is scheduled and not completed, only those encounters will come in the report. Moving this back to QA ready.