Skip to content

Commit

Permalink
feat: feat: add RemoveAllergy command SDK definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jamagalhaes committed Sep 25, 2024
1 parent 87f05cf commit 40fa8d3
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 2 deletions.
4 changes: 2 additions & 2 deletions canvas_generated/messages/effects_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 10 additions & 0 deletions canvas_generated/messages/effects_pb2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,11 @@ class EffectType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
DELETE_ALLERGY_COMMAND: _ClassVar[EffectType]
COMMIT_ALLERGY_COMMAND: _ClassVar[EffectType]
ENTER_IN_ERROR_ALLERGY_COMMAND: _ClassVar[EffectType]
ORIGINATE_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
EDIT_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
DELETE_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
COMMIT_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
CREATE_TASK: _ClassVar[EffectType]
UPDATE_TASK: _ClassVar[EffectType]
CREATE_TASK_COMMENT: _ClassVar[EffectType]
Expand Down Expand Up @@ -184,6 +189,11 @@ EDIT_ALLERGY_COMMAND: EffectType
DELETE_ALLERGY_COMMAND: EffectType
COMMIT_ALLERGY_COMMAND: EffectType
ENTER_IN_ERROR_ALLERGY_COMMAND: EffectType
ORIGINATE_REMOVE_ALLERGY_COMMAND: EffectType
EDIT_REMOVE_ALLERGY_COMMAND: EffectType
DELETE_REMOVE_ALLERGY_COMMAND: EffectType
COMMIT_REMOVE_ALLERGY_COMMAND: EffectType
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND: EffectType
CREATE_TASK: EffectType
UPDATE_TASK: EffectType
CREATE_TASK_COMMENT: EffectType
Expand Down
2 changes: 2 additions & 0 deletions canvas_sdk/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
from canvas_sdk.commands.commands.prescribe import PrescribeCommand
from canvas_sdk.commands.commands.questionnaire import QuestionnaireCommand
from canvas_sdk.commands.commands.reason_for_visit import ReasonForVisitCommand
from canvas_sdk.commands.commands.remove_allergy import RemoveAllergyCommand
from canvas_sdk.commands.commands.stop_medication import StopMedicationCommand
from canvas_sdk.commands.commands.update_goal import UpdateGoalCommand

Expand All @@ -32,6 +33,7 @@
"PrescribeCommand",
"QuestionnaireCommand",
"ReasonForVisitCommand",
"RemoveAllergyCommand",
"StopMedicationCommand",
"UpdateGoalCommand",
)
26 changes: 26 additions & 0 deletions canvas_sdk/commands/commands/remove_allergy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
from pydantic import Field

from canvas_sdk.commands.base import _BaseCommand as BaseCommand


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

class Meta:
key = "removeAllergy"
commit_required_fields = ("allergy_id",)

allergy_id: str | None = Field(
description="The external ID of the allergy to remove.",
default=None,
json_schema_extra={"commands_api_name": "allergy"},
)
narrative: str | None = None

@property
def values(self) -> dict:
"""The Remove Allergy command's field values."""
return {
"allergy_id": self.allergy_id,
"narrative": self.narrative,
}
6 changes: 6 additions & 0 deletions protobufs/canvas_generated/messages/effects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,12 @@ enum EffectType {
COMMIT_ALLERGY_COMMAND = 84;
ENTER_IN_ERROR_ALLERGY_COMMAND = 85;

ORIGINATE_REMOVE_ALLERGY_COMMAND = 86;
EDIT_REMOVE_ALLERGY_COMMAND = 87;
DELETE_REMOVE_ALLERGY_COMMAND = 88;
COMMIT_REMOVE_ALLERGY_COMMAND = 89;
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND = 90;

CREATE_TASK = 100;
UPDATE_TASK = 101;
CREATE_TASK_COMMENT = 102;
Expand Down

0 comments on commit 40fa8d3

Please sign in to comment.