Skip to content

Commit

Permalink
Adds support for "Doctors Log Update" round type (#2173)
Browse files Browse the repository at this point in the history
* Adds support for "Doctors Log Update" round type

* add tests
  • Loading branch information
rithviknishad authored May 20, 2024
1 parent 89078bc commit 01c4aa0
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 0 deletions.
27 changes: 27 additions & 0 deletions care/facility/migrations/0437_alter_dailyround_rounds_type.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Generated by Django 4.2.8 on 2024-05-17 04:55

from django.db import migrations, models


class Migration(migrations.Migration):
dependencies = [
("facility", "0436_remove_dailyround_temperature_measured_at"),
]

operations = [
migrations.AlterField(
model_name="dailyround",
name="rounds_type",
field=models.IntegerField(
choices=[
(0, "NORMAL"),
(50, "DOCTORS_LOG"),
(100, "VENTILATOR"),
(200, "ICU"),
(300, "AUTOMATED"),
(400, "TELEMEDICINE"),
],
default=0,
),
),
]
1 change: 1 addition & 0 deletions care/facility/models/daily_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
class DailyRound(PatientBaseModel):
class RoundsType(enum.Enum):
NORMAL = 0
DOCTORS_LOG = 50
VENTILATOR = 100
ICU = 200
AUTOMATED = 300
Expand Down
7 changes: 7 additions & 0 deletions care/facility/tests/test_patient_daily_rounds_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,3 +95,10 @@ def test_log_update_without_bed_for_domiciliary(
format="json",
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)

def test_doctors_log_update(self):
response = self.client.post(
f"/api/v1/consultation/{self.consultation_with_bed.external_id}/daily_rounds/",
data={**self.log_update, "rounds_type": "DOCTORS_LOG"},
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)

0 comments on commit 01c4aa0

Please sign in to comment.