diff --git a/care/facility/migrations/0438_alter_dailyround_patient_category_and_more.py b/care/facility/migrations/0438_alter_dailyround_patient_category_and_more.py index b0b36d615d..21e0f961d7 100644 --- a/care/facility/migrations/0438_alter_dailyround_patient_category_and_more.py +++ b/care/facility/migrations/0438_alter_dailyround_patient_category_and_more.py @@ -4,6 +4,18 @@ 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="CATEGORY", value__category="Abnormal" + ).update(value={"category": "Moderate"}) + dependencies = [ ("facility", "0437_alter_dailyround_rounds_type"), ]