canvas 0.60.0__py3-none-any.whl → 0.62.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.

@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: canvas
3
- Version: 0.60.0
3
+ Version: 0.62.0
4
4
  Summary: SDK to customize event-driven actions in your Canvas instance
5
5
  Author-email: Canvas Team <engineering@canvasmedical.com>
6
6
  License-Expression: MIT
@@ -102,7 +102,7 @@ canvas_sdk/caching/exceptions.py,sha256=WIQIveMzmGm9WGhZqBhsGbbcydpS0AzMpkhzUmTa
102
102
  canvas_sdk/caching/plugins.py,sha256=VWVj7iBQQDHJTMX8El4YHkUPRgSEWZef7aaS7Jls7RU,607
103
103
  canvas_sdk/caching/utils.py,sha256=lg-2RVl7uujO0_KOvWKZ5c3q7RyrrmLG5JNaxCL2lOw,875
104
104
  canvas_sdk/commands/__init__.py,sha256=qX7xkagyYk4W4JqczoTHv3W3Bk16BXQG4Ut7zQV8wX0,3337
105
- canvas_sdk/commands/base.py,sha256=NuReIfAun8oumtA5fWT_uddtD1K81dzzyx_gHFjAb-U,6629
105
+ canvas_sdk/commands/base.py,sha256=XHHS2mvTm0Do3y5xxUJJzj1JFMZ3Jp-E0Go7ZtnXkww,6763
106
106
  canvas_sdk/commands/constants.py,sha256=0iuPRW1xC0O7i1KxxQbFhjbOA5VAnBkfyxELRJ3M86o,1652
107
107
  canvas_sdk/commands/commands/__init__.py,sha256=YYXr5tEQlnwMgTXJbOG963tKSPiUOM4mUkX8wuiqp7U,17
108
108
  canvas_sdk/commands/commands/adjust_prescription.py,sha256=LgA0x7YS6wK84kxI5r3ULSBSvxi4XFB6hdIMdfakPNQ,453
@@ -168,9 +168,9 @@ canvas_sdk/effects/compound_medications/__init__.py,sha256=3bNQZNTSzs4VUw-6jvvsh
168
168
  canvas_sdk/effects/compound_medications/compound_medication.py,sha256=lBeKGPuYjeAXBb2x4GlfnV-J-Wje7ryUMWqRCPL3ogY,9547
169
169
  canvas_sdk/effects/note/__init__.py,sha256=SwxCzB_2qzYhZAjObnD5cYRxC_kBCf68kNkKcQCANXY,294
170
170
  canvas_sdk/effects/note/appointment.py,sha256=ca46df8onI-I6szPJWSz_N745PWchKMBcruKiXmxsqk,8034
171
- canvas_sdk/effects/note/base.py,sha256=3TeUdVsWWl0iJ8fkbCLJ0SjcZ0fEASy50r-ubSXvCpI,7587
171
+ canvas_sdk/effects/note/base.py,sha256=FzMR0Wbg66xjIaiyvcSLyvTi5_a6F7vR_GGdsLZk74Q,7279
172
172
  canvas_sdk/effects/note/message.py,sha256=T6p6h4J_I0k2jQSirFtIusydak4tem9yBPOTexvOQ0s,3740
173
- canvas_sdk/effects/note/note.py,sha256=_iVVagZUM4fWOMw3Cy4KXl5rd-1_NgF57QSBl5y9d7w,4610
173
+ canvas_sdk/effects/note/note.py,sha256=mQtcC71vviFzwGP_uQKk9_Pksh8oUY8nyMKikUdaWPE,5005
174
174
  canvas_sdk/effects/patient/__init__.py,sha256=QC5UszNibt-BTC3rfCq9y-j4-APuBMUZfAllB8WnIDY,636
175
175
  canvas_sdk/effects/patient/base.py,sha256=E60n-RtD8q5Fo1UxCS1-RmZu14qBV5raiYtm2TcxrWU,8342
176
176
  canvas_sdk/effects/patient/create_patient_external_identifier.py,sha256=d03jzJcz2n19_NVo_wAq88iKZRuuM60qsZhGGhL7pGE,1055
@@ -331,7 +331,7 @@ canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/{{ cookie
331
331
  canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__package_name }}/README.md,sha256=3QKoJQq3YmdplGnDOBMsLCJ3Ya1_aKjoz-QiWc4QfjA,291
