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

Merge Develop To Staging v24.53.0 #2684

Merged
merged 27 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
74b397b
Daily round notifications fix
Jacobjeevan Dec 7, 2024
2f14d3d
Switch from localstack to minio
amjithtitus09 Dec 8, 2024
2a23839
Added relevant comments & suggested code changes
amjithtitus09 Dec 9, 2024
ae92dd9
Merge branch 'develop' into issues/dailyround-notifications
Jacobjeevan Dec 11, 2024
078a876
Delete care/facility/migrations/0468_notifications_dailyround_externa…
Jacobjeevan Dec 13, 2024
b1d3ac0
Remove periodic summarization tasks from tasks/__init__.py
areebahmeddd Dec 15, 2024
e788f4b
Remove all summarization task definitions from tasks/summarisation.py
areebahmeddd Dec 15, 2024
d9c7a94
Remove summarization task settings from config/settings/base.py
areebahmeddd Dec 15, 2024
85210b6
Remove mentions of summarization tasks from documentation
areebahmeddd Dec 15, 2024
e5d914e
Remove summarization task serializers, viewsets, and API routes
areebahmeddd Dec 15, 2024
2a7a468
Merge branch 'develop' into remove-summarization
sainak Dec 15, 2024
be297fc
Removed summary models and other leftover bits
sainak Dec 15, 2024
20cd5cd
Remove unused FacilityPatientStatsHistoryFilterSet
sainak Dec 15, 2024
b2f2e7e
update gitattributes
sainak Dec 16, 2024
6070399
Merge branch 'develop' into switch-to-minio
sainak Dec 16, 2024
c1cc9d0
Fixes #2657 Stops and removes the containers and their volumes.
saltykheera Dec 17, 2024
ea14899
updated readme file for clarity
saltykheera Dec 17, 2024
a7f5a64
Merge branch 'develop' into issues/dailyround-notifications
sainak Dec 18, 2024
fd98e43
Update .gitattributes for shell scripts
sainak Dec 18, 2024
bae3201
Merge pull request #2653 from areebahmeddd/remove-summarization
vigneshhari Dec 20, 2024
3b903cf
Merge pull request #2640 from amjithtitus09/switch-to-minio
vigneshhari Dec 20, 2024
d24b016
Merge pull request #2658 from saltykheera/remove_volume-fr
vigneshhari Dec 20, 2024
fbf76d7
Merge pull request #2641 from Jacobjeevan/issues/dailyround-notificat…
vigneshhari Dec 20, 2024
dec6475
Update gitignore for more celerybeat schedule files
sainak Dec 22, 2024
ab093e4
Merge pull request #2677 from ohcnetwork/sainak/celerybeat-gitignore
vigneshhari Dec 23, 2024
e7423f2
Fix lint
sainak Dec 26, 2024
bde8acf
Merge pull request #2685 from ohcnetwork/sainak/fix/lint
vigneshhari Dec 26, 2024
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 .gitattributes
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
* text=auto
scripts/* text eol=lf
*.sh text eol=lf
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,7 @@ care/media/*

test_db

celerybeat-schedule
celerybeat-schedule*

secrets.sh

Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@ up:
down:
docker compose -f docker-compose.yaml -f $(docker_config_file) down

teardown:
docker compose -f docker-compose.yaml -f $(docker_config_file) down -v

load-dummy-data:
docker compose exec backend bash -c "python manage.py load_dummy_data"

Expand Down
10 changes: 10 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,16 @@ to load dummy data for testing run:
```bash
make load-dummy-data
```
Stops and removes the containers without affecting the volumes:

```bash
make down
```
Stops and removes the containers and their volumes:

```bash
make teardown
```

#### Docker

Expand Down
28 changes: 0 additions & 28 deletions care/facility/api/serializers/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
GENDER_CHOICES,
Disease,
Facility,
FacilityPatientStatsHistory,
PatientContactDetails,
PatientMetaInfo,
PatientNotes,
Expand Down Expand Up @@ -358,33 +357,6 @@ def update(self, instance, validated_data):
return patient


class FacilityPatientStatsHistorySerializer(serializers.ModelSerializer):
id = serializers.CharField(source="external_id", read_only=True)
entry_date = serializers.DateField(default=lambda: now().date())
facility = ExternalIdSerializerField(
queryset=Facility.objects.all(), read_only=True
)

class Meta:
model = FacilityPatientStatsHistory
exclude = (
"deleted",
"external_id",
)
read_only_fields = (
"id",
"facility",
)

def create(self, validated_data):
instance, _ = FacilityPatientStatsHistory.objects.update_or_create(
facility=validated_data["facility"],
entry_date=validated_data["entry_date"],
defaults={**validated_data, "deleted": False},
)
return instance


class PatientSearchSerializer(serializers.ModelSerializer):
gender = ChoiceField(choices=GENDER_CHOICES)
patient_id = serializers.UUIDField(source="external_id", read_only=True)
Expand Down
24 changes: 0 additions & 24 deletions care/facility/api/serializers/summary.py

This file was deleted.

6 changes: 0 additions & 6 deletions care/facility/api/viewsets/facility.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
from care.facility.models import (
Facility,
FacilityCapacity,
FacilityPatientStatsHistory,
HospitalDoctors,
)
from care.facility.models.facility import FacilityHubSpoke, FacilityUser
Expand Down Expand Up @@ -134,11 +133,6 @@ def list(self, request, *args, **kwargs):
elif self.FACILITY_DOCTORS_CSV_KEY in request.GET:
mapping.update(HospitalDoctors.CSV_RELATED_MAPPING.copy())
pretty_mapping.update(HospitalDoctors.CSV_MAKE_PRETTY.copy())
elif self.FACILITY_TRIAGE_CSV_KEY in request.GET:
mapping.update(FacilityPatientStatsHistory.CSV_RELATED_MAPPING.copy())
pretty_mapping.update(
FacilityPatientStatsHistory.CSV_MAKE_PRETTY.copy()
)
queryset = self.filter_queryset(self.get_queryset()).values(*mapping.keys())
return render_to_csv_response(
queryset, field_header_map=mapping, field_serializer_map=pretty_mapping
Expand Down
60 changes: 1 addition & 59 deletions care/facility/api/viewsets/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
from drf_spectacular.utils import extend_schema, extend_schema_view
from dry_rest_permissions.generics import DRYPermissionFiltersBase, DRYPermissions
from rest_framework import filters as rest_framework_filters
from rest_framework import mixins, serializers, status, viewsets
from rest_framework import mixins, serializers, status
from rest_framework.decorators import action
from rest_framework.exceptions import ValidationError
from rest_framework.filters import BaseFilterBackend
Expand All @@ -40,7 +40,6 @@
from rest_framework.viewsets import GenericViewSet

from care.facility.api.serializers.patient import (
FacilityPatientStatsHistorySerializer,
PatientDetailSerializer,
PatientListSerializer,
PatientNotesEditSerializer,
Expand All @@ -58,7 +57,6 @@
BedTypeChoices,
DailyRound,
Facility,
FacilityPatientStatsHistory,
PatientNotes,
PatientNoteThreadChoices,
PatientRegistration,
Expand Down Expand Up @@ -730,62 +728,6 @@ def get_queryset(self) -> QuerySet:
)


class FacilityPatientStatsHistoryFilterSet(filters.FilterSet):
entry_date = filters.DateFromToRangeFilter(field_name="entry_date")


class FacilityPatientStatsHistoryViewSet(viewsets.ModelViewSet):
lookup_field = "external_id"
permission_classes = (IsAuthenticated, DRYPermissions)
queryset = FacilityPatientStatsHistory.objects.filter(
facility__deleted=False
).order_by("-entry_date")
serializer_class = FacilityPatientStatsHistorySerializer
filter_backends = (filters.DjangoFilterBackend,)
filterset_class = FacilityPatientStatsHistoryFilterSet
http_method_names = ["get", "post", "delete"]

def get_queryset(self):
user = self.request.user
queryset = self.queryset.filter(
facility__external_id=self.kwargs.get("facility_external_id")
)
if user.is_superuser:
return queryset
if self.request.user.user_type >= User.TYPE_VALUE_MAP["StateLabAdmin"]:
return queryset.filter(facility__state=user.state)
if self.request.user.user_type >= User.TYPE_VALUE_MAP["DistrictLabAdmin"]:
return queryset.filter(facility__district=user.district)
return queryset.filter(facility__users__id__exact=user.id)

def get_object(self):
return get_object_or_404(
self.get_queryset(), external_id=self.kwargs.get("external_id")
)

def get_facility(self):
facility_qs = Facility.objects.filter(
external_id=self.kwargs.get("facility_external_id")
)
if not self.request.user.is_superuser:
facility_qs.filter(users__id__exact=self.request.user.id)
return get_object_or_404(facility_qs)

def perform_create(self, serializer):
return serializer.save(facility=self.get_facility())

def list(self, request, *args, **kwargs):
"""
Patient Stats - List

Available Filters
- entry_date_before: date in YYYY-MM-DD format, inclusive of this date
- entry_date_before: date in YYYY-MM-DD format, inclusive of this date

"""
return super().list(request, *args, **kwargs)


class PatientSearchSetPagination(PageNumberPagination):
page_size = 200

Expand Down
126 changes: 0 additions & 126 deletions care/facility/api/viewsets/summary.py

This file was deleted.

25 changes: 0 additions & 25 deletions care/facility/management/commands/summarize.py

This file was deleted.

Loading
Loading