GithubHelp home page GithubHelp logo

Comments (6)

BEULAHEVANJALIN avatar BEULAHEVANJALIN commented on August 11, 2024

TEST QUERIES:

  • Total number of registered children
select count(distinct individual.id)
from individual
         join public.address_level address on individual.address_id = address.id
         join catchment_address_mapping cathment_address
              on cathment_address.addresslevel_id = address.id
         join catchment c on cathment_address.catchment_id = c.id
where individual.is_voided = false; -- 3494
  • Total number of enrolled children
select count(distinct individual.id)
from individual
    join program_enrolment on individual.id = program_enrolment.individual_id
         join public.address_level address on individual.address_id = address.id
         join catchment_address_mapping cathment_address
              on cathment_address.addresslevel_id = address.id
         join catchment c on cathment_address.catchment_id = c.id
where individual.is_voided = false;
  • Total number of children exited
select count(distinct individual.id)
from individual
         join program_enrolment on individual.id = program_enrolment.individual_id
         join public.address_level address on individual.address_id = address.id
         join catchment_address_mapping cathment_address
              on cathment_address.addresslevel_id = address.id
         join catchment c on cathment_address.catchment_id = c.id
where individual.is_voided = false
  and program_exit_date_time is not null; -- 1715

from jss.

BEULAHEVANJALIN avatar BEULAHEVANJALIN commented on August 11, 2024

On-hold!. Unable to find any observations like "WFA Grade", "Growth Faltering Status" in JSS org. These concepts not used in any forms and unable to find in decision rules as well. And not in ETL table of course. But i could see some observations for these in DB. What could be the reason. Not sure if these concepts got deleted.

from jss.

BEULAHEVANJALIN avatar BEULAHEVANJALIN commented on August 11, 2024
  • Total number of faltering children
  • List of Faltering Children
select count(distinct individual.id)
from individual
join program_encounter on individual.id = program_encounter.individual_id
where program_encounter.observations -> 'a5067bcc-d333-4c80-a0f2-d61df9d210d3' = '["04bb1773-c353-44a1-a68c-9b448e07ff70"]'
and individual.is_voided = false; --1280

from jss.

BEULAHEVANJALIN avatar BEULAHEVANJALIN commented on August 11, 2024
  • Total number of due visits
select count(distinct enc.id)
from program_encounter enc
         join public.individual on enc.individual_id = individual.id
         join public.program_enrolment on individual.id = program_enrolment.individual_id
where individual.is_voided = false
  and enc.name is not null
  and enc.is_voided = false
  and enc.cancel_date_time is null
  and enc.encounter_date_time is null;

from jss.

BEULAHEVANJALIN avatar BEULAHEVANJALIN commented on August 11, 2024
  • WFA Grade wise phulwari children
  • List of grade 3 children
select count(distinct program_encounter.individual_id)
       filter (where (program_encounter.observations ->> '10d6ef42-2db4-4af9-951d-75b8942690a1')::numeric =
                     1) as "Grade 1",
       count(distinct program_encounter.individual_id)
       filter (where (program_encounter.observations ->> '10d6ef42-2db4-4af9-951d-75b8942690a1')::numeric =
                     2) as "Grade 2",
       count(distinct program_encounter.individual_id)
       filter (where (program_encounter.observations ->> '10d6ef42-2db4-4af9-951d-75b8942690a1')::numeric =
                     3) as "Grade 3"
from individual
         join program_enrolment
              on program_enrolment.program_id = (select id from program where name = 'Phulwari')
                  and individual.id = program_enrolment.individual_id
         join program_encounter on program_enrolment.id = program_encounter.program_enrolment_id
         join address_level address on individual.address_id = address.id
         join catchment_address_mapping catchment_mapping on address.id = catchment_mapping.addresslevel_id
         join catchment on catchment_mapping.catchment_id = catchment.id
where individual.is_voided = false
  and program_enrolment.program_exit_date_time is null
  and program_encounter.encounter_date_time is not null
  and catchment.name <> 'JSS Master Catchment'; -- 2002,1513,749

from jss.

BEULAHEVANJALIN avatar BEULAHEVANJALIN commented on August 11, 2024

Link to dashboard : https://reporting.avniproject.org/dashboard/193-jss-phulwari-dashboard-new

from jss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.