Skip to content

Commit

Permalink
fix: improve AllergyCommand definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jamagalhaes committed Oct 8, 2024
1 parent e2b8ad8 commit 049c16d
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions canvas_sdk/commands/commands/allergy.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,24 @@
from datetime import date
from enum import Enum
from enum import Enum, IntEnum

from typing_extensions import TypedDict

from canvas_sdk.commands.base import _BaseCommand as BaseCommand


class AllergenType(IntEnum):
ALLERGEN_GROUP = 1
MEDICATION = 2
INGREDIENT = 6


class Allergen(TypedDict):
"""A TypedDict representing an allergen."""

concept_id: int
concept_type: AllergenType


class AllergyCommand(BaseCommand):
"""A class for managing an Allergy command within a specific note."""

Expand All @@ -16,7 +31,7 @@ class Severity(Enum):
MODERATE = "moderate"
SEVERE = "severe"

allergy: str | None = None
allergy: Allergen | None = None
severity: Severity | None = None
narrative: str | None = None
approximate_date: date | None = None
Expand Down

0 comments on commit 049c16d

Please sign in to comment.