Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix facility capacity exports #2489

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion care/facility/models/facility.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@

ROOM_TYPES.extend(BASE_ROOM_TYPES)

REVERSE_ROOM_TYPES = reverse_choices(ROOM_TYPES)
REVERSE_ROOM_TYPES = reverse_choices(RoomType.choices)
REVERSE_FEATURE_CHOICES = reverse_choices(FEATURE_CHOICES)

FACILITY_TYPES = [
Expand All @@ -90,27 +90,27 @@
(5, "Hotel"),
(6, "Lodge"),
(7, "TeleMedicine"),
# (8, "Govt Hospital"), # Change from "Govt Hospital" to "Govt Medical College Hospitals"

Check failure on line 93 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (ERA001)

care/facility/models/facility.py:93:5: ERA001 Found commented-out code
(9, "Govt Labs"),
(10, "Private Labs"),
# Use 8xx for Govt owned hospitals and health centres
(800, "Primary Health Centres"),
# (801, "24x7 Public Health Centres"), # Change from "24x7 Public Health Centres" to "Primary Health Centres"

Check failure on line 98 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (ERA001)

care/facility/models/facility.py:98:5: ERA001 Found commented-out code
(802, "Family Health Centres"),
(803, "Community Health Centres"),
# (820, "Urban Primary Health Center"), # Change from "Urban Primary Health Center" to "Primary Health Centres"

Check failure on line 101 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (ERA001)

care/facility/models/facility.py:101:5: ERA001 Found commented-out code
(830, "Taluk Hospitals"),
# (831, "Taluk Headquarters Hospitals"), # Change from "Taluk Headquarters Hospitals" to "Taluk Hospitals"

Check failure on line 103 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (ERA001)

care/facility/models/facility.py:103:5: ERA001 Found commented-out code
(840, "Women and Child Health Centres"),
# (850, "General hospitals"), # Change from "General hospitals" to "District Hospitals"

Check failure on line 105 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (ERA001)

care/facility/models/facility.py:105:5: ERA001 Found commented-out code
(860, "District Hospitals"),
(870, "Govt Medical College Hospitals"),
(900, "Co-operative hospitals"),
(910, "Autonomous healthcare facility"),
# Use 9xx for Labs
# (950, "Corona Testing Labs"), # Change from "Corona Testing Labs" to "Govt Labs"

Check failure on line 111 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (ERA001)

care/facility/models/facility.py:111:5: ERA001 Found commented-out code
# Use 10xx for Corona Care Center
# (1000, "Corona Care Centre"), # Change from "Corona Care Centre" to "Other"

Check failure on line 113 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (ERA001)

care/facility/models/facility.py:113:5: ERA001 Found commented-out code
(1010, "COVID-19 Domiciliary Care Center"),
# Use 11xx for First Line Treatment Centre
(1100, "First Line Treatment Centre"),
Expand Down Expand Up @@ -207,7 +207,7 @@
"hub_id", flat=True
)
if spoke_id in ancestors_of_base:
raise serializers.ValidationError("This facility is already an ancestor hub")

Check failure on line 210 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (EM101)

care/facility/models/facility.py:210:43: EM101 Exception must not use a string literal, assign to variable first
for ancestor in ancestors_of_base:
check_if_spoke_is_not_ancestor(ancestor, spoke_id)

Expand Down Expand Up @@ -320,19 +320,19 @@
def get_facility_flags(self):
return FacilityFlag.get_all_flags(self.id)

CSV_MAPPING = {
"name": "Facility Name",
"facility_type": "Facility Type",
"address": "Address",
"ward__name": "Ward Name",
"ward__number": "Ward Number",
"local_body__name": "Local Body",
"district__name": "District",
"state__name": "State",
"phone_number": "Phone Number",
}

Check failure on line 333 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (RUF012)

care/facility/models/facility.py:323:19: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`

CSV_MAKE_PRETTY = {"facility_type": (lambda x: REVERSE_FACILITY_TYPES[x])}

Check failure on line 335 in care/facility/models/facility.py

View workflow job for this annotation

GitHub Actions / Lint Code Base

Ruff (RUF012)

care/facility/models/facility.py:335:23: RUF012 Mutable class attributes should be annotated with `typing.ClassVar`


class FacilityHubSpoke(BaseModel, FacilityRelatedPermissionMixin):
Expand Down
Loading