332
332
  canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__package_name }}/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
333
333
  canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/{{ cookiecutter.__package_name }}/protocols/my_protocol.py,sha256=fKLLcOIwvSWenW8-7tr8VqnF4Iox_5wU9V-Qw9UySsA,2381
334
- canvas-0.60.0.dist-info/METADATA,sha256=ubqSX0pfGxciJWZiyzLwb2dijpOB5f8uM3PPV1DHFF8,4758
335
- canvas-0.60.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
336
- canvas-0.60.0.dist-info/entry_points.txt,sha256=0Vs_9GmTVUNniH6eDBlRPgofmADMV4BES6Ao26M4AbM,47
337
- canvas-0.60.0.dist-info/RECORD,,
334
+ canvas-0.62.0.dist-info/METADATA,sha256=2ABZEbwBvdf27cqL6dBep_5iaBjzqHBe_sgzCkdRPZE,4758
335
+ canvas-0.62.0.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
336
+ canvas-0.62.0.dist-info/entry_points.txt,sha256=0Vs_9GmTVUNniH6eDBlRPgofmADMV4BES6Ao26M4AbM,47
337
+ canvas-0.62.0.dist-info/RECORD,,
@@ -77,7 +77,8 @@ class _BaseCommand(TrackableFieldsModel):
77
77
  annotation_args = get_args(annotation)
78
78
  # Filter out NoneType and take the first valid type
79
79
  annotation = next(
80
- (arg for arg in annotation_args if arg is not NoneType), annotation_args[0]
80
+ (arg for arg in annotation_args if arg is not NoneType),
81
+ annotation_args[0],
81
82
  )
82
83
 
83
84
  if type(annotation) is EnumType:
@@ -158,8 +159,13 @@ class _BaseCommand(TrackableFieldsModel):
158
159
  """Returns a command recommendation to be inserted via Protocol Card."""
159
160
  if button is None:
160
161
  button = self.constantized_key().lower().replace("_", " ")
161
- command = self.Meta.key.lower()
162
- return Recommendation(title=title, button=button, command=command, context=self.values)
162
+ command = self.Meta.key
163
+ return Recommendation(
164
+ title=title,
165
+ button=button,
166
+ command=command,
167
+ context=self.values | {"effect_type": f"ORIGINATE_{self.constantized_key()}_COMMAND"},
168
+ )
163
169
 
164
170
 
165
171
  class _SendableCommandMixin:
@@ -57,14 +57,6 @@ class NoteOrAppointmentABC(TrackableFieldsModel, ABC):
57
57
  errors = super()._get_error_details(method)
58
58
 
59
59
  if method == "create":
60
- if self.instance_id:
61
- errors.append(
62
- self._create_error_detail(
63
- "value",
64
- "Instance ID should not be provided for create effects.",
65
- self.instance_id,
66
- )
67
- )
68
60
  if not self.practice_location_id:
69
61
  errors.append(
70
62
  self._create_error_detail(
@@ -67,6 +67,16 @@ class Note(NoteOrAppointmentABC):
67
67
  None,
68
68
  )
69
69
  )
70
+
71
+ if self.instance_id and NoteModel.objects.filter(id=self.instance_id).exists():
72
+ errors.append(
73
+ self._create_error_detail(
74
+ "value",
75
+ f"Note with ID {self.instance_id} already exists.",
76
+ self.instance_id,
77
+ )
78
+ )
79
+
70
80
  elif method == "update":
71
81
  if self.note_type_id:
72
82
  errors.append(
@@ -85,14 +95,14 @@ class Note(NoteOrAppointmentABC):
85
95
  )
86
96
  )
87
97
 
88
- if self.instance_id and not NoteModel.objects.filter(id=self.instance_id).exists():
89
- errors.append(
90
- self._create_error_detail(
91
- "value",
92
- f"Note with ID {self.instance_id} does not exist.",
93
- self.instance_id,
98
+ if self.instance_id and not NoteModel.objects.filter(id=self.instance_id).exists():
99
+ errors.append(
100
+ self._create_error_detail(
101
+ "value",
102
+ f"Note with ID {self.instance_id} does not exist.",
103
+ self.instance_id,
104
+ )
94
105
  )
95
- )
96
106
 
97
107
  if self.note_type_id:
98
108
  note_type_category = (