Skip to content

Commit

Permalink
remove deprecated fields that has been migrated to new models (Diagno…
Browse files Browse the repository at this point in the history
…sis, Symptoms and Prescriptions) (#2247)

* remove deprecated symptoms fields

* remove deprecated fields that has been migrated to new models

* update migrations

* rebase migrations

* rebase migrations again...

* update migrations

* update migrations

---------

Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>
  • Loading branch information
3 people authored Aug 24, 2024
1 parent 25afb1f commit e2ede2b
Show file tree
Hide file tree
Showing 5 changed files with 90 additions and 286 deletions.
4 changes: 0 additions & 4 deletions care/facility/api/serializers/patient_consultation.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,15 +204,11 @@ class Meta:
"created_by",
"kasp_enabled_date",
"is_readmission",
"deprecated_diagnosis",
"deprecated_verified_by",
)
exclude = (
"deleted",
"external_id",
"deprecated_icd11_provisional_diagnoses",
"deprecated_icd11_diagnoses",
"deprecated_icd11_principal_diagnosis",
)

def validate_bed_number(self, bed_number):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
# Generated by Django 4.2.10 on 2024-08-23 10:57

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("facility", "0451_merge_20240823_1642"),
]

operations = [
migrations.RemoveField(
model_name="patientconsultation",
name="deprecated_diagnosis",
),
migrations.RemoveField(
model_name="patientconsultation",
name="deprecated_icd11_diagnoses",
),
migrations.RemoveField(
model_name="patientconsultation",
name="deprecated_icd11_principal_diagnosis",
),
migrations.RemoveField(
model_name="patientconsultation",
name="deprecated_icd11_provisional_diagnoses",
),
migrations.RemoveField(
model_name="patientconsultation",
name="discharge_advice",
),
migrations.RemoveField(
model_name="patientconsultation",
name="discharge_prescription",
),
migrations.RemoveField(
model_name="patientconsultation",
name="discharge_prn_prescription",
),
migrations.RemoveField(
model_name="patientconsultation",
name="prn_prescription",
),
migrations.RemoveField(
model_name="dailyround",
name="deprecated_additional_symptoms",
),
migrations.RemoveField(
model_name="dailyround",
name="deprecated_other_symptoms",
),
migrations.RemoveField(
model_name="patientconsultation",
name="deprecated_other_symptoms",
),
migrations.RemoveField(
model_name="patientconsultation",
name="deprecated_symptoms",
),
migrations.RemoveField(
model_name="patientconsultation",
name="deprecated_symptoms_onset_date",
),
]
11 changes: 0 additions & 11 deletions care/facility/models/daily_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
from django.db import models
from django.db.models import JSONField
from django.shortcuts import get_object_or_404
from multiselectfield import MultiSelectField
from multiselectfield.utils import get_max_length

from care.facility.models import (
CATEGORY_CHOICES,
Expand All @@ -25,7 +23,6 @@
PAIN_SCALE_ENHANCED,
PRESSURE_SORE,
)
from care.facility.models.patient_base import SYMPTOM_CHOICES
from care.facility.models.patient_consultation import PatientConsultation
from care.users.models import User
from care.utils.models.validators import JSONFieldSchemaValidator
Expand Down Expand Up @@ -141,14 +138,6 @@ class InsulinIntakeFrequencyType(enum.Enum):
max_digits=4, decimal_places=2, blank=True, null=True, default=None
)
physical_examination_info = models.TextField(null=True, blank=True)
deprecated_additional_symptoms = MultiSelectField(
choices=SYMPTOM_CHOICES,
default=1,
null=True,
blank=True,
max_length=get_max_length(SYMPTOM_CHOICES, None),
) # Deprecated
deprecated_other_symptoms = models.TextField(default="", blank=True) # Deprecated
deprecated_covid_category = models.CharField(
choices=COVID_CATEGORY_CHOICES,
max_length=8,
Expand Down
37 changes: 0 additions & 37 deletions care/facility/models/patient_consultation.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from django.db import models
from django.db.models import JSONField
from django.utils import timezone
from multiselectfield import MultiSelectField
from multiselectfield.utils import get_max_length

from care.facility.models import (
CATEGORY_CHOICES,
Expand All @@ -20,7 +18,6 @@
NEW_DISCHARGE_REASON_CHOICES,
REVERSE_CATEGORY_CHOICES,
REVERSE_COVID_CATEGORY_CHOICES,
SYMPTOM_CHOICES,
RouteToFacility,
SuggestionChoices,
reverse_choices,
Expand Down Expand Up @@ -68,29 +65,6 @@ class PatientConsultation(PatientBaseModel, ConsultationRelatedPermissionMixin):
facility = models.ForeignKey(
"Facility", on_delete=models.CASCADE, related_name="consultations"
)
deprecated_diagnosis = models.TextField(
default="", null=True, blank=True
) # Deprecated
deprecated_icd11_provisional_diagnoses = ArrayField(
models.CharField(max_length=100), default=list, blank=True, null=True
) # Deprecated in favour of ConsultationDiagnosis M2M model
deprecated_icd11_diagnoses = ArrayField(
models.CharField(max_length=100), default=list, blank=True, null=True
) # Deprecated in favour of ConsultationDiagnosis M2M model
deprecated_icd11_principal_diagnosis = models.CharField(
max_length=100, default="", blank=True, null=True
) # Deprecated in favour of ConsultationDiagnosis M2M model
deprecated_symptoms = MultiSelectField(
choices=SYMPTOM_CHOICES,
default=1,
null=True,
blank=True,
max_length=get_max_length(SYMPTOM_CHOICES, None),
) # Deprecated
deprecated_other_symptoms = models.TextField(default="", blank=True) # Deprecated
deprecated_symptoms_onset_date = models.DateTimeField(
null=True, blank=True
) # Deprecated
deprecated_covid_category = models.CharField(
choices=COVID_CATEGORY_CHOICES,
max_length=8,
Expand Down Expand Up @@ -163,12 +137,6 @@ class PatientConsultation(PatientBaseModel, ConsultationRelatedPermissionMixin):
null=True,
)
discharge_notes = models.TextField(default="", null=True, blank=True)
discharge_prescription = JSONField(
default=dict, null=True, blank=True
) # Deprecated
discharge_prn_prescription = JSONField(
default=dict, null=True, blank=True
) # Deprecated
death_datetime = models.DateTimeField(null=True, blank=True)
death_confirmed_doctor = models.TextField(default="", null=True, blank=True)
bed_number = models.CharField(max_length=100, null=True, blank=True) # Deprecated
Expand Down Expand Up @@ -251,11 +219,6 @@ class PatientConsultation(PatientBaseModel, ConsultationRelatedPermissionMixin):

intubation_history = JSONField(default=list)

# Deprecated Fields

prn_prescription = JSONField(default=dict)
discharge_advice = JSONField(default=dict)

has_consents = ArrayField(
models.IntegerField(choices=ConsentType.choices),
default=list,
Expand Down
Loading

0 comments on commit e2ede2b

Please sign in to comment.