canvas 0.6.0__py3-none-any.whl → 0.7.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of canvas might be problematic. Click here for more details.

@@ -0,0 +1,112 @@
1
+ from django.contrib.postgres.fields import ArrayField
2
+ from django.db import models
3
+
4
+ from canvas_sdk.v1.data.common import ColorEnum, Origin
5
+ from canvas_sdk.v1.data.patient import Patient
6
+ from canvas_sdk.v1.data.staff import Staff
7
+
8
+
9
+ class TaskType(models.TextChoices):
10
+ """Choices for task types."""
11
+
12
+ TASK = "Task", "Task"
13
+ REMINDER = "Reminder", "Reminder"
14
+
15
+
16
+ class EventType(models.TextChoices):
17
+ """Choices for event types."""
18
+
19
+ EVENT_CHART_OPEN = "Chart Open", "Chart Open"
20
+
21
+
22
+ class TaskStatus(models.TextChoices):
23
+ """Choices for task statuses."""
24
+
25
+ COMPLETED = "COMPLETED", "Completed"
26
+ CLOSED = "CLOSED", "Closed"
27
+ OPEN = "OPEN", "Open"
28
+
29
+
30
+ class TaskLabelModule(models.TextChoices):
31
+ """Choices for task label modules."""
32
+
33
+ CLAIMS = "claims", "Claims"
34
+ TASKS = "tasks", "Tasks"
35
+
36
+
37
+ class Task(models.Model):
38
+ """Task."""
39
+
40
+ class Meta:
41
+ managed = False
42
+ app_label = "canvas_sdk"
43
+ db_table = "canvas_sdk_data_api_task_001"
44
+
45
+ id = models.UUIDField()
46
+ dbid = models.BigIntegerField(primary_key=True)
47
+ created = models.DateTimeField()
48
+ modified = models.DateTimeField()
49
+ creator = models.ForeignKey(Staff, related_name="creator_tasks", on_delete=models.DO_NOTHING)
50
+ assignee = models.ForeignKey(
51
+ Staff, related_name="assignee_tasks", null=True, on_delete=models.DO_NOTHING
52
+ )
53
+ # TODO - uncomment when Team model is created
54
+ # team = models.ForeignKey(Team, related_name="tasks", null=True, on_delete=models.DO_NOTHING)
55
+ patient = models.ForeignKey(
56
+ Patient, blank=True, null=True, on_delete=models.DO_NOTHING, related_name="tasks"
57
+ )
58
+ task_type = models.CharField(choices=TaskType.choices)
59
+ tag = models.CharField()
60
+ title = models.CharField()
61
+ due = models.DateTimeField(null=True)
62
+ due_event = models.CharField(choices=EventType.choices, blank=True)
63
+ status = models.CharField(choices=TaskStatus.choices)
64
+
65
+
66
+ class TaskComment(models.Model):
67
+ """TaskComment."""
68
+
69
+ class Meta:
70
+ managed = False
71
+ app_label = "canvas_sdk"
72
+ db_table = "canvas_sdk_data_api_taskcomment_001"
73
+
74
+ id = models.UUIDField()
75
+ dbid = models.BigIntegerField(primary_key=True)
76
+ created = models.DateTimeField()
77
+ modified = models.DateTimeField()
78
+ creator = models.ForeignKey(Staff, related_name="comments", on_delete=models.DO_NOTHING)
79
+ task = models.ForeignKey(Task, on_delete=models.DO_NOTHING, related_name="comments")
80
+ body = models.TextField()
81
+
82
+
83
+ class TaskLabel(models.Model):
84
+ """TaskLabel."""
85
+
86
+ class Meta:
87
+ managed = False
88
+ app_label = "canvas_sdk"
89
+ db_table = "canvas_sdk_data_api_tasklabel_001"
90
+
91
+ id = models.UUIDField()
92
+ dbid = models.BigIntegerField(primary_key=True)
93
+ tasks = models.ManyToManyField(Task, related_name="labels", through="TaskTaskLabel") # type: ignore[var-annotated]
94
+ position = models.IntegerField()
95
+ color = models.CharField(choices=ColorEnum.choices)
96
+ task_association = ArrayField(models.CharField(choices=Origin.choices))
97
+ name = models.CharField()
98
+ active = models.BooleanField()
99
+ modules = ArrayField(models.CharField(choices=TaskLabelModule.choices))
100
+
101
+
102
+ class TaskTaskLabel(models.Model):
103
+ """M2M for Task -> TaskLabels."""
104
+
105
+ class Meta:
106
+ managed = False
107
+ app_label = "canvas_sdk"
108
+ db_table = "canvas_sdk_data_api_tasktasklabel_001"
109
+
110
+ dbid = models.BigIntegerField(primary_key=True)
111
+ task_label = models.ForeignKey(TaskLabel, on_delete=models.DO_NOTHING)
112
+ task = models.ForeignKey(Task, on_delete=models.DO_NOTHING)