Skip to content

Commit

Permalink
Create more commands: Assess, Diagnose, Goal, HPI, MedicationStatement
Browse files Browse the repository at this point in the history
Create more commands: Assess, Diagnose, Goal, HPI, MedicationStatement
and also clean up tests
  • Loading branch information
mbiannaccone authored Feb 21, 2024
2 parents 1f176ff + d580ba3 commit e6dca33
Show file tree
Hide file tree
Showing 10 changed files with 532 additions and 139 deletions.
16 changes: 14 additions & 2 deletions canvas_sdk/commands/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,15 @@
from canvas_sdk.commands.plan.plan import PlanCommand
from canvas_sdk.commands.assess import AssessCommand
from canvas_sdk.commands.diagnose import DiagnoseCommand
from canvas_sdk.commands.goal import GoalCommand
from canvas_sdk.commands.history_present_illness import HistoryOfPresentIllnessCommand
from canvas_sdk.commands.medication_statement import MedicationStatementCommand
from canvas_sdk.commands.plan import PlanCommand

__all__ = ("PlanCommand",)
__all__ = (
"PlanCommand",
"AssessCommand",
"DiagnoseCommand",
"GoalCommand",
"HistoryOfPresentIllnessCommand",
"MedicationStatementCommand",
)
28 changes: 28 additions & 0 deletions canvas_sdk/commands/assess.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
from enum import Enum

from canvas_sdk.commands.base import _BaseCommand


class AssessCommand(_BaseCommand):
"""A class for managing an Assess command within a specific note."""

class Status(Enum):
IMPROVED = "improved"
STABLE = "stable"
DETERIORATED = "deteriorated"

# how do we make sure that condition_id is a valid condition for the patient?
condition_id: int
background: str | None = None
status: Status | None = None
narrative: str | None = None

@property
def values(self) -> dict:
"""The Assess command's field values."""
return {
"condition_id": self.condition_id,
"background": self.background,
"status": self.status.value if self.status else None,
"narrative": self.narrative,
}
27 changes: 27 additions & 0 deletions canvas_sdk/commands/diagnose.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
from datetime import datetime

from canvas_sdk.commands.base import _BaseCommand


class DiagnoseCommand(_BaseCommand):
"""A class for managing a Diagnose command within a specific note."""

# how do we make sure icd10_code is a valid code?
icd10_code: str
background: str | None = None
approximate_date_of_onset: datetime | None = None
today_assessment: str | None = None

@property
def values(self) -> dict:
"""The Diagnose command's field values."""
return {
"icd10_code": self.icd10_code,
"background": self.background,
"approximate_date_of_onset": (
self.approximate_date_of_onset.isoformat()
if self.approximate_date_of_onset
else None
),
"today_assessment": self.today_assessment,
}
47 changes: 47 additions & 0 deletions canvas_sdk/commands/goal.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
from datetime import datetime
from enum import Enum

from canvas_sdk.commands.base import _BaseCommand


class GoalCommand(_BaseCommand):
"""A class for managing a Goal command within a specific note."""

class Priority(Enum):
HIGH = "high-priority"
MEDIUM = "medium-priority"
LOW = "low-priority"

class AchievementStatus(Enum):
IN_PROGRESS = "in-progress"
IMPROVING = "improving"
WORSENING = "worsening"
NO_CHANGE = "no-change"
ACHIEVED = "achieved"
SUSTAINING = "sustaining"
NOT_ACHIEVED = "not-achieved"
NO_PROGRESS = "no-progress"
NOT_ATTAINABLE = "not-attainable"

goal_statement: str
start_date: datetime | None = None
due_date: datetime | None = None
today_assessment: str | None = None
achievement_status: AchievementStatus | None = None
priority: Priority | None = None
progress: str | None = None

@property
def values(self) -> dict:
"""The Goal command's field values."""
return {
"goal_statement": self.goal_statement,
"start_date": (self.start_date.isoformat() if self.start_date else None),
"due_date": (self.start_date.isoformat() if self.start_date else None),
"today_assessment": self.today_assessment,
"achievement_status": (
self.achievement_status.value if self.achievement_status else None
),
"priority": (self.priority.value if self.priority else None),
"progress": self.progress,
}
12 changes: 12 additions & 0 deletions canvas_sdk/commands/history_present_illness.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from canvas_sdk.commands.base import _BaseCommand


class HistoryOfPresentIllnessCommand(_BaseCommand):
"""A class for managing a HPI command within a specific note."""

narrative: str

@property
def values(self) -> dict:
"""The HPI command's field values."""
return {"narrative": self.narrative}
13 changes: 13 additions & 0 deletions canvas_sdk/commands/medication_statement.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
from canvas_sdk.commands.base import _BaseCommand


class MedicationStatementCommand(_BaseCommand):
"""A class for managing a MedicationStatement command within a specific note."""

fdb_code: str
sig: str | None = None

@property
def values(self) -> dict:
"""The MedicationStatement command's field values."""
return {"fdb_code": self.fdb_code, "sig": self.sig}
File renamed without changes.
Empty file.
137 changes: 0 additions & 137 deletions canvas_sdk/commands/plan/tests.py

This file was deleted.

Loading

0 comments on commit e6dca33

Please sign in to comment.