True impact of COVID19 outbreak highly depends on the readiness of countries to deal with waves of patients. In this short computational essay, I compare 10 counties with the largest COVID19 positive cases by considering the total number of beds available in hospitals. The result implies a different picture from simple counting of positive cases. The situation in Italy, Switzerland, Spain and Iran is about ten times or more worse than other cases, implying a very high pressure on their public health system.
Hospital bed data per country
Hospital bed data per country
Get the data of hospital beds per 1000 inhabitants from WDR:
In[]:=
dsBeds=ResourceDataResourceObject;
Since Iran's data is missing, I extracted Iran's total hospital bed data from World Bank data, and put it on Wolfram cloud.
Append Iran's data to the hospital dataset, finally sort it by country:
In[]:=
dsBeds=DatasetAppendNormal[dsBeds],AssociationThreadNormal[Keys[dsBeds[1]]],Missing["NotAvailable"],Missing["NotAvailable"],CloudGetCloudObject[SortBy["Country"]];
In[]:=
BarChartdt=Sort@Normal@dsBeds[GroupBy["Country"],Total,#TotalBedsPer1000Inhabitants["LastValue"]&],ChartLabelsCommonName@Keys@dt,
Out[]=
Extract the last value of total beds per 1000 inhabitants, and calculate the total number of beds:
In[]:=
totalBeds=Normal@dsBedsGroupBy["Country"],Total,Switch#TotalBedsPer1000Inhabitants,_Missing,Missing["NotAvailable"],_TemporalData,#TotalBedsPer1000Inhabitants["LastValue"]&;
QuantityMagnitude[#Country["Population"]]
1000
COVID19 data
COVID19 data
Get COVID19 epidemic data from WDR:
dsCOVID19=ResourceData["Epidemic Data for Novel Coronavirus COVID-19"];
Assuming that all beds are maintained, staffed and immediately available for COVID19 patients, a measure for the readiness can be introduced as follows:
Out[]//TraditionalForm=
Number of Confirmed Cases
Total Number Of Beds
It is definitely an overestimation, and a very crude measure. For example, not all beds can be ready for COVID19 patients; however, this idealistic measure can provide some good insight. The smaller is the measure, the better; and the larger this measure, the more alarming would be the situation, implying that the resources are depleting. Let us add a new column to our dataset for this measure.
Since COVID19 epidemic data of WDR is updating daily, I extract a portion of a time series from the beginning of the outbreak through today (March 21).
Define a function that extracts a portion of a time series:
In[]:=
truncatedTimeSeries[x_TemporalData]:=TimeSeriesWindowx,,;
Add a new column which is %ConfirmedCases/TotalBeds:
In[]:=
dsCOVID19Beds=Dataset@Association@KeyValueMap[<|#1<|{#2,"PercentAvailableBeds"100.#2["ConfirmedCases"]/totalBeds[#1]}|>|>&][Normal@dsCOVID19[GroupBy["Country"],Total,{"ConfirmedCases","RecoveredCases","Deaths"}][All,{"ConfirmedCases"truncatedTimeSeries,"RecoveredCases"truncatedTimeSeries,"Deaths"truncatedTimeSeries}]];
Comparing results
Comparing results
As of March 22, the top 10 countries with the largest confirmed cases of COVID19 are, sorted in descending order, China, Italy, United States, Spain, Germany, Iran, France, South Korea, Switzerland, and United Kingdom.
Plot data for top 10 countries with the largest number of confirmed cases:
In[]:=
DateListLogPlotdsCOVID19Beds[TakeLargestBy[#ConfirmedCases["LastValue"]&,10]][All,"ConfirmedCases"],
Out[]=
However, when including the total hospital beds per country, one observes a different order.
For top 10 countries with the largest number of confirmed cases, plot the % ConfirmedCases/TotalBeds:
In[]:=
DateListLogPlotdsCOVID19Beds[TakeLargestBy[#ConfirmedCases["LastValue"]&,10]][ReverseSortBy[#PercentAvailableBeds["LastValue"]&]][All,"PercentAvailableBeds"],
Out[]=
Concluding remarks
Concluding remarks
How bad a country is hit by COVID19 outbreak depends on the number of confirmed cases together with available resources (mostly, medical ones). Taking into the account the total number of available hospital beds per countries, my analysis suggests that the situation in Italy, Spain and Switzerland and Iran is about ten times or more worse than other countries, implying a very high pressure on their public health system.
Disclaimer
Disclaimer
This analysis works with the pre-existing number of beds. We know that China created a few thousands more beds within days, same with Germany, which will soften the impact.
Acknowledgment
Acknowledgment
I would like to thank WolframAlpha team for their valuable help and input.