Skip to content

Commit 0de6c67

Browse files
jalezistefanb
andauthored
FIX dashboards queries (#71)
* fix lab dashboard queries * add vaccinations new query model * add third_dose property to VaccinationByDayRow * fix _parse_vaccinations_by_day() and test * fix data vaccination_supplied_by_manufacturer * test vaccination_supplied_by_manufacturer update assertion data row * fix data vaccinations_by_region_by_day() change parser to _parse_vaccinations_by_day * test vaccinations_by_region_by_day adjust ... ...expectations * add new R values: 2, 6 _parse_vaccinations_by_day() * fix _get_default_by_age_group_command() add new query * use _parse_vaccinations_by_day in... ... vaccinations_by_age_group() * !test vaccinations_by_age_group adjust assertions we need more test for certain age groups where R == 2 || 6 R == 2 AgeGroup.GROUP_75_79 on 2021-10-10 AgeGroup.GROUP_80_84 on 2021-10-10 * fix manufacturer used query * fix manufacturer used parser due to new query see: c1a068e * test fix manufacrurer used assertions * test skip not importatant tests * vaccinations_by_manufacturer_used: added test for timestamps * fix absurdly high numbers (eg leaked timestamps) * vaccinations_by_manufacturer_used: added test for 2021-01-29: R=30 2021-10-13: R=28 * test: lab test sanity checks * fix lab PCR and HAT today queries Co-authored-by: Štefan Baebler <[email protected]>
1 parent 2a2c8b6 commit 0de6c67

File tree

8 files changed

+302
-297
lines changed

8 files changed

+302
-297
lines changed

cepimose/__init__.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -187,12 +187,11 @@ def vaccinations_by_age_group(
187187
key_value = _vaccination_by_age_group_requests.items()
188188
for key, req_list in key_value:
189189
req = req_list[0]
190-
191-
obj[key] = _get_data(req, _parse_vaccinations_by_age_group)
190+
obj[key] = _get_data(req, _parse_vaccinations_by_day)
192191
return obj
193192

194193
req = _vaccination_by_age_group_requests[group][0]
195-
return _get_data(req, _parse_vaccinations_by_age_group)
194+
return _get_data(req, _parse_vaccinations_by_day)
196195

197196

198197
# by region by day
@@ -217,12 +216,12 @@ def vaccinations_by_region_by_day(
217216
key_value = _vaccinations_by_region_by_day_requests.items()
218217
for key, req_list in key_value:
219218
req = req_list[0]
220-
doses = _get_data(req, _parse_vaccinations_by_region_by_day)
219+
doses = _get_data(req, _parse_vaccinations_by_day)
221220
obj[key] = doses
222221
return obj
223222

224223
req = _vaccinations_by_region_by_day_requests[region][0]
225-
doses = _get_data(req, _parse_vaccinations_by_region_by_day)
224+
doses = _get_data(req, _parse_vaccinations_by_day)
226225
obj[region] = doses
227226

228227
return obj

cepimose/commands.py

+13-11
Original file line numberDiff line numberDiff line change
@@ -502,31 +502,33 @@ def _get_default_manufacturer_used_command(manu: Manufacturer):
502502
"Name": "Calendar.Date",
503503
},
504504
{
505-
"Column": _get_Column("s", "Cepivo_Ime"),
506-
"Name": "Sifrant_Cepivo.Cepivo_Ime",
505+
"Measure": _get_Column("c", "Weight for 1"),
506+
"Name": "eRCO_​​podatki.Weight for 1",
507+
},
508+
{
509+
"Measure": _get_Column("c", "Weight for 2"),
510+
"Name": "eRCO_​​podatki.Weight for 2",
511+
},
512+
{
513+
"Measure": _get_Column("c", "Weight for 2"),
514+
"Name": "eRCO_​​podatki.Weight for 2",
507515
},
508516
{
509517
"Aggregation": {
510-
"Expression": {"Column": _get_Column("c", "Weight")},
518+
"Expression": {"Column": _get_Column("c", "weight")},
511519
"Function": 0,
512520
},
513521
"Name": "Sum(eRCO_podatki_ed.Weight)",
514522
},
515523
],
516524
"Where": [
517525
_get_Condition_Comparison_With_DateSpan("c1", 2),
518-
_get_Condition_Not_Expression(),
519526
_get_Condition_In_Expression("Cepivo_Ime", "s", manu.value),
520527
],
521528
},
522529
"Binding": {
523-
"Primary": {"Groupings": [{"Projections": [0, 2]}]},
524-
"Secondary": {"Groupings": [{"Projections": [1]}]},
525-
"DataReduction": {
526-
"DataVolume": 4,
527-
"Primary": {"Sample": {}},
528-
"Secondary": {"Top": {}},
529-
},
530+
"Primary": {"Groupings": [{"Projections": [0, 1, 2, 3, 4]}]},
531+
"DataReduction": {"DataVolume": 4, "Primary": {"Sample": {}}},
530532
"Version": 1,
531533
},
532534
**_ExecutionMetrics,

0 commit comments

Comments
 (0)