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

Commit

Permalink
feat(COR-1772): Fix no patient numbers shown on zkh opnames GM level (#…
Browse files Browse the repository at this point in the history
…4855)

Co-authored-by: VWSCoronaDashboard29 <[email protected]>
  • Loading branch information
ben-van-eekelen and VWSCoronaDashboard29 authored Sep 4, 2023
1 parent 8b4248d commit 836ae28
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions packages/app/src/static-props/get-data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -312,13 +312,15 @@ export function createGetArchivedChoroplethData<T1, T2>(settings?: {
function replaceInaccurateLastValue(data: any) {
const metricsInaccurateItems = ['intensive_care_nice', 'hospital_nice'];

const inaccurateMetricProperty = 'admissions_on_date_of_admission_moving_average_rounded';
const inaccurateMetricProperties = ['admissions_on_date_of_admission_moving_average_rounded', 'admissions_in_the_last_7_days'];

const metricsWithInaccurateData = metricsInaccurateItems.filter((m) => m in data) as (keyof typeof data & keyof typeof metricsInaccurateItems)[];

metricsWithInaccurateData.forEach((m) => {
if (isValuesWithLastValue(data[m])) {
data[m] = adjustDataToLastAccurateValue(data[m], inaccurateMetricProperty);
for(const prop in inaccurateMetricProperties) {
data[m] = adjustDataToLastAccurateValue(data[m], inaccurateMetricProperties[prop]);
}
}
});
}
Expand Down

0 comments on commit 836ae28

Please sign in to comment.