Skip to content

Commit

Permalink
Update local units health options
Browse files Browse the repository at this point in the history
  • Loading branch information
k9845 committed Apr 26, 2024
1 parent 203a16e commit 202b037
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
16 changes: 16 additions & 0 deletions local_units/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,25 @@
HospitalType,
BloodService,
ProfessionalTrainingFacility,
GeneralMedicalService,
SpecializedMedicalService,
)
from api.models import Country
from main.writable_nested_serializers import NestedCreateMixin, NestedUpdateMixin


class GeneralMedicalServiceSerializer(serializers.ModelSerializer):
class Meta:
model = GeneralMedicalService
fields = "__all__"


class SpecializedMedicalServiceSerializer(serializers.ModelSerializer):
class Meta:
model = SpecializedMedicalService
fields = "__all__"


class AffiliationSerializer(serializers.ModelSerializer):
class Meta:
model = Affiliation
Expand Down Expand Up @@ -216,6 +230,8 @@ class LocalUnitOptionsSerializer(serializers.Serializer):
hospital_type = HospitalTypeSerializer(many=True)
blood_services = BloodServiceSerializer(many=True)
professional_training_facilities = ProfessionalTrainingFacilitySerializer(many=True)
general_medical_services = GeneralMedicalServiceSerializer(many=True)
specialized_medical_services = SpecializedMedicalServiceSerializer(many=True)


class MiniDelegationOfficeSerializer(serializers.ModelSerializer):
Expand Down
6 changes: 5 additions & 1 deletion local_units/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@
HospitalType,
BloodService,
ProfessionalTrainingFacility,
VisibilityChoices
VisibilityChoices,
GeneralMedicalService,
SpecializedMedicalService,
)
from local_units.serializers import (
LocalUnitSerializer,
Expand Down Expand Up @@ -84,6 +86,8 @@ def get_options(self, request, pk=None):
hospital_type=HospitalType.objects.all(),
blood_services=BloodService.objects.all(),
professional_training_facilities=ProfessionalTrainingFacility.objects.all(),
general_medical_services=GeneralMedicalService.objects.all(),
specialized_medical_services=SpecializedMedicalService.objects.all(),
)
).data
)
Expand Down

0 comments on commit 202b037

Please sign in to comment.