Skip to content

Commit

Permalink
feat: add instruct and perform commands
Browse files Browse the repository at this point in the history
  • Loading branch information
jamagalhaes committed Sep 24, 2024
1 parent b379a28 commit 08997ed
Show file tree
Hide file tree
Showing 6 changed files with 56 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 @@ -73,6 +73,11 @@ class EffectType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
DELETE_PERFORM_COMMAND: _ClassVar[EffectType]
COMMIT_PERFORM_COMMAND: _ClassVar[EffectType]
ENTER_IN_ERROR_PERFORM_COMMAND: _ClassVar[EffectType]
ORIGINATE_INSTRUCT_COMMAND: _ClassVar[EffectType]
EDIT_INSTRUCT_COMMAND: _ClassVar[EffectType]
DELETE_INSTRUCT_COMMAND: _ClassVar[EffectType]
COMMIT_INSTRUCT_COMMAND: _ClassVar[EffectType]
ENTER_IN_ERROR_INSTRUCT_COMMAND: _ClassVar[EffectType]
CREATE_TASK: _ClassVar[EffectType]
UPDATE_TASK: _ClassVar[EffectType]
CREATE_TASK_COMMENT: _ClassVar[EffectType]
Expand Down Expand Up @@ -143,6 +148,11 @@ EDIT_PERFORM_COMMAND: EffectType
DELETE_PERFORM_COMMAND: EffectType
COMMIT_PERFORM_COMMAND: EffectType
ENTER_IN_ERROR_PERFORM_COMMAND: EffectType
ORIGINATE_INSTRUCT_COMMAND: EffectType
EDIT_INSTRUCT_COMMAND: EffectType
DELETE_INSTRUCT_COMMAND: EffectType
COMMIT_INSTRUCT_COMMAND: EffectType
ENTER_IN_ERROR_INSTRUCT_COMMAND: EffectType
CREATE_TASK: EffectType
UPDATE_TASK: EffectType
CREATE_TASK_COMMENT: EffectType
Expand Down
4 changes: 4 additions & 0 deletions canvas_sdk/commands/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
from canvas_sdk.commands.commands.history_present_illness import (
HistoryOfPresentIllnessCommand,
)
from canvas_sdk.commands.commands.instruct import InstructCommand
from canvas_sdk.commands.commands.medication_statement import MedicationStatementCommand
from canvas_sdk.commands.commands.perform import PerformCommand
from canvas_sdk.commands.commands.plan import PlanCommand
from canvas_sdk.commands.commands.prescribe import PrescribeCommand
from canvas_sdk.commands.commands.questionnaire import QuestionnaireCommand
Expand All @@ -17,7 +19,9 @@
"DiagnoseCommand",
"GoalCommand",
"HistoryOfPresentIllnessCommand",
"InstructCommand",
"MedicationStatementCommand",
"PerformCommand",
"PlanCommand",
"PrescribeCommand",
"QuestionnaireCommand",
Expand Down
17 changes: 17 additions & 0 deletions canvas_sdk/commands/commands/instruct.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from canvas_sdk.commands.base import _BaseCommand as BaseCommand


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

class Meta:
key = "instruct"
commit_required_fields = ("instruction",)

instruction: str | None = None
comment: str | None = None

@property
def values(self) -> dict:
"""The Instruct command's field values."""
return {"instruction": self.instruction, "comment": self.comment}
17 changes: 17 additions & 0 deletions canvas_sdk/commands/commands/perform.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
from canvas_sdk.commands.base import _BaseCommand as BaseCommand


class PerformCommand(BaseCommand):
"""A class for managing a Perform command within a specific note."""

class Meta:
key = "perform"
commit_required_fields = ("cpt_code",)

cpt_code: str
notes: str | None = None

@property
def values(self) -> dict:
"""The Perform command's field values."""
return {"cpt_code": self.cpt_code, "notes": self.notes}
6 changes: 6 additions & 0 deletions protobufs/canvas_generated/messages/effects.proto
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,12 @@ enum EffectType {
COMMIT_PERFORM_COMMAND = 64;
ENTER_IN_ERROR_PERFORM_COMMAND = 65;

ORIGINATE_INSTRUCT_COMMAND = 66;
EDIT_INSTRUCT_COMMAND = 67 ;
DELETE_INSTRUCT_COMMAND = 68;
COMMIT_INSTRUCT_COMMAND = 69;
ENTER_IN_ERROR_INSTRUCT_COMMAND = 70;

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

0 comments on commit 08997ed

Please sign in to comment.