Example #1
0
 def add_icu(region_id, name, values):
     icu_id = store.add_icu(admin_user_id,
                            ICU(name=name, region_id=region_id))
     for index, value in enumerate(values):
         store.update_bed_count_for_icu(
             admin_user_id,
             BedCount(icu_id=icu_id,
                      n_covid_occ=value,
                      create_date=now + timedelta(seconds=index)))
     return icu_id
Example #2
0
    def test_add_icu(self):
        icu = ICU(name="test",
                  dept="dept",
                  city="city",
                  country="country",
                  lat=1.23,
                  long=4.56,
                  telephone="123456")
        icu_id = self.store.add_icu(self.admin_user_id, icu)
        self.assertEqual(icu_id, 1)

        icu = self.store.get_icu(icu_id)
        self.assertEqual(icu.name, "test")
        self.assertEqual(icu.dept, "dept")
        self.assertEqual(icu.city, "city")
        self.assertEqual(icu.country, "country")
        self.assertEqual(icu.lat, 1.23)
        self.assertEqual(icu.long, 4.56)
        self.assertEqual(icu.telephone, "123456")
Example #3
0
 def add_icu(name, dept, city, lat, long, telephone, n_covid_occ,
             n_covid_free, n_ncovid_free, n_covid_deaths, n_covid_healed,
             n_covid_refused, n_covid_transfered):
     icu_id = store.add_icu(
         admin_user_id,
         ICU(name=name,
             region_id=region_id,
             dept=dept,
             city=city,
             lat=lat,
             long=long,
             telephone=telephone))
     store.update_bed_count_for_icu(
         admin_user_id,
         BedCount(icu_id=icu_id,
                  n_covid_occ=n_covid_occ,
                  n_covid_free=n_covid_free,
                  n_ncovid_free=n_ncovid_free,
                  n_covid_deaths=n_covid_deaths,
                  n_covid_healed=n_covid_healed,
                  n_covid_refused=n_covid_refused,
                  n_covid_transfered=n_covid_transfered))
     return icu_id
Example #4
0
 def add_icu(self, name="icu", region_id=None, is_active=True):
     return self.store.add_icu(
         self.admin_user_id,
         ICU(name=name, region_id=region_id, is_active=is_active))
Example #5
0
 def add_icu(self, name="icu", region_id=None):
     return self.store.add_icu(self.admin_user_id,
                               ICU(name=name, region_id=region_id))
Example #6
0
 def add_icu(self, name="icu"):
     return self.store.add_icu(self.admin_user_id, ICU(name=name))