Skip to content

Commit

Permalink
Renamed patient category labels (#2187)
Browse files Browse the repository at this point in the history
* rename patient category labels

* rename the categories in the events

* rename categories for patient_category events
  • Loading branch information
khavinshankar authored May 22, 2024
1 parent 5c715f8 commit ba98656
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Generated by Django 4.2.10 on 2024-05-21 12:29

from django.db import migrations, models


class Migration(migrations.Migration):
def rename_categories_in_events(apps, schema_editor):
PatientConsultationEvent = apps.get_model(
"facility", "PatientConsultationEvent"
)

PatientConsultationEvent.objects.filter(
event_type__name="CATEGORY", value__category="Stable"
).update(value={"category": "Mild"})
PatientConsultationEvent.objects.filter(
event_type__name="PATIENT_CATEGORY", value__category="Stable"
).update(value={"patient_category": "Mild"})
PatientConsultationEvent.objects.filter(
event_type__name="CATEGORY", value__category="Abnormal"
).update(value={"category": "Moderate"})
PatientConsultationEvent.objects.filter(
event_type__name="PATIENT_CATEGORY", value__category="Abnormal"
).update(value={"patient_category": "Moderate"})

dependencies = [
("facility", "0437_alter_dailyround_rounds_type"),
]

operations = [
migrations.AlterField(
model_name="dailyround",
name="patient_category",
field=models.CharField(
choices=[
("Comfort", "Comfort Care"),
("Stable", "Mild"),
("Moderate", "Moderate"),
("Critical", "Critical"),
],
max_length=8,
null=True,
),
),
migrations.AlterField(
model_name="patientconsultation",
name="category",
field=models.CharField(
choices=[
("Comfort", "Comfort Care"),
("Stable", "Mild"),
("Moderate", "Moderate"),
("Critical", "Critical"),
],
max_length=8,
null=True,
),
),
]
4 changes: 2 additions & 2 deletions care/facility/models/patient_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,8 +70,8 @@ def reverse_choices(choices):

CATEGORY_CHOICES = [
("Comfort", "Comfort Care"),
("Stable", "Stable"),
("Moderate", "Abnormal"),
("Stable", "Mild"),
("Moderate", "Moderate"),
("Critical", "Critical"),
]

Expand Down

0 comments on commit ba98656

Please sign in to comment.