forked from ApoorvGuptaAi/iitk-india-covid-data-parser
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhospital.py
38 lines (32 loc) · 1.23 KB
/
hospital.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
from enum import Enum
from dataclasses import dataclass
from typing import List, Optional
import datetime
# Resource type defined at https://github.com/abhinavj13/iitk-covid-help-api/blob/master/src/services/dataLead/db/enum.ts
class ResourceType(Enum):
BED_WITHOUT_OXYGEN = "BED_WITHOUT_OXYGEN"
BED_WITH_OXYGEN = "BED_WITH_OXYGEN"
ICU_WITH_VENTILATOR = "ICU_WITH_VENTILATOR"
ICU_WITHOUT_VENTILATOR = "ICU_WITHOUT_VENTILATOR"
BEDS = "BEDS" # all beds, w/ or w/o oxygen
ICUS = "ICUS" # all icus, w/ or w/o ventilators.
@dataclass
class Resource:
resource_type: ResourceType
resource_description: str
resource_qty: int # What is available atm
total_qty: Optional[int] = 0 # Inventory = available + unavailable
@dataclass
class Hospital:
name: str
address: Optional[str] = ""
district: Optional[str] = ""
city: Optional[str] = ""
state: Optional[str] = "" # Required.
location: Optional[str] = ""
# The datetime the website entry was updated. Use time 0 if not available from the website.
last_updated: Optional[datetime.datetime] = None
resources: Optional[List[Resource]] = None
debug_text: Optional[str] = None
url: Optional[str] = None
pincode: Optional[int] = 0