From c2c5c5d5d0aa68124714eeb38f96f273a110d077 Mon Sep 17 00:00:00 2001 From: Luka Renko <46861689+lukarenko@users.noreply.github.com> Date: Sat, 16 Jan 2021 15:43:18 +0100 Subject: [PATCH] Add Non-Invensive Ventilation for api/patients --- README.md | 5 +++++ .../SloCovidServer/Models/PatientsDay.cs | 12 +++++++----- .../SloCovidServer/Services/Implemented/Mapper.cs | 2 ++ sources/SloCovidServer/SloCovidServer/Startup.cs | 2 +- version.xml | 2 +- 5 files changed, 16 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 8979523..51514a0 100644 --- a/README.md +++ b/README.md @@ -25,6 +25,11 @@ In case of failures a notification is set to slack channel #alert through Data A ## Changelog +## 1.9.16 + +* Schema version 33 +* Add patients.niv to `/api/patients` + ## 1.9.15 * Schema version 32 diff --git a/sources/SloCovidServer/SloCovidServer/Models/PatientsDay.cs b/sources/SloCovidServer/SloCovidServer/Models/PatientsDay.cs index 976b09b..b58f43a 100644 --- a/sources/SloCovidServer/SloCovidServer/Models/PatientsDay.cs +++ b/sources/SloCovidServer/SloCovidServer/Models/PatientsDay.cs @@ -24,16 +24,16 @@ public PatientsDay(int dayFromStart, int year, int month, int day, GeneralUnit t public record GeneralUnit : BaseUnit { public OutOfHospital OutOfHospital { get; init; } - public GeneralUnit(HospitalMovement inHospital, HospitalMovement iCU, HospitalMovement critical, StateDeceased deceased, HospitalMovement care, TodayToDate deceasedCare, - OutOfHospital outOfHospital) : base(inHospital, iCU, critical, deceased, care, deceasedCare) + public GeneralUnit(HospitalMovement inHospital, HospitalMovement iCU, HospitalMovement niv, HospitalMovement critical, StateDeceased deceased, HospitalMovement care, TodayToDate deceasedCare, + OutOfHospital outOfHospital) : base(inHospital, iCU, niv, critical, deceased, care, deceasedCare) { OutOfHospital = outOfHospital; } } public record Unit : BaseUnit { - public Unit(HospitalMovement inHospital, HospitalMovement iCU, HospitalMovement critical, HospitalDeceased deceased, HospitalMovement care, TodayToDate deceasedCare) - : base(inHospital, iCU, critical, deceased, care, deceasedCare) + public Unit(HospitalMovement inHospital, HospitalMovement iCU, HospitalMovement niv, HospitalMovement critical, HospitalDeceased deceased, HospitalMovement care, TodayToDate deceasedCare) + : base(inHospital, iCU, niv, critical, deceased, care, deceasedCare) { } } @@ -42,14 +42,16 @@ public record BaseUnit { public HospitalMovement InHospital { get; init; } public HospitalMovement ICU { get; init; } + public HospitalMovement NIV { get; init; } public HospitalMovement Critical { get; init; } public TDeceased Deceased { get; init; } public HospitalMovement Care { get; init; } public TodayToDate DeceasedCare { get; init; } - public BaseUnit(HospitalMovement inHospital, HospitalMovement iCU, HospitalMovement critical, TDeceased deceased, HospitalMovement care, TodayToDate deceasedCare) + public BaseUnit(HospitalMovement inHospital, HospitalMovement iCU, HospitalMovement niv, HospitalMovement critical, TDeceased deceased, HospitalMovement care, TodayToDate deceasedCare) { InHospital = inHospital; ICU = iCU; + NIV = niv; Critical = critical; Deceased = deceased; diff --git a/sources/SloCovidServer/SloCovidServer/Services/Implemented/Mapper.cs b/sources/SloCovidServer/SloCovidServer/Services/Implemented/Mapper.cs index c3a42d8..d3f4c21 100644 --- a/sources/SloCovidServer/SloCovidServer/Services/Implemented/Mapper.cs +++ b/sources/SloCovidServer/SloCovidServer/Services/Implemented/Mapper.cs @@ -487,6 +487,7 @@ PatientsDay GetDailyPatientsFromRaw(ImmutableDictionary header, str var generalUnit = new GeneralUnit( inHospital: GetHospitalMovement(facility: null, "in_hospital", header, fields), GetHospitalMovement(facility: null, "icu", header, fields), + GetHospitalMovement(facility: null, "niv", header, fields), GetHospitalMovement(facility: null, "critical", header, fields), GetStateDeceased(header, fields), GetHospitalMovement(facility: null, "care", header, fields), @@ -499,6 +500,7 @@ PatientsDay GetDailyPatientsFromRaw(ImmutableDictionary header, str var unit = new Unit( inHospital: GetHospitalMovement(facility, "in_hospital", header, fields), GetHospitalMovement(facility, "icu", header, fields), + GetHospitalMovement(facility, "niv", header, fields), GetHospitalMovement(facility, "critical", header, fields), GetDeceased(facility, header, fields), GetHospitalMovement(facility, "care", header, fields), diff --git a/sources/SloCovidServer/SloCovidServer/Startup.cs b/sources/SloCovidServer/SloCovidServer/Startup.cs index b74a122..abd3f08 100644 --- a/sources/SloCovidServer/SloCovidServer/Startup.cs +++ b/sources/SloCovidServer/SloCovidServer/Startup.cs @@ -16,7 +16,7 @@ namespace SloCovidServer { public class Startup { - const string SchemaVersion = "31"; + const string SchemaVersion = "32"; const string CorsPolicy = "Any"; readonly IWebHostEnvironment env; public Startup(IConfiguration configuration, IWebHostEnvironment env) diff --git a/version.xml b/version.xml index f6b30b0..78a8dba 100644 --- a/version.xml +++ b/version.xml @@ -1,2 +1,2 @@  -1.9.15 \ No newline at end of file +1.9.16 \ No newline at end of file