Skip to content

Commit

Permalink
Remove PatientTeleConsultation model (#2184)
Browse files Browse the repository at this point in the history
* Remove PatientTeleConsultation model

* Remove tele_consultation_history

* Remove @Property annotation

* update migrations

---------

Co-authored-by: Aakash Singh <[email protected]>
Co-authored-by: Vignesh Hari <[email protected]>
  • Loading branch information
3 people authored Jun 2, 2024
1 parent 2a8a783 commit ee311a1
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 36 deletions.
2 changes: 0 additions & 2 deletions care/facility/admin.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
from care.facility.models.asset import Asset
from care.facility.models.bed import AssetBed, Bed
from care.facility.models.patient_sample import PatientSample
from care.facility.models.patient_tele_consultation import PatientTeleConsultation

from .models import (
Building,
Expand Down Expand Up @@ -198,7 +197,6 @@ class FacilityUserAdmin(DjangoQLSearchMixin, admin.ModelAdmin, ExportCsvMixin):
admin.site.register(Ambulance, AmbulanceAdmin)
admin.site.register(AmbulanceDriver, AmbulanceDriverAdmin)
admin.site.register(PatientRegistration, PatientAdmin)
admin.site.register(PatientTeleConsultation)
admin.site.register(PatientSample, PatientSampleAdmin)
admin.site.register(Disease)
admin.site.register(FacilityInventoryUnit)
Expand Down
9 changes: 0 additions & 9 deletions care/facility/api/serializers/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@
)
from care.facility.models.patient_consultation import PatientConsultation
from care.facility.models.patient_external_test import PatientExternalTest
from care.facility.models.patient_tele_consultation import PatientTeleConsultation
from care.hcx.models.claim import Claim
from care.hcx.models.policy import Policy
from care.users.api.serializers.lsg import (
Expand Down Expand Up @@ -160,21 +159,13 @@ class MedicalHistorySerializer(serializers.Serializer):
disease = ChoiceField(choices=DISEASE_CHOICES)
details = serializers.CharField(required=False, allow_blank=True)

class PatientTeleConsultationSerializer(serializers.ModelSerializer):
class Meta:
model = PatientTeleConsultation
fields = "__all__"

facility = ExternalIdSerializerField(
queryset=Facility.objects.all(), required=False
)
medical_history = serializers.ListSerializer(
child=MedicalHistorySerializer(), required=False
)

tele_consultation_history = serializers.ListSerializer(
child=PatientTeleConsultationSerializer(), read_only=True
)
last_consultation = PatientConsultationSerializer(read_only=True)
facility_object = FacilitySerializer(source="facility", read_only=True)
# nearest_facility_object = FacilitySerializer(
Expand Down
15 changes: 15 additions & 0 deletions care/facility/migrations/0441_delete_patientteleconsultation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Generated by Django 4.2.10 on 2024-06-02 11:31

from django.db import migrations


class Migration(migrations.Migration):
dependencies = [
("facility", "0440_merge_20240528_1613"),
]

operations = [
migrations.DeleteModel(
name="PatientTeleConsultation",
),
]
1 change: 0 additions & 1 deletion care/facility/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
from .patient_external_test import * # noqa
from .patient_investigation import * # noqa
from .patient_sample import * # noqa
from .patient_tele_consultation import * # noqa
from .prescription import * # noqa
from .resources import * # noqa
from .shifting import * # noqa
Expand Down
4 changes: 0 additions & 4 deletions care/facility/models/patient.py
Original file line number Diff line number Diff line change
Expand Up @@ -439,10 +439,6 @@ class TestTypeEnum(enum.Enum):
def __str__(self):
return f"{self.name} - {self.year_of_birth} - {self.get_gender_display()}"

@property
def tele_consultation_history(self):
return self.patientteleconsultation_set.order_by("-id")

def _alias_recovery_to_recovered(self) -> None:
if self.disease_status == DiseaseStatusEnum.RECOVERY.value:
self.disease_status = DiseaseStatusEnum.RECOVERED.value
Expand Down
20 changes: 0 additions & 20 deletions care/facility/models/patient_tele_consultation.py

This file was deleted.

0 comments on commit ee311a1

Please sign in to comment.