Skip to content

Commit

Permalink
update for tags
Browse files Browse the repository at this point in the history
  • Loading branch information
DraKen0009 committed Jan 26, 2025
1 parent a46ca16 commit 45cdda8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions care/emr/api/viewsets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ class EMRBaseViewSet(GenericViewSet):
pydantic_retrieve_model: EMRResource = None
database_model: EMRBaseModel = None
lookup_field = "external_id"
tags = [__name__]

def get_exception_handler(self):
return emr_exception_handler
Expand Down
4 changes: 4 additions & 0 deletions care/emr/api/viewsets/condition.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
)
from care.emr.resources.questionnaire.spec import SubjectType
from care.security.authorization import AuthorizationController
from care.utils.decorators.schema_decorator import generate_swagger_schema_decorator


class ValidateEncounterMixin:
Expand Down Expand Up @@ -58,6 +59,7 @@ class ConditionFilters(FilterSet):
severity = CharFilter(field_name="severity", lookup_expr="iexact")


@generate_swagger_schema_decorator
class SymptomViewSet(
ValidateEncounterMixin,
EncounterBasedAuthorizationBase,
Expand Down Expand Up @@ -98,6 +100,7 @@ def get_queryset(self):
InternalQuestionnaireRegistry.register(SymptomViewSet)


@generate_swagger_schema_decorator
class DiagnosisViewSet(
ValidateEncounterMixin,
EncounterBasedAuthorizationBase,
Expand Down Expand Up @@ -139,6 +142,7 @@ def get_queryset(self):
InternalQuestionnaireRegistry.register(DiagnosisViewSet)


@generate_swagger_schema_decorator
class ChronicConditionViewSet(
EMRQuestionnaireResponseMixin,
EMRCreateMixin,
Expand Down
4 changes: 2 additions & 2 deletions care/utils/decorators/schema_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@


def generate_swagger_schema_decorator(cls):
if not hasattr(cls, "tags") and not cls.tags:
cls.tags = [cls.__name__]
if not cls.tags:
cls.tags = cls.__name__

base_actions = {
"create": {
Expand Down

0 comments on commit 45cdda8

Please sign in to comment.