Skip to content

Commit

Permalink
Add Non-Invensive Ventilation for api/patients
Browse files Browse the repository at this point in the history
  • Loading branch information
lukarenko committed Jan 16, 2021
1 parent 7d35398 commit c2c5c5d
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 7 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 7 additions & 5 deletions sources/SloCovidServer/SloCovidServer/Models/PatientsDay.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,16 @@ public PatientsDay(int dayFromStart, int year, int month, int day, GeneralUnit t
public record GeneralUnit : BaseUnit<StateDeceased>
{
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<HospitalDeceased>
{
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)
{
}
}
Expand All @@ -42,14 +42,16 @@ public record BaseUnit<TDeceased>
{
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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,7 @@ PatientsDay GetDailyPatientsFromRaw(ImmutableDictionary<string, int> 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),
Expand All @@ -499,6 +500,7 @@ PatientsDay GetDailyPatientsFromRaw(ImmutableDictionary<string, int> 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),
Expand Down
2 changes: 1 addition & 1 deletion sources/SloCovidServer/SloCovidServer/Startup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion version.xml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
<?xml version="1.0" encoding="utf-8"?>
<version>1.9.15</version>
<version>1.9.16</version>

0 comments on commit c2c5c5d

Please sign in to comment.