Skip to content

Commit

Permalink
remove HBA1C field from consultation model
Browse files Browse the repository at this point in the history
Fixes #1200
  • Loading branch information
sainak committed May 23, 2023
1 parent f613661 commit 69b69ab
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
17 changes: 17 additions & 0 deletions care/facility/migrations/0356_remove_patientconsultation_hba1c.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 2.2.11 on 2023-05-23 10:57

from django.db import migrations, models


class Migration(migrations.Migration):

dependencies = [
('facility', '0355_auto_20230512_1122'),
]

operations = [
migrations.RemoveField(
model_name='patientconsultation',
name='HBA1C',
)
]
6 changes: 0 additions & 6 deletions care/facility/models/patient_consultation.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,12 +167,6 @@ class PatientConsultation(PatientBaseModel, PatientRelatedPermissionMixin):
verbose_name="Patient's Weight in KG",
validators=[MinValueValidator(0)],
)
HBA1C = models.FloatField(
default=None,
null=True,
verbose_name="HBA1C parameter for reference to current blood sugar levels",
validators=[MinValueValidator(0)],
)

# ICU Information

Expand Down
16 changes: 11 additions & 5 deletions care/users/management/commands/populate_investigations.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
from django.core.management import BaseCommand

from care.facility.models.patient_investigation import PatientInvestigation, PatientInvestigationGroup
from care.facility.models.patient_investigation import (
PatientInvestigation,
PatientInvestigationGroup,
)

# TODO Move the Investigations and Investigation Groups into a proper JSON like python dict structure to allow easy updates and additions.
investigations = """name unit ideal min max type (Float/String/Choice) choices category_id
Expand Down Expand Up @@ -62,7 +65,6 @@
GCT mg/dl < 140 mg/dl 0 140 Float 2
GTT mg/dl 140-200 mg/dl 140 200 Float 2
GGT U/L 11-50 U/L 11 50 Float 2
HbA1C % 4-5.6 % 4 5.6 Float 2
Serum Copper mcg/dl 85-180 mcg/dl 85 180 Float 2
Serum Lead mcg/dl upto 10 mcg/dl 0 10 Float 2
Iron mcg/dl 60-170 mcg/dl 60 170 Float 2
Expand Down Expand Up @@ -139,7 +141,7 @@


investigation_groups = """Id Name
1 Haematology
1 Haematology
2 Biochemistry test
3 Urine Test"""

Expand All @@ -162,9 +164,13 @@ def handle(self, *args, **options):
investigation_group_dict = {}
for investigation_group in investigation_group_data:
current_investigation_group = investigation_group.split("\t")
current_obj = PatientInvestigationGroup.objects.filter(name=current_investigation_group[1]).first()
current_obj = PatientInvestigationGroup.objects.filter(
name=current_investigation_group[1]
).first()
if not current_obj:
current_obj = PatientInvestigationGroup(name=current_investigation_group[1])
current_obj = PatientInvestigationGroup(
name=current_investigation_group[1]
)
current_obj.save()
investigation_group_dict[current_investigation_group[0]] = current_obj
investigation_data = investigations.split("\n")[1:]
Expand Down
1 change: 0 additions & 1 deletion data/dummy/facility.json
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,6 @@
"current_bed": null,
"height": 0.0,
"weight": 0.0,
"HBA1C": null,
"operation": null,
"special_instruction": "",
"intubation_history": []
Expand Down

0 comments on commit 69b69ab

Please sign in to comment.