Skip to content

Commit

Permalink
feat: add PastSurgicalHistory command SDK definition
Browse files Browse the repository at this point in the history
  • Loading branch information
jamagalhaes committed Sep 25, 2024
1 parent 40fa8d3 commit 332f898
Show file tree
Hide file tree
Showing 5 changed files with 48 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 @@ -98,6 +98,11 @@ class EffectType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
DELETE_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
COMMIT_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
ORIGINATE_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
EDIT_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
DELETE_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
COMMIT_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
ENTER_IN_ERROR_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
CREATE_TASK: _ClassVar[EffectType]
UPDATE_TASK: _ClassVar[EffectType]
CREATE_TASK_COMMENT: _ClassVar[EffectType]
Expand Down Expand Up @@ -194,6 +199,11 @@ EDIT_REMOVE_ALLERGY_COMMAND: EffectType
DELETE_REMOVE_ALLERGY_COMMAND: EffectType
COMMIT_REMOVE_ALLERGY_COMMAND: EffectType
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND: EffectType
ORIGINATE_SURGICAL_HISTORY_COMMAND: EffectType
EDIT_SURGICAL_HISTORY_COMMAND: EffectType
DELETE_SURGICAL_HISTORY_COMMAND: EffectType
COMMIT_SURGICAL_HISTORY_COMMAND: EffectType
ENTER_IN_ERROR_SURGICAL_HISTORY_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 @@ -9,6 +9,7 @@
from canvas_sdk.commands.commands.instruct import InstructCommand
from canvas_sdk.commands.commands.lab_order import LabOrderCommand
from canvas_sdk.commands.commands.medication_statement import MedicationStatementCommand
from canvas_sdk.commands.commands.past_surgical_history import PastSurgicalHistoryCommand
from canvas_sdk.commands.commands.perform import PerformCommand
from canvas_sdk.commands.commands.plan import PlanCommand
from canvas_sdk.commands.commands.prescribe import PrescribeCommand
Expand All @@ -28,6 +29,7 @@
"InstructCommand",
"LabOrderCommand",
"MedicationStatementCommand",
"PastSurgicalHistoryCommand",
"PerformCommand",
"PlanCommand",
"PrescribeCommand",
Expand Down
28 changes: 28 additions & 0 deletions canvas_sdk/commands/commands/past_surgical_history.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from datetime import date

from pydantic import Field

from canvas_sdk.commands.base import _BaseCommand as BaseCommand


class PastSurgicalHistoryCommand(BaseCommand):
"""A class for managing a Past Surgical History command within a specific note."""

class Meta:
key = "surgicalHistory"
commit_required_fields = ("past_surgical_history",)

past_surgical_history: str | None = None
approximate_date: date | None = None
comment: str | None = Field(max_length=1000, default=None)

@property
def values(self) -> dict:
"""The Past Surgical History command's field values."""
return {
"past_surgical_history": self.past_surgical_history,
"approximate_date": (
self.approximate_date.isoformat() if self.approximate_date else None
),
"comment": self.comment,
}
6 changes: 6 additions & 0 deletions protobufs/canvas_generated/messages/effects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,12 @@ enum EffectType {
COMMIT_REMOVE_ALLERGY_COMMAND = 89;
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND = 90;

ORIGINATE_SURGICAL_HISTORY_COMMAND = 91;
EDIT_SURGICAL_HISTORY_COMMAND = 92;
DELETE_SURGICAL_HISTORY_COMMAND = 93;
COMMIT_SURGICAL_HISTORY_COMMAND = 94;
ENTER_IN_ERROR_SURGICAL_HISTORY_COMMAND = 95;

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

0 comments on commit 332f898

Please sign in to comment.