From b59c57002c9b9cf65f0bde2a062c6c7966b49764 Mon Sep 17 00:00:00 2001 From: Vignesh Hari Date: Sun, 30 Aug 2020 11:23:22 +0530 Subject: [PATCH] Added Ward for patient --- .../migrations/0167_auto_20200830_1121.py | 23 +++++++++++++++++++ care/facility/models/patient.py | 2 ++ 2 files changed, 25 insertions(+) create mode 100644 care/facility/migrations/0167_auto_20200830_1121.py diff --git a/care/facility/migrations/0167_auto_20200830_1121.py b/care/facility/migrations/0167_auto_20200830_1121.py new file mode 100644 index 0000000000..dd9e582659 --- /dev/null +++ b/care/facility/migrations/0167_auto_20200830_1121.py @@ -0,0 +1,23 @@ +# Generated by Django 2.2.11 on 2020-08-30 05:51 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('facility', '0166_auto_20200815_1930'), + ] + + operations = [ + migrations.AddField( + model_name='historicalpatientregistration', + name='ward', + field=models.CharField(default='', max_length=255, verbose_name='Ward of Patient'), + ), + migrations.AddField( + model_name='patientregistration', + name='ward', + field=models.CharField(default='', max_length=255, verbose_name='Ward of Patient'), + ), + ] diff --git a/care/facility/models/patient.py b/care/facility/models/patient.py index 049d100f16..2d0fdaab4a 100644 --- a/care/facility/models/patient.py +++ b/care/facility/models/patient.py @@ -128,6 +128,7 @@ class ActionEnum(enum.Enum): is_antenatal = models.BooleanField(default=False, verbose_name="Does the patient require Prenatal Care ?") + ward = models.CharField(max_length=255, default="", verbose_name="Ward of Patient", blank=False) local_body = models.ForeignKey(LocalBody, on_delete=models.SET_NULL, null=True, blank=True) district = models.ForeignKey(District, on_delete=models.SET_NULL, null=True, blank=True) state = models.ForeignKey(State, on_delete=models.SET_NULL, null=True, blank=True) @@ -254,6 +255,7 @@ def save(self, *args, **kwargs) -> None: # "nearest_facility__name": "Nearest Facility", "age": "Age", "gender": "Gender", + "ward": "Ward", "local_body__name": "Local Body", "district__name": "District", "state__name": "State",