Closed sachsk closed 1 year ago
ETC :- 8 hrs
Updated ETC from now 12:12 pm:- 6 more hours to completed all the reports
All reports have been moved to ETL, it's only that some of the reports have not been tested, hence pushing this card back to support.
Report Name Issue Cancer warning signs - general Data for linelist is taking time Children Report missing two rows Child Vaccination Center data is missing Details of program enrolment Report showing as 505 Environmental Factors Report is missing
Getting 504 error for fever report after applying the filter
The report is trying to access a linelist report, and since the linelist has not yet been moved to ETL, it gives you this error. This issue should be fixed if the linelist card is moved to ETL. Hence pushing this card back to QA ready.
For "under child report we have Birth order of the child 2-3 count as 206 in aggrgrate but linelist we have 224 data"- The isnull condition for encounter date time was not Checked in the join condition. Query has been updated and report has been pushed to the server. For "Child Vaccination Center"- ETL migration has not been completed as public views were found in the queries. ETL Query appears to be unchanged from the old query.
For "Details of program enrolment"- the query was rewritten and pushed to the server. For "Household social class and mother tongue" - the aggregate query was consolidating certain subcategories together irrespective of the main category. Aggregate query has been rewritten and pushed to the server.
NCD risk factors:
NCD Age Groups:
Environmental Factors - this report is giving a few individuals that are null. Need to debug this further.
Individual sociodemograpic report generic queries.
select count(*) from individual where subject_type_id = 186;
select count(*) from individual where subject_type_id = 186 and gender_id = 229 ;
select count(*) from individual where subject_type_id = 186 and gender_id = 230 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age, e.observations ->> 'ca9eab9a-da29-4775-b08b-029998c817d0' as obs, row_number() over (partition by e.individual_id order by e.encounter_date_time desc nulls last) as v_no from individual i left join encounter e on e.individual_id = i.id and e.encounter_type_id = 508 where subject_type_id = 186 and i.gender_id = 230 ) select count(*) from cte where v_no = 1 and obs = '9888cdf3-9c0d-4577-8149-aa18f631d821' and age <= 45 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age from individual i where subject_type_id = 186 ) select count(*) from cte where age between 0 and 5 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age from individual i where subject_type_id = 186 ) select count(*) from cte where age between 10 and 19 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age from individual i where subject_type_id = 186 ) select count(*) from cte where age >= 60 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age, e.observations ->> 'ca9eab9a-da29-4775-b08b-029998c817d0' as obs, row_number() over (partition by e.individual_id order by e.encounter_date_time desc nulls last) as v_no from individual i left join encounter e on e.individual_id = i.id and e.encounter_type_id = 508 where subject_type_id = 186 and i.gender_id = 230 ) select count(*) from cte where v_no = 1 and obs = '9888cdf3-9c0d-4577-8149-aa18f631d821' and age between 20 and 24 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age, e.observations ->> 'ca9eab9a-da29-4775-b08b-029998c817d0' as obs, row_number() over (partition by e.individual_id order by e.encounter_date_time desc nulls last) as v_no from individual i left join encounter e on e.individual_id = i.id and e.encounter_type_id = 508 where subject_type_id = 186 and i.gender_id = 229 ) select count(*) from cte where v_no = 1 and obs = '9888cdf3-9c0d-4577-8149-aa18f631d821' and age between 18 and 24 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age from individual i where subject_type_id = 186 and i.gender_id = 229 ) select count(*) from cte where age < 3 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age from individual i where subject_type_id = 186 and i.gender_id = 230 ) select count(*) from cte where age < 3 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age from individual i where subject_type_id = 186 and i.gender_id = 229 ) select count(*) from cte where age between 3 and 5 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age from individual i where subject_type_id = 186 and i.gender_id = 230 ) select count(*) from cte where age between 3 and 5 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age, i.gender_id g from individual i where subject_type_id = 186 ) select ( count() filter ( where g = 230 ) 1000 ) / count(*) filter ( where g = 229 ) from cte where age <= 6 ;
with cte as ( select extract (year from age(i.date_of_birth)) as age, e.observations ->> 'ca9eab9a-da29-4775-b08b-029998c817d0' as obs, row_number() over (partition by e.individual_id order by e.encounter_date_time desc nulls last) as v_no from individual i left join encounter e on e.individual_id = i.id and e.encounter_type_id = 508 where subject_type_id = 186 and i.gender_id = 230 ) select count(*) from cte where v_no = 1 and obs = '9888cdf3-9c0d-4577-8149-aa18f631d821' and age between 15 and 49 ;
with cte as ( select i.observations ->> '49344ffb-d10c-4e30-a284-356396970bcf' obs from individual i where subject_type_id = 184 ) select count(*) from cte where obs = 'ef40f2a9-9a47-4281-a719-aad2cb14e3ca' ;
Save these reports in the Yenepoya ETL directory Update the query here : https://docs.google.com/spreadsheets/d/15U3mOkcVjHhXlr318uj8DRQNzC6mBOTf-GEPf9SLfTM/edit#gid=693027088
Note : Linelists are also part of this card.