diff --git a/care/abdm/utils/fhir.py b/care/abdm/utils/fhir.py index 3ea9a0f9ac..d862f079fe 100644 --- a/care/abdm/utils/fhir.py +++ b/care/abdm/utils/fhir.py @@ -212,7 +212,7 @@ def _careplan(self): title="Care Plan", description="This includes Treatment Summary, Prescribed Medication, General Notes and Special Instructions", period=Period( - start=self.consultation.admission_date.isoformat(), + start=self.consultation.encounter_date.isoformat(), end=self.consultation.discharge_date.isoformat() if self.consultation.discharge_date else None, @@ -355,7 +355,7 @@ def _encounter(self, include_diagnosis=False): id = str(self.consultation.external_id) status = "finished" if self.consultation.discharge_date else "in-progress" - period_start = self.consultation.admission_date.isoformat() + period_start = self.consultation.encounter_date.isoformat() period_end = ( self.consultation.discharge_date.isoformat() if self.consultation.discharge_date @@ -463,7 +463,7 @@ def _medication(self, name): def _medication_request(self, medicine): id = str(uuid()) prescription_date = ( - self.consultation.admission_date.isoformat() + self.consultation.encounter_date.isoformat() ) # TODO: change to the time of prescription status = "unknown" # TODO: get correct status active | on-hold | cancelled | completed | entered-in-error | stopped | draft | unknown dosage_text = f"{medicine['dosage_new']} / {medicine['dosage']} for {medicine['days']} days" diff --git a/care/facility/api/serializers/bed.py b/care/facility/api/serializers/bed.py index 383c208862..832a0a01dd 100644 --- a/care/facility/api/serializers/bed.py +++ b/care/facility/api/serializers/bed.py @@ -235,10 +235,7 @@ def validate(self, attrs): raise ValidationError( {"end_date": "End date cannot be before the start date"} ) - if ( - consultation.admission_date - and consultation.admission_date > current_start_date - ): + if consultation.encounter_date > current_start_date: raise ValidationError( {"start_date": "Start date cannot be before the admission date"} ) diff --git a/care/facility/api/serializers/patient_consultation.py b/care/facility/api/serializers/patient_consultation.py index b8f869015b..712d85882d 100644 --- a/care/facility/api/serializers/patient_consultation.py +++ b/care/facility/api/serializers/patient_consultation.py @@ -367,7 +367,7 @@ def create(self, validated_data): and last_consultation.suggestion == SuggestionChoices.A and last_consultation.discharge_date and last_consultation.discharge_date + timedelta(days=30) - > consultation.admission_date + > consultation.encounter_date ): consultation.is_readmission = True consultation.save() @@ -473,6 +473,13 @@ def validate_create_diagnoses(self, value): return value + def validate_encounter_date(self, value): + if value > now(): + raise ValidationError( + {"encounter_date": "This field value cannot be in the future."} + ) + return value + def validate(self, attrs): validated = super().validate(attrs) # TODO Add Bed Authorisation Validation @@ -524,17 +531,6 @@ def validate(self, attrs): validated["referred_to"] = None elif validated.get("referred_to"): validated["referred_to_external"] = None - if validated["suggestion"] is SuggestionChoices.A: - if not validated.get("admission_date"): - raise ValidationError( - { - "admission_date": "This field is required as the patient has been admitted." - } - ) - if validated["admission_date"] > now(): - raise ValidationError( - {"admission_date": "This field value cannot be in the future."} - ) if "action" in validated: if validated["action"] == PatientRegistration.ActionEnum.REVIEW: @@ -634,13 +630,10 @@ def validate(self, attrs): raise ValidationError( {"death_datetime": "This field value cannot be in the future."} ) - if ( - self.instance.admission_date - and attrs.get("death_datetime") < self.instance.admission_date - ): + if attrs.get("death_datetime") < self.instance.encounter_date: raise ValidationError( { - "death_datetime": "This field value cannot be before the admission date." + "death_datetime": "This field value cannot be before the encounter date." } ) if not attrs.get("death_confirmed_doctor"): @@ -654,13 +647,10 @@ def validate(self, attrs): raise ValidationError( {"discharge_date": "This field value cannot be in the future."} ) - elif ( - self.instance.admission_date - and attrs.get("discharge_date") < self.instance.admission_date - ): + elif attrs.get("discharge_date") < self.instance.encounter_date: raise ValidationError( { - "discharge_date": "This field value cannot be before the admission date." + "discharge_date": "This field value cannot be before the encounter date." } ) return attrs diff --git a/care/facility/api/viewsets/patient.py b/care/facility/api/viewsets/patient.py index 2f3caeb08a..982b3d18b8 100644 --- a/care/facility/api/viewsets/patient.py +++ b/care/facility/api/viewsets/patient.py @@ -139,8 +139,8 @@ def filter_by_category(self, queryset, name, value): last_consultation_kasp_enabled_date = filters.DateFromToRangeFilter( field_name="last_consultation__kasp_enabled_date" ) - last_consultation_admission_date = filters.DateFromToRangeFilter( - field_name="last_consultation__admission_date" + last_consultation_encounter_date = filters.DateFromToRangeFilter( + field_name="last_consultation__encounter_date" ) last_consultation_discharge_date = filters.DateFromToRangeFilter( field_name="last_consultation__discharge_date" @@ -332,7 +332,7 @@ class PatientViewSet( "date_declared_positive", "date_of_result", "last_vaccinated_date", - "last_consultation_admission_date", + "last_consultation_encounter_date", "last_consultation_discharge_date", "last_consultation_symptoms_onset_date", ] diff --git a/care/facility/migrations/0403_rename_admission_date_to_encounter_date_and_more.py b/care/facility/migrations/0403_rename_admission_date_to_encounter_date_and_more.py new file mode 100644 index 0000000000..6436c20cad --- /dev/null +++ b/care/facility/migrations/0403_rename_admission_date_to_encounter_date_and_more.py @@ -0,0 +1,70 @@ +# Generated by Django 4.2.5 on 2023-11-27 07:00 + +import django.utils.timezone +from django.db import migrations, models +from django.db.models import F + + +class Migration(migrations.Migration): + dependencies = [ + ("facility", "0402_patientconsultation_new_discharge_reason"), + ] + + def clean_encounter_date(apps, schema_editor): + PatientConsultation = apps.get_model("facility", "PatientConsultation") + + # Set `encounter_date` to `created_date` for all consultations with + # suggestions that are not Admission, Domiciliary Care. + # + # Reason: + # We were not capturing `admission_date` (now `encounter_date`) for + # these consultations earlier, but could still be set by mistake. + # + # Example: + # Edit Consultation allowed changing suggestion to non Admission/Domiciliary Care + # without clearing `admission_date` (now `encounter_date`). + PatientConsultation.objects.exclude(suggestion__in=["A", "DC"]).update( + encounter_date=F("created_date") + ) + + # Set `encounter_date` to `created_date` for all consultations with + # `encounter_date` as `null`. + # + # Reason: + # We were not capturing `encounter_date` for these consultations as + # it was not set for these. + PatientConsultation.objects.filter(encounter_date=None).update( + encounter_date=F("created_date") + ) + + def reverse_clean_encounter_date(apps, schema_editor): + PatientConsultation = apps.get_model("facility", "PatientConsultation") + + # Set `encounter_date` to `null` for all consultations with suggestions + # that are not Admission/Domiciliary Care. + PatientConsultation.objects.exclude(suggestion__in=["A", "DC"]).update( + encounter_date=None + ) + + operations = [ + migrations.RemoveConstraint( + model_name="patientconsultation", + name="if_admitted", + ), + migrations.RenameField( + model_name="patientconsultation", + old_name="admission_date", + new_name="encounter_date", + ), + migrations.RunPython( + clean_encounter_date, + reverse_code=reverse_clean_encounter_date, + ), + migrations.AlterField( + model_name="patientconsultation", + name="encounter_date", + field=models.DateTimeField( + db_index=True, default=django.utils.timezone.now + ), + ), + ] diff --git a/care/facility/models/patient_consultation.py b/care/facility/models/patient_consultation.py index 451504cea9..06cd0e222f 100644 --- a/care/facility/models/patient_consultation.py +++ b/care/facility/models/patient_consultation.py @@ -2,6 +2,7 @@ from django.core.validators import MinValueValidator 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 @@ -127,7 +128,7 @@ class PatientConsultation(PatientBaseModel, ConsultationRelatedPermissionMixin): referred_by_external = models.TextField(default="", null=True, blank=True) is_readmission = models.BooleanField(default=False) admitted = models.BooleanField(default=False) # Deprecated - admission_date = models.DateTimeField(null=True, blank=True) # Deprecated + encounter_date = models.DateTimeField(default=timezone.now, db_index=True) icu_admission_date = models.DateTimeField(null=True, blank=True) discharge_date = models.DateTimeField(null=True, blank=True) discharge_reason = models.CharField( @@ -236,7 +237,7 @@ def get_related_consultation(self): CSV_MAPPING = { "consultation_created_date": "Date of Consultation", - "admission_date": "Date of Admission", + "encounter_date": "Date of Admission", "symptoms_onset_date": "Date of Onset of Symptoms", "symptoms": "Symptoms at time of consultation", "deprecated_covid_category": "Covid Category", @@ -256,7 +257,7 @@ def get_related_consultation(self): } # CSV_DATATYPE_DEFAULT_MAPPING = { - # "admission_date": (None, models.DateTimeField(),), + # "encounter_date": (None, models.DateTimeField(),), # "symptoms_onset_date": (None, models.DateTimeField(),), # "symptoms": ("-", models.CharField(),), # "category": ("-", models.CharField(),), @@ -286,10 +287,6 @@ class Meta: | models.Q(referred_to__isnull=False) | models.Q(referred_to_external__isnull=False), ), - models.CheckConstraint( - name="if_admitted", - check=models.Q(admitted=False) | models.Q(admission_date__isnull=False), - ), ] @staticmethod diff --git a/care/facility/models/patient_icmr.py b/care/facility/models/patient_icmr.py index e2f0ac9752..5d33c25ed3 100644 --- a/care/facility/models/patient_icmr.py +++ b/care/facility/models/patient_icmr.py @@ -179,8 +179,8 @@ def lab_pincode(self): @property def hospitalization_date(self): return ( - self.consultation.admission_date.date() - if self.consultation and self.consultation.admission_date + self.consultation.encounter_date.date() + if self.consultation and self.consultation.encounter_date else None ) diff --git a/care/facility/tests/test_consultation_bed_api.py b/care/facility/tests/test_consultation_bed_api.py index 99962277db..1b87099bcb 100644 --- a/care/facility/tests/test_consultation_bed_api.py +++ b/care/facility/tests/test_consultation_bed_api.py @@ -242,8 +242,8 @@ def test_start_date_before_end_date(self): {"end_date": ["End date cannot be before the start date"]}, ) - def test_start_date_before_consultation_admission_date(self): - self.consultation.admission_date = timezone.now() + def test_start_date_before_consultation_encounter_date(self): + self.consultation.encounter_date = timezone.now() self.consultation.save() response = self.client.post( "/api/v1/consultationbed/", diff --git a/care/facility/tests/test_patient_api.py b/care/facility/tests/test_patient_api.py index 9272f8fd55..da621e6b28 100644 --- a/care/facility/tests/test_patient_api.py +++ b/care/facility/tests/test_patient_api.py @@ -104,7 +104,7 @@ def setUpTestData(cls) -> None: facility=cls.facility, created_by=cls.user, suggestion="A", - admission_date=now(), + encounter_date=now(), ) def setUp(self): @@ -235,7 +235,7 @@ def setUpTestData(cls): facility=cls.facility, created_by=cls.user, suggestion="A", - admission_date=now(), + encounter_date=now(), ) cls.bed = cls.create_bed(cls.facility, cls.location) cls.consultation_bed = cls.create_consultation_bed(cls.consultation, cls.bed) @@ -287,7 +287,7 @@ def setUpTestData(cls): facility=cls.facility, created_by=cls.user, suggestion="A", - admission_date=now(), + encounter_date=now(), discharge_date=None, # Patient is currently admitted discharge_reason=None, ) diff --git a/care/facility/tests/test_patient_consultation_api.py b/care/facility/tests/test_patient_consultation_api.py index e5921283db..37ad1a702b 100644 --- a/care/facility/tests/test_patient_consultation_api.py +++ b/care/facility/tests/test_patient_consultation_api.py @@ -100,19 +100,16 @@ def discharge(self, consultation, **kwargs): ) def test_create_consultation_treating_physician_invalid_user(self): - consultation = self.create_admission_consultation( - suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), - ) + consultation = self.create_admission_consultation(suggestion="A") res = self.update_consultation( - consultation, treating_physician=self.doctor.id, suggestion="A" + consultation, treating_physician=self.user.id, suggestion="A" ) self.assertEqual(res.status_code, status.HTTP_400_BAD_REQUEST) def test_discharge_as_recovered_preadmission(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -125,7 +122,7 @@ def test_discharge_as_recovered_preadmission(self): def test_discharge_as_recovered_future(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -138,7 +135,7 @@ def test_discharge_as_recovered_future(self): def test_discharge_as_recovered_after_admission(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -151,7 +148,7 @@ def test_discharge_as_recovered_after_admission(self): def test_discharge_as_expired_pre_admission(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -165,7 +162,7 @@ def test_discharge_as_expired_pre_admission(self): def test_discharge_as_expired_future(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -179,7 +176,7 @@ def test_discharge_as_expired_future(self): def test_discharge_as_expired_after_admission(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -194,7 +191,7 @@ def test_discharge_as_expired_after_admission(self): def test_discharge_as_recovered_with_expired_fields(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2023, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2023, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -212,7 +209,7 @@ def test_discharge_as_recovered_with_expired_fields(self): def test_referred_to_external_null(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -226,7 +223,7 @@ def test_referred_to_external_null(self): def test_referred_to_external_empty_string(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -240,7 +237,7 @@ def test_referred_to_external_empty_string(self): def test_referred_to_empty_facility(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -254,7 +251,7 @@ def test_referred_to_empty_facility(self): def test_referred_to_and_external_together(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -269,7 +266,7 @@ def test_referred_to_and_external_together(self): def test_referred_to_valid_value(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) referred_to_external = "Test Hospital" res = self.discharge( @@ -283,7 +280,7 @@ def test_referred_to_valid_value(self): def test_referred_to_external_valid_value(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) referred_to_external = "Test Hospital" res = self.discharge( @@ -332,6 +329,7 @@ def test_route_to_facility_transfer_within_facility(self): def test_medico_legal_case(self): consultation = self.create_admission_consultation( medico_legal_case=True, + encounter_date=make_aware(datetime.datetime(2023, 4, 1, 15, 30, 00)), ) url = self.get_url(consultation) @@ -365,7 +363,7 @@ def test_medico_legal_case(self): def test_update_consultation_after_discharge(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.discharge( consultation, @@ -383,7 +381,7 @@ def test_update_consultation_after_discharge(self): def test_add_diagnoses_and_duplicate_diagnoses(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) diagnosis = ICD11Diagnosis.objects.all()[0].id res = self.add_diagnosis( @@ -404,7 +402,7 @@ def test_add_diagnoses_and_duplicate_diagnoses(self): def test_add_diagnosis_inactive(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) diagnosis = ICD11Diagnosis.objects.first().id res = self.add_diagnosis( @@ -425,7 +423,7 @@ def test_add_diagnosis_inactive(self): def mark_inactive_diagnosis_as_principal(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) diagnosis = ICD11Diagnosis.objects.first().id res = self.add_diagnosis( @@ -451,7 +449,7 @@ def mark_inactive_diagnosis_as_principal(self): def test_change_diagnosis(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.add_diagnosis( consultation, @@ -472,7 +470,7 @@ def test_change_diagnosis(self): def test_add_multiple_principal_diagnosis(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.add_diagnosis( consultation, @@ -492,7 +490,7 @@ def test_add_multiple_principal_diagnosis(self): def test_add_principal_edit_as_inactive_add_principal(self): consultation = self.create_admission_consultation( suggestion="A", - admission_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), + encounter_date=make_aware(datetime.datetime(2020, 4, 1, 15, 30, 00)), ) res = self.add_diagnosis( consultation, diff --git a/care/templates/reports/patient_discharge_summary_pdf.html b/care/templates/reports/patient_discharge_summary_pdf.html index 6e1aaa6a31..8f8ae45cd0 100644 --- a/care/templates/reports/patient_discharge_summary_pdf.html +++ b/care/templates/reports/patient_discharge_summary_pdf.html @@ -87,7 +87,7 @@
Date of addmission: - {{consultation.admission_date.date}} + {{consultation.encounter_date}}
{% elif consultation.suggestion == 'R' %}diff --git a/care/utils/tests/test_utils.py b/care/utils/tests/test_utils.py index b6cb59132c..1a960ef452 100644 --- a/care/utils/tests/test_utils.py +++ b/care/utils/tests/test_utils.py @@ -309,7 +309,7 @@ def get_consultation_data(cls): "treatment_plan": "treatment_plan", "suggestion": PatientConsultation.SUGGESTION_CHOICES[0][0], "referred_to": None, - "admission_date": None, + "encounter_date": make_aware(datetime(2020, 4, 7, 15, 30)), "discharge_date": None, "consultation_notes": "", "course_in_facility": "", diff --git a/data/dummy/facility.json b/data/dummy/facility.json index e7b6e00366..4b595af39d 100644 --- a/data/dummy/facility.json +++ b/data/dummy/facility.json @@ -1958,7 +1958,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-01T08:35:00Z", + "encounter_date": "2023-12-01T08:35:00Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2028,7 +2028,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:33:03.700Z", + "encounter_date": "2023-12-06T08:33:03.700Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2098,7 +2098,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:39:29.394Z", + "encounter_date": "2023-12-06T08:39:29.394Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2168,7 +2168,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:42:10.532Z", + "encounter_date": "2023-12-06T08:42:10.532Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2238,7 +2238,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:42:33.614Z", + "encounter_date": "2023-12-06T08:42:33.614Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2308,7 +2308,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:42:56.180Z", + "encounter_date": "2023-12-06T08:42:56.180Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2378,7 +2378,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:43:18.480Z", + "encounter_date": "2023-12-06T08:43:18.480Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2448,7 +2448,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:43:41.540Z", + "encounter_date": "2023-12-06T08:43:41.540Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2518,7 +2518,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:44:05.398Z", + "encounter_date": "2023-12-06T08:44:05.398Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2588,7 +2588,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:44:28.550Z", + "encounter_date": "2023-12-06T08:44:28.550Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2658,7 +2658,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:44:51.239Z", + "encounter_date": "2023-12-06T08:44:51.239Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2728,7 +2728,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:45:13.721Z", + "encounter_date": "2023-12-06T08:45:13.721Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2798,7 +2798,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:45:37.972Z", + "encounter_date": "2023-12-06T08:45:37.972Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2868,7 +2868,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:46:00.645Z", + "encounter_date": "2023-12-06T08:46:00.645Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -2938,7 +2938,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:46:23.492Z", + "encounter_date": "2023-12-06T08:46:23.492Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -3008,7 +3008,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:46:46.028Z", + "encounter_date": "2023-12-06T08:46:46.028Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -3078,7 +3078,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:47:11.141Z", + "encounter_date": "2023-12-06T08:47:11.141Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null, @@ -3148,7 +3148,7 @@ "referred_by_external": "", "is_readmission": false, "admitted": true, - "admission_date": "2023-12-06T08:47:34.395Z", + "encounter_date": "2023-12-06T08:47:34.395Z", "icu_admission_date": null, "discharge_date": null, "discharge_reason": null,