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

Add difficulty_breathing field to covid19 triage #316

Merged
Merged
Show file tree
Hide file tree
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
34 changes: 34 additions & 0 deletions eventstore/migrations/0025_add_difficulty_breathing.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Generated by Django 2.2.8 on 2020-04-07 14:55

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [("eventstore", "0024_auto_20200407_1242")]

operations = [
migrations.AddField(
model_name="covid19triage",
name="difficulty_breathing",
field=models.BooleanField(blank=True, default=None, null=True),
),
migrations.AlterField(
model_name="covid19triage",
name="province",
field=models.CharField(
choices=[
("ZA-EC", "Eastern Cape"),
("ZA-FS", "Free State"),
("ZA-GT", "Gauteng"),
("ZA-LP", "Limpopo"),
("ZA-MP", "Mpumalanga"),
("ZA-NC", "Northern Cape"),
("ZA-NL", "Kwazulu-Natal"),
("ZA-NW", "North-West (South Africa)"),
("ZA-WC", "Western Cape"),
],
max_length=6,
),
),
]
3 changes: 2 additions & 1 deletion eventstore/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -388,7 +388,7 @@ class Covid19Triage(models.Model):
(AGE_O65, AGE_O65),
)

PROVINCE_CHOICES = tuple(
PROVINCE_CHOICES = sorted(
(s.code, s.name) for s in pycountry.subdivisions.get(country_code="ZA")
)

Expand Down Expand Up @@ -421,6 +421,7 @@ class Covid19Triage(models.Model):
fever = models.BooleanField()
cough = models.BooleanField()
sore_throat = models.BooleanField()
difficulty_breathing = models.BooleanField(null=True, blank=True, default=None)
exposure = models.CharField(max_length=9, choices=EXPOSURE_CHOICES)
tracing = models.BooleanField(help_text="Whether the NDoH can contact the user")
risk = models.CharField(max_length=8, choices=RISK_CHOICES)
Expand Down
2 changes: 2 additions & 0 deletions eventstore/test_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -1517,6 +1517,7 @@ def test_successful_request(self):
"tracing": True,
"risk": Covid19Triage.RISK_LOW,
},
format="json",
)
self.assertEqual(response.status_code, status.HTTP_201_CREATED)
[covid19triage] = Covid19Triage.objects.all()
Expand All @@ -1528,6 +1529,7 @@ def test_successful_request(self):
self.assertEqual(covid19triage.fever, False)
self.assertEqual(covid19triage.cough, False)
self.assertEqual(covid19triage.sore_throat, False)
self.assertEqual(covid19triage.difficulty_breathing, None)
self.assertEqual(covid19triage.exposure, Covid19Triage.EXPOSURE_NO)
self.assertEqual(covid19triage.tracing, True)
self.assertEqual(covid19triage.risk, Covid19Triage.RISK_LOW)
Expand Down