Skip to content

Commit e6a4ca3

Browse files
authored
Merge pull request #283 from cmu-delphi/development
Fluview indicators will not be plotted if there is no data for select…
2 parents e620987 + 8fd79c2 commit e6a4ca3

File tree

3 files changed

+26
-19
lines changed

3 files changed

+26
-19
lines changed

src/assets/js/selectedIndicatorsModal.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,12 @@ async function checkFluviewGeoCoverage(geoValue) {
205205
indicators: JSON.stringify(checkedIndicatorMembers.filter((indicator) => indicator["_endpoint"] === "fluview" || indicator["_endpoint"] === "fluview_clinical")),
206206
}
207207
});
208+
for (const checkedIndicator of checkedIndicatorMembers.filter((indicator) => indicator["_endpoint"] === "fluview" || indicator["_endpoint"] === "fluview_clinical")) {
209+
if (result["not_covered_indicators"].some((indicator) => indicator.indicator === checkedIndicator.indicator)) {
210+
checkedIndicator["notCoveredGeos"] = [geoValue];
211+
}
212+
}
213+
console.log(checkedIndicatorMembers);
208214
return result["not_covered_indicators"];
209215
} catch (error) {
210216
console.error("Error fetching fluview geo coverage:", error);

src/epiportal/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
from sentry_sdk.integrations.django import DjangoIntegration
2525
from sentry_sdk.integrations.redis import RedisIntegration
2626

27-
APP_VERSION = "1.0.22"
27+
APP_VERSION = "1.0.23"
2828
ALTERNATIVE_INTERFACE_VERSION = "1.0.9"
2929

3030

src/indicatorsets/utils.py

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -166,25 +166,26 @@ def generate_covidcast_dataset_epivis(indicator, covidcast_geos):
166166
def generate_fluview_dataset_epivis(indicator, fluview_geos):
167167
datasets = []
168168
for geo in fluview_geos:
169-
datasets.append(
170-
{
171-
"color": generate_random_color(),
172-
"title": FLUVIEW_INDICATORS_MAPPING.get(
173-
indicator["indicator"], indicator["indicator"]
174-
),
175-
"params": {
176-
"_endpoint": (
177-
indicator["_endpoint"]
178-
if indicator["data_source"] == "fluview"
179-
else "fluview_clinical"
180-
),
181-
"regions": geo["id"],
182-
"custom_title": generate_epivis_custom_title(
183-
indicator, geo["text"]
169+
if geo["id"] not in indicator.get("notCoveredGeos", []):
170+
datasets.append(
171+
{
172+
"color": generate_random_color(),
173+
"title": FLUVIEW_INDICATORS_MAPPING.get(
174+
indicator["indicator"], indicator["indicator"]
184175
),
185-
},
186-
}
187-
)
176+
"params": {
177+
"_endpoint": (
178+
indicator["_endpoint"]
179+
if indicator["data_source"] == "fluview"
180+
else "fluview_clinical"
181+
),
182+
"regions": geo["id"],
183+
"custom_title": generate_epivis_custom_title(
184+
indicator, geo["text"]
185+
),
186+
},
187+
}
188+
)
188189
return datasets
189190

190191

0 commit comments

Comments
 (0)