Skip to content
This repository has been archived by the owner on Aug 10, 2023. It is now read-only.

Commit

Permalink
ICU: Do not include children beds
Browse files Browse the repository at this point in the history
Signed-off-by: Soenke Huster <soenke.huster@eknoes.de>
  • Loading branch information
eknoes committed Dec 8, 2021
1 parent 855a76e commit ff361ff
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions covidbot/covid_data/updater/icu.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ def update(self) -> bool:
# Berlin is here AGS = 11000
if row['gemeindeschluessel'] == '11000':
row['gemeindeschluessel'] = '11'
results.append((row['gemeindeschluessel'], row['daten_stand'], row['betten_frei'], row['betten_belegt'],
results.append((row['gemeindeschluessel'], row['daten_stand'], row['betten_frei_nur_erwachsen'], row['betten_belegt_nur_erwachsen'],
row['faelle_covid_aktuell'], row['faelle_covid_aktuell_invasiv_beatmet']))

with self.connection.cursor() as cursor:
Expand Down Expand Up @@ -103,7 +103,7 @@ def update(self) -> bool:
else:
num_covid = None

row_contents = [row[key_district_id], row['date'], row['betten_frei'], row['betten_belegt'],
row_contents = [row[key_district_id], row['date'], row['betten_frei_nur_erwachsen'], row['betten_belegt_nur_erwachsen'],
num_covid, num_ventilated]
results.append(row_contents)

Expand Down
6 changes: 3 additions & 3 deletions covidbot/interfaces/single_command_interface.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,17 +162,17 @@ def get_icu_shortpost(self, icu: ICUData) -> List[BotResponse]:
f"In {format_noun(icu.occupied_covid, FormattableNoun.BEDS)} " \
f"({format_float(icu.percent_covid())}%) liegen Patient:innen" \
f" mit #COVID19, davon werden {format_int(icu.covid_ventilated)} beatmet. " \
f"Insgesamt gibt es {format_noun(icu.total_beds(), FormattableNoun.BEDS)}."
f"Insgesamt gibt es {format_noun(icu.total_beds(), FormattableNoun.BEDS)} für Erwachsene."
post = [BotResponse(tweet_text, [self.viz.icu_graph(0)])]

icu_info = self.data.get_icu_global_facts()
if icu_info:
second_tweet = ""
if icu_info.districts_full:
second_tweet += f"{icu_info.districts_full} Orte haben keine freien Intensivbetten mehr. "
second_tweet += f"{icu_info.districts_full} Orte haben keine freien Intensivbetten für Erwachsene mehr. "

if icu_info.districts_low:
second_tweet += f"In {icu_info.districts_low} Orten sind mindestens 90% der Intensivbetten belegt."
second_tweet += f"In {icu_info.districts_low} Orten sind mindestens 90% der Intensivbetten für Erwachsene belegt."

if second_tweet:
post.append(BotResponse(second_tweet))
Expand Down
10 changes: 5 additions & 5 deletions covidbot/report_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ def get_district_summary(district: DistrictData, show_icu: bool, show_vaccinatio

if show_icu and district.icu_data:
message += "\n• {percent_occupied}% ({beds_occupied}){occupied_trend} belegt, in " \
"{percent_covid}% ({beds_covid}){covid_trend} Covid19-Patient:innen, {clear_beds} frei" \
"{percent_covid}% ({beds_covid}){covid_trend} Covid19-Patient:innen, {clear_beds} frei (nur Erwachsene)" \
.format(beds_occupied=format_noun(district.icu_data.occupied_beds, FormattableNoun.BEDS),
percent_occupied=format_float(district.icu_data.percent_occupied()),
occupied_trend=format_data_trend(district.icu_data.occupied_beds_trend),
Expand Down Expand Up @@ -345,7 +345,7 @@ def get_district_icu_summary(district: DistrictData) -> str:

message += "\n• {percent_covid}% ({beds_covid}){covid_trend} Covid19-Patient:innen" \
"\n• Davon {percent_ventilated}% ({beds_ventilated}) beatmet" \
"\n• {clear_beds} frei" \
"\n• {clear_beds} für Erwachsene frei" \
.format(beds_covid=format_noun(district.icu_data.occupied_covid, FormattableNoun.BEDS),
percent_covid=format_float(district.icu_data.percent_covid()),
covid_trend=format_data_trend(district.icu_data.occupied_covid_trend),
Expand Down Expand Up @@ -397,7 +397,7 @@ def get_icu_text(district: DistrictData) -> str:
f"{format_float(district.icu_data.percent_occupied())}% " \
f"({format_noun(district.icu_data.occupied_beds, FormattableNoun.BEDS)})" \
f"{format_data_trend(district.icu_data.occupied_beds_trend)} " \
f"der Intensivbetten sind aktuell belegt. " \
f"der Intensivbetten für Erwachsene sind aktuell belegt. " \
f"In {format_noun(district.icu_data.occupied_covid, FormattableNoun.BEDS)} " \
f"({format_float(district.icu_data.percent_covid())}%)" \
f"{format_data_trend(district.icu_data.occupied_covid_trend)} " \
Expand All @@ -406,10 +406,10 @@ def get_icu_text(district: DistrictData) -> str:
f" ({format_float(district.icu_data.percent_ventilated())}%) invasiv beatmet werden."

if district.icu_data.facts is not None:
message += f"\n\n{district.icu_data.facts.districts_full} Orte haben keine freien Intensivbetten mehr, in " \
message += f"\n\n{district.icu_data.facts.districts_full} Orte haben keine freien Intensivbetten für Erwachsene mehr, in " \
f"{district.icu_data.facts.districts_low} Orten sind mindestens 90% der Intensivbetten belegt."

message += f" Insgesamt gibt es {format_noun(district.icu_data.total_beds(), FormattableNoun.BEDS)} in {district.name}.\n\n"
message += f" Insgesamt gibt es {format_noun(district.icu_data.total_beds(), FormattableNoun.BEDS)} für Erwachsene in {district.name}.\n\n"

return message

Expand Down

0 comments on commit ff361ff

Please sign in to comment.