Skip to content

Commit

Permalink
archived spo2 field to archived_spo2 (#2397)
Browse files Browse the repository at this point in the history
 archived spo2 field to archived_spo2 (#2397)

---------

Co-authored-by: Aakash Singh <[email protected]>
  • Loading branch information
DraKen0009 and sainak authored Sep 23, 2024
1 parent e6a55d7 commit b3ad350
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 12 deletions.
17 changes: 8 additions & 9 deletions care/abdm/utils/fhir.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ def _observations_from_daily_round(self, daily_round):
),
self._observation(
"SpO2",
{"value": daily_round.spo2, "unit": "%"},
{"value": daily_round.ventilator_spo2, "unit": "%"},
id,
date,
),
Expand Down Expand Up @@ -1205,17 +1205,16 @@ def create_op_consultation_record(self):
def create_record(self, record_type):
if record_type == "Prescription":
return self.create_prescription_record()
elif record_type == "WellnessRecord":
if record_type == "WellnessRecord":
return self.create_wellness_record()
elif record_type == "ImmunizationRecord":
if record_type == "ImmunizationRecord":
return self.create_immunization_record()
elif record_type == "HealthDocumentRecord":
if record_type == "HealthDocumentRecord":
return self.create_health_document_record()
elif record_type == "DiagnosticReport":
if record_type == "DiagnosticReport":
return self.create_diagnostic_report_record()
elif record_type == "DischargeSummary":
if record_type == "DischargeSummary":
return self.create_discharge_summary_record()
elif record_type == "OPConsultation":
if record_type == "OPConsultation":
return self.create_op_consultation_record()
else:
return self.create_discharge_summary_record()
return self.create_discharge_summary_record()
2 changes: 1 addition & 1 deletion care/facility/management/commands/load_event_types.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ class Command(BaseCommand):
"name": "VITALS",
"children": (
{"name": "TEMPERATURE", "fields": ("temperature",)},
{"name": "SPO2", "fields": ("spo2",)},
{"name": "PULSE", "fields": ("pulse",)},
{"name": "BLOOD_PRESSURE", "fields": ("bp",)},
{"name": "RESPIRATORY_RATE", "fields": ("resp",)},
Expand Down Expand Up @@ -268,6 +267,7 @@ class Command(BaseCommand):
"VENTILATOR_MODES",
"SYMPTOMS",
"ROUND_SYMPTOMS",
"SPO2",
)

def create_objects(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Generated by Django 5.1.1 on 2024-09-22 19:07

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("facility", "0463_patientnotes_reply_to"),
]

operations = [
migrations.RenameField(
model_name="dailyround",
old_name="spo2",
new_name="archived_spo2",
),
]
4 changes: 2 additions & 2 deletions care/facility/models/daily_round.py
Original file line number Diff line number Diff line change
Expand Up @@ -162,9 +162,9 @@ class InsulinIntakeFrequencyType(models.IntegerChoices):
null=True,
validators=[MinValueValidator(Decimal(95)), MaxValueValidator(Decimal(106))],
)
spo2 = models.DecimalField(
archived_spo2 = models.DecimalField(
max_digits=4, decimal_places=2, blank=True, null=True, default=None
)
) # Deprecated
physical_examination_info = models.TextField(null=True, blank=True)
deprecated_covid_category = models.CharField(
choices=COVID_CATEGORY_CHOICES,
Expand Down

0 comments on commit b3ad350

Please sign in to comment.