Skip to content
This repository has been archived by the owner on Nov 4, 2024. It is now read-only.

feat(COR-1765): ZKH in beeld – gemiddelde bedbezetting per dag #4842

Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/app/schema/nl/hospital_lcps.json
APW26 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"beds_occupied_covid": {
"type": ["integer", "null"]
},
"beds_occupied_covid_moving_average": {
"type": ["integer", "null"]
},
"influx_covid_patients": {
"type": ["integer", "null"]
},
Expand All @@ -38,6 +41,7 @@
},
"required": [
"beds_occupied_covid",
"beds_occupied_covid_moving_average",
"influx_covid_patients",
"influx_covid_patients_moving_average",
"date_unix",
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
4 changes: 4 additions & 0 deletions packages/app/schema/nl/intensive_care_lcps.json
APW26 marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@
"beds_occupied_covid": {
"type": ["integer", "null"]
},
"beds_occupied_covid_moving_average": {
"type": ["integer", "null"]
},
"beds_occupied_covid_percentage": {
"type": ["number", "null"]
},
Expand All @@ -41,6 +44,7 @@
},
"required": [
"beds_occupied_covid",
"beds_occupied_covid_moving_average",
"beds_occupied_covid_percentage",
"influx_covid_patients",
"influx_covid_patients_moving_average",
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/components/kpi/bordered-kpi-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ import { Text } from '../typography';
import { KpiContent } from './components/kpi-content';
import { BorderedKpiSectionProps } from './types';

export const BorderedKpiSection = ({ title, description, source, dateUnix, tilesData }: BorderedKpiSectionProps) => {
export const BorderedKpiSection = ({ title, description, source, dataRangeUnix, tilesData }: BorderedKpiSectionProps) => {
const metadata: MetadataProps = {
date: dateUnix,
date: dataRangeUnix,
VWSCoronaDashboard30 marked this conversation as resolved.
Show resolved Hide resolved
source: source,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/app/src/components/kpi/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ export type TileData = {
};

export interface BorderedKpiSectionProps {
dateUnix: number;
dataRangeUnix: number | [number, number];
APW26 marked this conversation as resolved.
Show resolved Hide resolved
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
description: string;
source: {
href: string;
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/pages/gemeente/[code]/vaccinaties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) =>
},
},
]}
dateUnix={filteredVaccination.autumn2022.date_unix}
dataRangeUnix={filteredVaccination.autumn2022.date_unix}
APW26 marked this conversation as resolved.
Show resolved Hide resolved
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
/>
)}
<BorderedKpiSection
Expand Down Expand Up @@ -199,7 +199,7 @@ export const VaccinationsGmPage = (props: StaticProps<typeof getStaticProps>) =>
},
},
]}
dateUnix={filteredVaccination.primarySeries.date_unix}
dataRangeUnix={filteredVaccination.primarySeries.date_unix}
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
/>
<VaccineCoverageChoropleth
data={choropleth.gm.vaccine_coverage_per_age_group}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ function VulnerableGroups(props: StaticProps<typeof getStaticProps>) {
title={textNl.kpi_tiles.infected_locations.title}
description={textNl.kpi_tiles.infected_locations.description}
source={infectedLocationsText.bronnen.rivm}
dateUnix={vulnerableNursingHomeDataLastValue.date_unix}
dataRangeUnix={vulnerableNursingHomeDataLastValue.date_unix}
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
tilesData={[
{
value: vulnerableNursingHomeDataLastValue.infected_locations_total,
Expand Down
4 changes: 2 additions & 2 deletions packages/app/src/pages/landelijk/vaccinaties.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) {
},
},
]}
dateUnix={vaccineCoverageEstimatedAutumn2022.date_unix}
dataRangeUnix={vaccineCoverageEstimatedAutumn2022.date_unix}
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
/>
<BorderedKpiSection
title={textShared.vaccination_grade_tile.fully_vaccinated_labels.title}
Expand Down Expand Up @@ -251,7 +251,7 @@ function VaccinationPage(props: StaticProps<typeof getStaticProps>) {
},
},
]}
dateUnix={vaccineCoverageEstimatedFullyVaccinated.date_unix}
dataRangeUnix={vaccineCoverageEstimatedFullyVaccinated.date_unix}
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
/>

<VaccineCampaignsTile
Expand Down
10 changes: 6 additions & 4 deletions packages/app/src/pages/landelijk/ziekenhuizen-in-beeld.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,8 @@ const HospitalsAndCarePage = (props: StaticProps<typeof getStaticProps>) => {
const hospitalLastValue = getLastFilledValue(data.hospital_lcps);
const icuLastValue = getLastFilledValue(data.intensive_care_lcps);

const borderedKpiPeriod = data.difference.hospital_lcps__beds_occupied_covid;
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved

const lastInsertionDateOfPage = getLastInsertionDateOfPage(data, pageMetrics);
const mostRecentDateUnix = Math.max(hospitalLastValue.date_unix, icuLastValue.date_unix);

Expand Down Expand Up @@ -137,16 +139,16 @@ const HospitalsAndCarePage = (props: StaticProps<typeof getStaticProps>) => {
title={textNl.kpi_tiles.occupancies.title}
description={textNl.kpi_tiles.occupancies.description}
source={textNl.sources.lnaz}
dateUnix={mostRecentDateUnix}
dataRangeUnix={[borderedKpiPeriod.old_date_unix, borderedKpiPeriod.new_date_unix]}
tilesData={[
{
value: hospitalLastValue.beds_occupied_covid,
value: hospitalLastValue.beds_occupied_covid_moving_average,
differenceValue: data.difference.hospital_lcps__beds_occupied_covid,
title: textNl.kpi_tiles.occupancies.hospital.title,
description: textNl.kpi_tiles.occupancies.hospital.description,
},
{
value: icuLastValue.beds_occupied_covid,
value: icuLastValue.beds_occupied_covid_moving_average,
differenceValue: data.difference.intensive_care_lcps__beds_occupied_covid,
title: textNl.kpi_tiles.occupancies.icu.title,
description: textNl.kpi_tiles.occupancies.icu.description,
Expand Down Expand Up @@ -262,7 +264,7 @@ const HospitalsAndCarePage = (props: StaticProps<typeof getStaticProps>) => {
title={textNl.kpi_tiles.influxes.title}
description={textNl.kpi_tiles.influxes.description}
source={textNl.sources.lnaz}
dateUnix={mostRecentDateUnix}
dataRangeUnix={mostRecentDateUnix}
Jorrik-Klijnsma-Work marked this conversation as resolved.
Show resolved Hide resolved
tilesData={[
{
value: hospitalLastValue.influx_covid_patients,
Expand Down
2 changes: 2 additions & 0 deletions packages/common/src/types/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1009,6 +1009,7 @@ export interface NlHospitalLcps {
}
export interface NlHospitalLcpsValue {
beds_occupied_covid: number | null;
beds_occupied_covid_moving_average: number | null;
influx_covid_patients: number | null;
influx_covid_patients_moving_average: number | null;
date_unix: number;
Expand All @@ -1020,6 +1021,7 @@ export interface NlIntensiveCareLcps {
}
export interface NlIntensiveCareLcpsValue {
beds_occupied_covid: number | null;
beds_occupied_covid_moving_average: number | null;
beds_occupied_covid_percentage: number | null;
influx_covid_patients: number | null;
influx_covid_patients_moving_average: number | null;
Expand Down
Loading