diff --git a/care/facility/api/viewsets/patient.py b/care/facility/api/viewsets/patient.py index 7287cd52e4..6ac7f960d2 100644 --- a/care/facility/api/viewsets/patient.py +++ b/care/facility/api/viewsets/patient.py @@ -285,7 +285,6 @@ def filter_by_diagnoses(self, queryset, name, value): ) def filter_by_has_consents(self, queryset, name, value: str): - if not value: return queryset @@ -805,7 +804,7 @@ class PatientSearchViewSet(ListModelMixin, GenericViewSet): "facility", "allow_transfer", "is_active", - ) + ).order_by("id") serializer_class = PatientSearchSerializer permission_classes = (IsAuthenticated, DRYPermissions) pagination_class = PatientSearchSetPagination diff --git a/care/facility/models/daily_round.py b/care/facility/models/daily_round.py index 6904809f84..ddfb409cd1 100644 --- a/care/facility/models/daily_round.py +++ b/care/facility/models/daily_round.py @@ -1,3 +1,5 @@ +from decimal import Decimal + from django.core.validators import MaxValueValidator, MinValueValidator from django.db import models from django.db.models import JSONField @@ -158,7 +160,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(95), MaxValueValidator(106)], + validators=[MinValueValidator(Decimal(95)), MaxValueValidator(Decimal(106))], ) spo2 = models.DecimalField( max_digits=4, decimal_places=2, blank=True, null=True, default=None @@ -324,7 +326,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(0), MaxValueValidator(30)], + validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(30))], ) ventilator_pip = models.IntegerField( default=None, @@ -395,7 +397,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(0), MaxValueValidator(10)], + validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(10))], ) pco2 = models.IntegerField( default=None, @@ -413,7 +415,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(5), MaxValueValidator(80)], + validators=[MinValueValidator(Decimal(5)), MaxValueValidator(Decimal(80))], ) base_excess = models.IntegerField( default=None, @@ -426,7 +428,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(0), MaxValueValidator(20)], + validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(20))], ) sodium = models.DecimalField( decimal_places=2, @@ -434,7 +436,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(100), MaxValueValidator(170)], + validators=[MinValueValidator(Decimal(100)), MaxValueValidator(Decimal(170))], ) potassium = models.DecimalField( decimal_places=2, @@ -442,7 +444,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(1), MaxValueValidator(10)], + validators=[MinValueValidator(Decimal(1)), MaxValueValidator(Decimal(10))], ) blood_sugar_level = models.IntegerField( default=None, @@ -455,7 +457,7 @@ class InsulinIntakeFrequencyType(models.IntegerChoices): blank=True, default=None, null=True, - validators=[MinValueValidator(0), MaxValueValidator(100)], + validators=[MinValueValidator(Decimal(0)), MaxValueValidator(Decimal(100))], ) insulin_intake_frequency = models.IntegerField( choices=InsulinIntakeFrequencyType.choices, diff --git a/care/facility/tests/test_pdf_generation.py b/care/facility/tests/test_pdf_generation.py index 6754c0c43a..c0c7d2fca6 100644 --- a/care/facility/tests/test_pdf_generation.py +++ b/care/facility/tests/test_pdf_generation.py @@ -103,7 +103,7 @@ def test_compile_typ(data): class TestTypstInstallation(TestCase): def test_typst_installed(self): try: - subprocess.run(["typst", "--version"], check=True) + subprocess.run(["typst", "--version"], check=True, capture_output=True) typst_installed = True except subprocess.CalledProcessError: typst_installed = False