1

我正在 apache-Superset 中使用 PostgreSQL。使用以下代码:

 SELECT district_name AS district_name,
   facility_name AS facility_name,
   encounter_date AS __timestamp,
   SUM(facility_encounters.measles_1) + SUM(facility_encounters.mr_1) AS "Measles + MR 1",
   SUM(facility_encounters.mr_2) + SUM(facility_encounters.measles_2) AS "Measles + MR 2",
   SUM(facility_encounters.bcg_1) AS sum__bcg_1,
   SUM(facility_encounters.rota_1) AS sum__rota_1,
   SUM(facility_encounters.rota_2) AS sum__rota_2,
   SUM(facility_encounters.opv_1) AS sum__opv_1,
   SUM(facility_encounters.opv_2) AS sum__opv_2,
   SUM(facility_encounters.pentavalent_1) AS sum__pentavalent_1,
   SUM(facility_encounters.pentavalent_2) AS sum__pentavalent_2,
   SUM(facility_encounters.pentavalent_3) AS sum__pentavalent_3,
   SUM(facility_encounters.opv_3) AS sum__opv_3,
   SUM(facility_encounters.opv_4) AS sum__opv_4,
   SUM(facility_encounters.pcv_1) AS sum__pcv_1,
   SUM(facility_encounters.pcv_2) AS sum__pcv_2,
   SUM(facility_encounters.pcv_3) AS sum__pcv_3
   FROM facility_encounters
   WHERE encounter_date >= '2018-01-01 00:00:00'
   AND encounter_date <= '2018-12-31 00:00:00'
   GROUP BY district_name,
     facility_name,
     encounter_date
   ORDER BY "Measles + MR 1" DESC
   LIMIT 10000;

我如何获取:

a) 在给定时期内,每种抗原在每个设施中接种了多少儿童?

b) 在给定时期内每个设施每种抗原的免疫覆盖率?

c) 每个设施每个时期接受全面免疫的儿童总数?

d) 应将就诊/接种疫苗的儿童人数细分为每个设施在指定时间段内给予的特定抗原数量。

e) 1 岁以下儿童的覆盖率非常重要,但是拥有 2 岁以下儿童的统计数据以监控有多少人感染麻疹也非常重要 2。在仪表板上下文中,需要显示 1 岁时的完全免疫覆盖率。 2s以下也是首选。

4

0 回答 0