canvas 0.2.5__tar.gz → 0.2.11__tar.gz
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.
- {canvas-0.2.5 → canvas-0.2.11}/PKG-INFO +4 -1
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/plugin/plugin.py +51 -9
- canvas-0.2.11/canvas_cli/apps/plugin/tests.py +83 -0
- canvas-0.2.11/canvas_cli/tests.py +200 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/validators/manifest_schema.py +1 -0
- canvas-0.2.11/canvas_generated/messages/effects_pb2.py +28 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/messages/effects_pb2.pyi +136 -0
- canvas-0.2.11/canvas_generated/messages/events_pb2.py +31 -0
- canvas-0.2.11/canvas_generated/messages/events_pb2.pyi +1061 -0
- canvas-0.2.11/canvas_sdk/__init__.py +7 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/base.py +6 -2
- canvas-0.2.11/canvas_sdk/commands/__init__.py +53 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/base.py +35 -32
- canvas-0.2.11/canvas_sdk/commands/commands/allergy.py +49 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/assess.py +1 -1
- canvas-0.2.11/canvas_sdk/commands/commands/close_goal.py +22 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/diagnose.py +3 -3
- canvas-0.2.11/canvas_sdk/commands/commands/family_history.py +18 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/goal.py +3 -3
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/history_present_illness.py +1 -1
- canvas-0.2.11/canvas_sdk/commands/commands/instruct.py +17 -0
- canvas-0.2.11/canvas_sdk/commands/commands/lab_order.py +33 -0
- canvas-0.2.11/canvas_sdk/commands/commands/medical_history.py +34 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/medication_statement.py +1 -1
- canvas-0.2.11/canvas_sdk/commands/commands/past_surgical_history.py +28 -0
- canvas-0.2.11/canvas_sdk/commands/commands/perform.py +17 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/plan.py +2 -2
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/prescribe.py +10 -7
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/questionnaire.py +1 -1
- canvas-0.2.11/canvas_sdk/commands/commands/refill.py +16 -0
- canvas-0.2.11/canvas_sdk/commands/commands/remove_allergy.py +26 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/stop_medication.py +1 -1
- canvas-0.2.11/canvas_sdk/commands/commands/task.py +52 -0
- canvas-0.2.11/canvas_sdk/commands/commands/update_diagnosis.py +27 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/update_goal.py +1 -1
- canvas-0.2.11/canvas_sdk/commands/commands/vitals.py +78 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/constants.py +7 -0
- canvas-0.2.11/canvas_sdk/commands/tests/protocol/tests.py +55 -0
- canvas-0.2.11/canvas_sdk/commands/tests/schema/tests.py +104 -0
- canvas-0.2.11/canvas_sdk/commands/tests/test_utils.py +326 -0
- {canvas-0.2.5/canvas_sdk/commands/tests → canvas-0.2.11/canvas_sdk/commands/tests/unit}/tests.py +20 -194
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/effects/banner_alert/add_banner_alert.py +8 -7
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/effects/banner_alert/remove_banner_alert.py +3 -2
- canvas-0.2.11/canvas_sdk/effects/banner_alert/tests.py +224 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/effects/base.py +3 -5
- canvas-0.2.11/canvas_sdk/effects/patient_chart_summary_configuration.py +39 -0
- canvas-0.2.11/canvas_sdk/effects/protocol_card/__init__.py +1 -0
- canvas-0.2.11/canvas_sdk/effects/protocol_card/protocol_card.py +83 -0
- canvas-0.2.11/canvas_sdk/effects/protocol_card/tests.py +184 -0
- canvas-0.2.11/canvas_sdk/protocols/clinical_quality_measure.py +41 -0
- canvas-0.2.11/canvas_sdk/tests/__init__.py +0 -0
- canvas-0.2.11/canvas_sdk/utils/db.py +17 -0
- canvas-0.2.11/canvas_sdk/v1/__init__.py +0 -0
- canvas-0.2.11/canvas_sdk/v1/data/__init__.py +3 -0
- canvas-0.2.11/canvas_sdk/v1/data/allergy_intolerance.py +63 -0
- canvas-0.2.11/canvas_sdk/v1/data/base.py +47 -0
- canvas-0.2.11/canvas_sdk/v1/data/condition.py +48 -0
- canvas-0.2.11/canvas_sdk/v1/data/lab.py +96 -0
- canvas-0.2.11/canvas_sdk/v1/data/medication.py +54 -0
- canvas-0.2.11/canvas_sdk/v1/data/patient.py +49 -0
- canvas-0.2.11/canvas_sdk/v1/data/user.py +10 -0
- canvas-0.2.11/canvas_sdk/value_set/tests/test_value_sets.py +65 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/adverse_event.py +33 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/allergy.py +232 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/assessment.py +215 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/communication.py +325 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/condition.py +40654 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/device.py +174 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/diagnostic_study.py +4967 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/encounter.py +2564 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/immunization.py +341 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/individual_characteristic.py +307 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/intervention.py +1356 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/laboratory_test.py +1250 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/medication.py +5130 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/physical_exam.py +201 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/procedure.py +4037 -0
- canvas-0.2.11/canvas_sdk/value_set/v2022/symptom.py +176 -0
- canvas-0.2.11/canvas_sdk/value_set/value_set.py +91 -0
- canvas-0.2.11/canvas_sdk/views/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/pyproject.toml +19 -3
- canvas-0.2.11/settings.py +43 -0
- canvas-0.2.5/canvas_cli/apps/plugin/tests.py +0 -32
- canvas-0.2.5/canvas_cli/tests.py +0 -11
- canvas-0.2.5/canvas_generated/messages/effects_pb2.py +0 -28
- canvas-0.2.5/canvas_generated/messages/events_pb2.py +0 -31
- canvas-0.2.5/canvas_generated/messages/events_pb2.pyi +0 -447
- canvas-0.2.5/canvas_sdk/commands/__init__.py +0 -27
- canvas-0.2.5/canvas_sdk/commands/tests/test_utils.py +0 -162
- {canvas-0.2.5 → canvas-0.2.11}/README.md +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/auth/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/auth/tests.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/auth/utils.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/logs/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/logs/logs.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/apps/plugin/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/conftest.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/main.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/templates/plugins/default/cookiecutter.json +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/CANVAS_MANIFEST.json +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/README.md +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/protocols/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/protocols/my_protocol.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/context/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/context/context.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/context/tests.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/print/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/print/print.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/print/tests.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/urls/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/urls/tests.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/urls/urls.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/validators/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/validators/tests.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_cli/utils/validators/validators.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/messages/effects_pb2_grpc.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/messages/events_pb2_grpc.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/messages/plugins_pb2.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/messages/plugins_pb2.pyi +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/messages/plugins_pb2_grpc.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/services/plugin_runner_pb2.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/services/plugin_runner_pb2.pyi +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_generated/services/plugin_runner_pb2_grpc.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/commands/commands/reason_for_visit.py +0 -0
- {canvas-0.2.5/canvas_sdk → canvas-0.2.11/canvas_sdk/commands/tests/protocol}/__init__.py +0 -0
- {canvas-0.2.5/canvas_sdk/tests → canvas-0.2.11/canvas_sdk/commands/tests/schema}/__init__.py +0 -0
- {canvas-0.2.5/canvas_sdk/views → canvas-0.2.11/canvas_sdk/commands/tests/unit}/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/data/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/data/base.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/data/client.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/data/patient.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/data/staff.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/data/task.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/effects/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/effects/banner_alert/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/events/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/handlers/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/handlers/base.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/handlers/cron_task.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/protocols/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/protocols/base.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/utils/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/utils/http.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/utils/stats.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/canvas_sdk/utils/tests.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/logger/__init__.py +0 -0
- {canvas-0.2.5 → canvas-0.2.11}/logger/logger.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: canvas
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.11
|
|
4
4
|
Summary: SDK to customize event-driven actions in your Canvas instance
|
|
5
5
|
License: MIT
|
|
6
6
|
Author: Canvas Team
|
|
@@ -12,12 +12,14 @@ Classifier: Programming Language :: Python :: 3.11
|
|
|
12
12
|
Classifier: Programming Language :: Python :: 3.12
|
|
13
13
|
Requires-Dist: cookiecutter
|
|
14
14
|
Requires-Dist: cron-converter (>=1.2.1,<2.0.0)
|
|
15
|
+
Requires-Dist: django (>=5.1.1,<6.0.0)
|
|
15
16
|
Requires-Dist: gql[all] (>=3.5.0,<4.0.0)
|
|
16
17
|
Requires-Dist: grpcio (>=1.60.1,<2.0.0)
|
|
17
18
|
Requires-Dist: ipython (>=8.21.0,<9.0.0)
|
|
18
19
|
Requires-Dist: jsonschema (>=4.21.1,<5.0.0)
|
|
19
20
|
Requires-Dist: keyring
|
|
20
21
|
Requires-Dist: protobuf (>=4.25.3,<5.0.0)
|
|
22
|
+
Requires-Dist: psycopg[binary] (>=3.2.2,<4.0.0)
|
|
21
23
|
Requires-Dist: pydantic (>=2.6.1,<3.0.0)
|
|
22
24
|
Requires-Dist: pyjwt (==2.4.0)
|
|
23
25
|
Requires-Dist: python-dotenv (>=1.0.1,<2.0.0)
|
|
@@ -26,6 +28,7 @@ Requires-Dist: requests
|
|
|
26
28
|
Requires-Dist: restrictedpython (>=7.1,<8.0)
|
|
27
29
|
Requires-Dist: statsd (>=4.0.1,<5.0.0)
|
|
28
30
|
Requires-Dist: typer[all]
|
|
31
|
+
Requires-Dist: typing-extensions (>=4.8,<4.9)
|
|
29
32
|
Requires-Dist: websocket-client (>=1.7.0,<2.0.0)
|
|
30
33
|
Description-Content-Type: text/markdown
|
|
31
34
|
|
|
@@ -1,8 +1,11 @@
|
|
|
1
|
+
import importlib
|
|
1
2
|
import json
|
|
3
|
+
import os
|
|
4
|
+
import sys
|
|
2
5
|
import tarfile
|
|
3
6
|
import tempfile
|
|
4
7
|
from pathlib import Path
|
|
5
|
-
from typing import Optional
|
|
8
|
+
from typing import Any, List, Optional
|
|
6
9
|
from urllib.parse import urljoin
|
|
7
10
|
|
|
8
11
|
import requests
|
|
@@ -69,6 +72,30 @@ def _get_name_from_metadata(host: str, token: str, package: Path) -> Optional[st
|
|
|
69
72
|
return metadata.get("name")
|
|
70
73
|
|
|
71
74
|
|
|
75
|
+
def _get_protocols_with_new_cqm_properties(
|
|
76
|
+
protocol_classes: List[dict[str, Any]]
|
|
77
|
+
) -> List[dict[str, Any]] | None:
|
|
78
|
+
"""Extract the meta properties of any ClinicalQualityMeasure Protocols included in the plugin if they have changed."""
|
|
79
|
+
|
|
80
|
+
def get_new_meta_properties(protocol_class: dict[str, str]) -> dict[str, str]:
|
|
81
|
+
mod, classname = protocol_class["class"].split(":")
|
|
82
|
+
module = importlib.import_module(mod)
|
|
83
|
+
_class = getattr(module, classname)
|
|
84
|
+
if not hasattr(_class, "_meta") or _class._meta() == protocol_class.get("meta"):
|
|
85
|
+
return {}
|
|
86
|
+
return {"meta": _class._meta()}
|
|
87
|
+
|
|
88
|
+
has_updates = False
|
|
89
|
+
new_protocols = []
|
|
90
|
+
for p in protocol_classes:
|
|
91
|
+
m = get_new_meta_properties(p)
|
|
92
|
+
new_protocols.append(p | m)
|
|
93
|
+
if m:
|
|
94
|
+
has_updates = True
|
|
95
|
+
|
|
96
|
+
return new_protocols if has_updates else None
|
|
97
|
+
|
|
98
|
+
|
|
72
99
|
def get_base_plugin_template_path() -> Path:
|
|
73
100
|
"""Return context's base_plugin_template_path, so it can be used as a Typer default."""
|
|
74
101
|
return context.plugin_template_dir / context.default_plugin_template_name
|
|
@@ -126,7 +153,7 @@ def install(
|
|
|
126
153
|
raise typer.Exit(1)
|
|
127
154
|
|
|
128
155
|
if r.status_code == requests.codes.created:
|
|
129
|
-
print("Plugin successfully installed!")
|
|
156
|
+
print(f"Plugin {plugin_name} successfully installed!")
|
|
130
157
|
|
|
131
158
|
# If we got a bad_request, means there's a duplicate plugin and install can't handle that.
|
|
132
159
|
# So we need to get the plugin-name from the package and call `update` directly
|
|
@@ -168,7 +195,7 @@ def uninstall(
|
|
|
168
195
|
raise typer.Exit(1)
|
|
169
196
|
|
|
170
197
|
if r.status_code == requests.codes.no_content:
|
|
171
|
-
print(
|
|
198
|
+
print(f"Plugin {name} successfully uninstalled!")
|
|
172
199
|
else:
|
|
173
200
|
print(f"Status code {r.status_code}: {r.text}")
|
|
174
201
|
raise typer.Exit(1)
|
|
@@ -273,9 +300,12 @@ def list(
|
|
|
273
300
|
raise typer.Exit(1)
|
|
274
301
|
|
|
275
302
|
if r.status_code == requests.codes.ok:
|
|
276
|
-
|
|
303
|
+
plugins = r.json().get("results", [])
|
|
304
|
+
if not plugins:
|
|
305
|
+
print(f"No plugins are currently installed on {host}")
|
|
306
|
+
for plugin in plugins:
|
|
277
307
|
print(
|
|
278
|
-
f"{plugin['name']}@{plugin['version']}\t{'enabled' if plugin['is_enabled'] else '
|
|
308
|
+
f"{plugin['name']}@{plugin['version']}\t{'enabled' if plugin['is_enabled'] else 'disabled'}"
|
|
279
309
|
)
|
|
280
310
|
else:
|
|
281
311
|
print(f"Status code {r.status_code}: {r.text}")
|
|
@@ -287,27 +317,39 @@ def validate_manifest(
|
|
|
287
317
|
) -> None:
|
|
288
318
|
"""Validate the Canvas Manifest json file."""
|
|
289
319
|
if not plugin_name.exists():
|
|
290
|
-
raise typer.BadParameter(f"Plugin
|
|
320
|
+
raise typer.BadParameter(f"Plugin {plugin_name} does not exist")
|
|
291
321
|
|
|
292
322
|
if not plugin_name.is_dir():
|
|
293
|
-
raise typer.BadParameter(f"Plugin
|
|
323
|
+
raise typer.BadParameter(f"Plugin {plugin_name} is not a directory, nothing to validate")
|
|
294
324
|
|
|
295
325
|
manifest = plugin_name / "CANVAS_MANIFEST.json"
|
|
296
326
|
|
|
297
327
|
if not manifest.exists():
|
|
298
328
|
raise typer.BadParameter(
|
|
299
|
-
f"Plugin
|
|
329
|
+
f"Plugin {plugin_name} does not have a CANVAS_MANIFEST.json file to validate"
|
|
300
330
|
)
|
|
301
331
|
|
|
302
332
|
try:
|
|
303
333
|
manifest_json = json.loads(manifest.read_text())
|
|
334
|
+
|
|
335
|
+
sys.path.append(str(plugin_name.parent.absolute()))
|
|
336
|
+
if new_protocols := _get_protocols_with_new_cqm_properties(
|
|
337
|
+
manifest_json.get("components", {}).get("protocols", [])
|
|
338
|
+
):
|
|
339
|
+
print(
|
|
340
|
+
f"Updating the CANVAS_MANIFEST.json file for {plugin_name} with CQM meta properties"
|
|
341
|
+
)
|
|
342
|
+
manifest_json["components"]["protocols"] = new_protocols
|
|
343
|
+
manifest.write_text(json.dumps(manifest_json))
|
|
344
|
+
manifest_json = json.loads(manifest.read_text())
|
|
345
|
+
|
|
304
346
|
except json.JSONDecodeError:
|
|
305
347
|
print("There was a problem loading the manifest file, please ensure it's valid JSON")
|
|
306
348
|
raise typer.Abort()
|
|
307
349
|
|
|
308
350
|
validate_manifest_file(manifest_json)
|
|
309
351
|
|
|
310
|
-
print(f"Plugin
|
|
352
|
+
print(f"Plugin {plugin_name} has a valid CANVAS_MANIFEST.json file")
|
|
311
353
|
|
|
312
354
|
|
|
313
355
|
def update(
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import shutil
|
|
2
|
+
from datetime import datetime
|
|
3
|
+
from pathlib import Path
|
|
4
|
+
from typing import Any, Generator
|
|
5
|
+
|
|
6
|
+
import pytest
|
|
7
|
+
import typer
|
|
8
|
+
from typer.testing import CliRunner
|
|
9
|
+
|
|
10
|
+
from canvas_cli.main import app
|
|
11
|
+
|
|
12
|
+
from .plugin import validate_package
|
|
13
|
+
|
|
14
|
+
runner = CliRunner()
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
def test_validate_package_unexistant_path() -> None:
|
|
18
|
+
"""Tests the validate_package callback with an invalid folder."""
|
|
19
|
+
with pytest.raises(typer.BadParameter):
|
|
20
|
+
validate_package(Path("/a_random_url_that_will_not_exist_or_so_I_hope"))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
def test_validate_package_wrong_file_type(tmp_path: Path) -> None:
|
|
24
|
+
"""Tests the validate_package callback with an invalid file type."""
|
|
25
|
+
invalid_file = tmp_path / "tmp_file.zip"
|
|
26
|
+
invalid_file.write_text("definitely not a python package")
|
|
27
|
+
|
|
28
|
+
with pytest.raises(typer.BadParameter):
|
|
29
|
+
validate_package(invalid_file)
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
def test_validate_package_valid_file(tmp_path: Path) -> None:
|
|
33
|
+
"""Tests the validate_package callback with a valid file type."""
|
|
34
|
+
package_path = tmp_path / "test-package.whl"
|
|
35
|
+
package_path.write_text("something")
|
|
36
|
+
result = validate_package(package_path)
|
|
37
|
+
assert result == package_path
|
|
38
|
+
|
|
39
|
+
|
|
40
|
+
@pytest.fixture(scope="session")
|
|
41
|
+
def init_plugin_name() -> str:
|
|
42
|
+
"""The plugin name to be used for the canvas cli init test"""
|
|
43
|
+
return f"testing_init-{datetime.now().timestamp()}".replace(".", "")
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
@pytest.fixture(autouse=True, scope="session")
|
|
47
|
+
def clean_up_plugin(init_plugin_name: str) -> Generator[Any, Any, Any]:
|
|
48
|
+
yield
|
|
49
|
+
if Path(f"./{init_plugin_name}").exists():
|
|
50
|
+
shutil.rmtree(Path(f"./{init_plugin_name}"))
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
def test_canvas_init(init_plugin_name: str) -> None:
|
|
54
|
+
"""Tests that the CLI successfully creates a plugin with init."""
|
|
55
|
+
result = runner.invoke(app, "init", input=init_plugin_name)
|
|
56
|
+
assert result.exit_code == 0
|
|
57
|
+
|
|
58
|
+
# plugin directory exists
|
|
59
|
+
plugin = Path(f"./{init_plugin_name}")
|
|
60
|
+
assert plugin.exists()
|
|
61
|
+
assert plugin.is_dir()
|
|
62
|
+
|
|
63
|
+
# manifest file exists
|
|
64
|
+
manifest = Path(f"./{init_plugin_name}/CANVAS_MANIFEST.json")
|
|
65
|
+
assert manifest.exists()
|
|
66
|
+
assert manifest.is_file()
|
|
67
|
+
manifest_result = runner.invoke(app, f"validate-manifest {init_plugin_name}")
|
|
68
|
+
assert manifest_result.exit_code == 0
|
|
69
|
+
|
|
70
|
+
# readme file exists
|
|
71
|
+
readme = Path(f"./{init_plugin_name}/README.md")
|
|
72
|
+
assert readme.exists()
|
|
73
|
+
assert readme.is_file()
|
|
74
|
+
|
|
75
|
+
# protocols dir exists
|
|
76
|
+
protocols = Path(f"./{init_plugin_name}/protocols")
|
|
77
|
+
assert protocols.exists()
|
|
78
|
+
assert protocols.is_dir()
|
|
79
|
+
|
|
80
|
+
# protocol file exists in protocols dir
|
|
81
|
+
protocol = Path(f"./{init_plugin_name}/protocols/my_protocol.py")
|
|
82
|
+
assert protocol.exists()
|
|
83
|
+
assert protocol.is_file()
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import shutil
|
|
3
|
+
from datetime import datetime
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
from typing import Any, Callable, Generator
|
|
6
|
+
from unittest.mock import MagicMock, patch
|
|
7
|
+
from urllib.parse import urlparse
|
|
8
|
+
|
|
9
|
+
import pytest
|
|
10
|
+
from typer.testing import CliRunner
|
|
11
|
+
|
|
12
|
+
import settings
|
|
13
|
+
from canvas_cli.apps.auth.utils import CONFIG_PATH
|
|
14
|
+
|
|
15
|
+
from .main import app
|
|
16
|
+
|
|
17
|
+
runner = CliRunner()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
@pytest.fixture(scope="session")
|
|
21
|
+
def plugin_name() -> str:
|
|
22
|
+
"""The plugin name to be used for the canvas cli test"""
|
|
23
|
+
return f"cli-{datetime.now().timestamp()}".replace(".", "")
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
@pytest.fixture(autouse=True, scope="session")
|
|
27
|
+
def create_or_update_config_auth_file_for_testing(plugin_name: str) -> Generator[Any, Any, Any]:
|
|
28
|
+
"""Creates the necessary config file for auth before performing cli tests."""
|
|
29
|
+
|
|
30
|
+
host = urlparse(settings.INTEGRATION_TEST_URL).hostname.replace(".canvasmedical.com", "")
|
|
31
|
+
client_id = settings.INTEGRATION_TEST_CLIENT_ID
|
|
32
|
+
client_secret = settings.INTEGRATION_TEST_CLIENT_SECRET
|
|
33
|
+
|
|
34
|
+
path = CONFIG_PATH
|
|
35
|
+
if not path.exists():
|
|
36
|
+
if not path.parent.exists():
|
|
37
|
+
path.parent.mkdir()
|
|
38
|
+
path.touch()
|
|
39
|
+
|
|
40
|
+
temp_path = path.parent / "temp_credentials.ini"
|
|
41
|
+
|
|
42
|
+
original_content = open(path, "r").read()
|
|
43
|
+
open(path, "w").writelines(
|
|
44
|
+
[
|
|
45
|
+
f"[{host}]\n",
|
|
46
|
+
f"client_id={client_id}\n",
|
|
47
|
+
f"client_secret={client_secret}\n",
|
|
48
|
+
]
|
|
49
|
+
)
|
|
50
|
+
open(temp_path, "a").write(original_content)
|
|
51
|
+
|
|
52
|
+
yield
|
|
53
|
+
|
|
54
|
+
with open(temp_path, "r") as temp:
|
|
55
|
+
original_content = temp.read()
|
|
56
|
+
with open(path, "w") as f:
|
|
57
|
+
f.write(original_content)
|
|
58
|
+
os.remove(temp_path)
|
|
59
|
+
|
|
60
|
+
|
|
61
|
+
@pytest.fixture(autouse=True, scope="session")
|
|
62
|
+
def write_plugin(plugin_name: str) -> Generator[Any, Any, Any]:
|
|
63
|
+
runner.invoke(app, "init", input=plugin_name)
|
|
64
|
+
protocol = open(f"./{plugin_name}/protocols/my_protocol.py", "w")
|
|
65
|
+
p = """
|
|
66
|
+
from canvas_sdk.events import EventType
|
|
67
|
+
from canvas_sdk.protocols import BaseProtocol
|
|
68
|
+
from logger import log
|
|
69
|
+
|
|
70
|
+
class Protocol(BaseProtocol):
|
|
71
|
+
RESPONDS_TO = EventType.Name(EventType.ASSESS_COMMAND__CONDITION_SELECTED)
|
|
72
|
+
NARRATIVE_STRING = "I was inserted from my plugin's protocol."
|
|
73
|
+
|
|
74
|
+
def compute(self):
|
|
75
|
+
log.info(self.NARRATIVE_STRING)
|
|
76
|
+
return []
|
|
77
|
+
"""
|
|
78
|
+
protocol.write(p)
|
|
79
|
+
protocol.close()
|
|
80
|
+
|
|
81
|
+
yield
|
|
82
|
+
|
|
83
|
+
if Path(f"./{plugin_name}").exists():
|
|
84
|
+
shutil.rmtree(Path(f"./{plugin_name}"))
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
def list_empty_plugins(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
88
|
+
"""Step 1 - list all plugins"""
|
|
89
|
+
return ("list", 0, [], [f"{plugin_name}"])
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
def install_new_plugin(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
93
|
+
"""Step 2 - install a new plugin"""
|
|
94
|
+
return (
|
|
95
|
+
f"install {plugin_name}",
|
|
96
|
+
0,
|
|
97
|
+
[
|
|
98
|
+
f"Plugin {plugin_name} has a valid CANVAS_MANIFEST.json file",
|
|
99
|
+
"Installing plugin:",
|
|
100
|
+
"Posting",
|
|
101
|
+
f"Plugin {plugin_name} successfully installed!",
|
|
102
|
+
],
|
|
103
|
+
[],
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
|
|
107
|
+
def list_newly_installed_plugin(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
108
|
+
"""Step 3 - list all plugins, including newly installed one"""
|
|
109
|
+
return ("list", 0, [f"{plugin_name}@0.0.1 enabled"], [])
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
def disable_plugin(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
113
|
+
"""Step 4 - disable plugin"""
|
|
114
|
+
return (
|
|
115
|
+
f"disable {plugin_name}",
|
|
116
|
+
0,
|
|
117
|
+
[f"Disabling {plugin_name} using ", f"Plugin {plugin_name} successfully disabled!"],
|
|
118
|
+
[],
|
|
119
|
+
)
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
def list_disabled_plugin(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
123
|
+
"""Step 5 - list disabled plugin"""
|
|
124
|
+
return ("list", 0, [f"{plugin_name}@0.0.1 disabled"], [])
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
def enable_plugin(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
128
|
+
"""Step 6 - enable the disabled plugin"""
|
|
129
|
+
return (
|
|
130
|
+
f"enable {plugin_name}",
|
|
131
|
+
0,
|
|
132
|
+
[f"Enabling {plugin_name} using ", f"Plugin {plugin_name} successfully enabled!"],
|
|
133
|
+
[],
|
|
134
|
+
)
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def uninstall_enabled_plugin(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
138
|
+
"""Step 7 - try to uninstall the enabled plugin"""
|
|
139
|
+
return (
|
|
140
|
+
f"uninstall {plugin_name}",
|
|
141
|
+
1,
|
|
142
|
+
[
|
|
143
|
+
f"Uninstalling {plugin_name} using",
|
|
144
|
+
'Status code 403: {"detail":"Cannot delete an enabled plugin."}',
|
|
145
|
+
],
|
|
146
|
+
[],
|
|
147
|
+
)
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
def uninstall_disabled_plugin(plugin_name: str) -> tuple[str, int, list[str], list[str]]:
|
|
151
|
+
"""Step 8 - disable and then uninstall the plugin"""
|
|
152
|
+
runner.invoke(app, f"disable {plugin_name}")
|
|
153
|
+
|
|
154
|
+
return (
|
|
155
|
+
f"uninstall {plugin_name}",
|
|
156
|
+
0,
|
|
157
|
+
[
|
|
158
|
+
f"Uninstalling {plugin_name} using",
|
|
159
|
+
f"Plugin {plugin_name} successfully uninstalled!",
|
|
160
|
+
],
|
|
161
|
+
[],
|
|
162
|
+
)
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
@patch("keyring.get_password")
|
|
166
|
+
@patch("keyring.set_password")
|
|
167
|
+
@pytest.mark.integtest
|
|
168
|
+
@pytest.mark.parametrize(
|
|
169
|
+
"step",
|
|
170
|
+
[
|
|
171
|
+
(list_empty_plugins),
|
|
172
|
+
(install_new_plugin),
|
|
173
|
+
(list_newly_installed_plugin),
|
|
174
|
+
(disable_plugin),
|
|
175
|
+
(list_disabled_plugin),
|
|
176
|
+
(enable_plugin),
|
|
177
|
+
(uninstall_enabled_plugin),
|
|
178
|
+
(uninstall_disabled_plugin),
|
|
179
|
+
(list_empty_plugins),
|
|
180
|
+
],
|
|
181
|
+
)
|
|
182
|
+
def test_canvas_list_install_disable_enable_uninstall(
|
|
183
|
+
mock_get_password: MagicMock,
|
|
184
|
+
mock_set_password: MagicMock,
|
|
185
|
+
plugin_name: str,
|
|
186
|
+
step: Callable,
|
|
187
|
+
) -> None:
|
|
188
|
+
"""Tests that the Canvas CLI can list, install, disable, enable, and uninstall a plugin"""
|
|
189
|
+
mock_get_password.return_value = None
|
|
190
|
+
mock_set_password.return_value = None
|
|
191
|
+
|
|
192
|
+
(command, expected_exit_code, expected_outputs, expected_no_outputs) = step(plugin_name)
|
|
193
|
+
|
|
194
|
+
result = runner.invoke(app, command)
|
|
195
|
+
|
|
196
|
+
assert result.exit_code == expected_exit_code
|
|
197
|
+
for expected_output in expected_outputs:
|
|
198
|
+
assert expected_output in result.stdout
|
|
199
|
+
for expected_no_output in expected_no_outputs:
|
|
200
|
+
assert expected_no_output not in result.stdout
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: canvas_generated/messages/effects.proto
|
|
4
|
+
# Protobuf Python Version: 4.25.0
|
|
5
|
+
"""Generated protocol buffer code."""
|
|
6
|
+
from google.protobuf import descriptor as _descriptor
|
|
7
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
8
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
9
|
+
from google.protobuf.internal import builder as _builder
|
|
10
|
+
# @@protoc_insertion_point(imports)
|
|
11
|
+
|
|
12
|
+
_sym_db = _symbol_database.Default()
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\'canvas_generated/messages/effects.proto\x12\x06\x63\x61nvas\"P\n\x06\x45\x66\x66\x65\x63t\x12 \n\x04type\x18\x01 \x01(\x0e\x32\x12.canvas.EffectType\x12\x0f\n\x07payload\x18\x02 \x01(\t\x12\x13\n\x0bplugin_name\x18\x03 \x01(\t*\xda!\n\nEffectType\x12\x12\n\x0eUNKNOWN_EFFECT\x10\x00\x12\x07\n\x03LOG\x10\x01\x12\x14\n\x10\x41\x44\x44_PLAN_COMMAND\x10\x02\x12\x1f\n\x1b\x41UTOCOMPLETE_SEARCH_RESULTS\x10\x03\x12\x14\n\x10\x41\x44\x44_BANNER_ALERT\x10\x04\x12\x17\n\x13REMOVE_BANNER_ALERT\x10\x05\x12\x1c\n\x18ORIGINATE_ASSESS_COMMAND\x10\x06\x12\x17\n\x13\x45\x44IT_ASSESS_COMMAND\x10\x07\x12\x19\n\x15\x44\x45LETE_ASSESS_COMMAND\x10\x08\x12\x19\n\x15\x43OMMIT_ASSESS_COMMAND\x10\t\x12!\n\x1d\x45NTER_IN_ERROR_ASSESS_COMMAND\x10\n\x12\x1e\n\x1aORIGINATE_DIAGNOSE_COMMAND\x10\x0b\x12\x19\n\x15\x45\x44IT_DIAGNOSE_COMMAND\x10\x0c\x12\x1b\n\x17\x44\x45LETE_DIAGNOSE_COMMAND\x10\r\x12\x1b\n\x17\x43OMMIT_DIAGNOSE_COMMAND\x10\x0e\x12#\n\x1f\x45NTER_IN_ERROR_DIAGNOSE_COMMAND\x10\x0f\x12\x1a\n\x16ORIGINATE_GOAL_COMMAND\x10\x10\x12\x15\n\x11\x45\x44IT_GOAL_COMMAND\x10\x11\x12\x17\n\x13\x44\x45LETE_GOAL_COMMAND\x10\x12\x12\x17\n\x13\x43OMMIT_GOAL_COMMAND\x10\x13\x12\x1f\n\x1b\x45NTER_IN_ERROR_GOAL_COMMAND\x10\x14\x12\x19\n\x15ORIGINATE_HPI_COMMAND\x10\x15\x12\x14\n\x10\x45\x44IT_HPI_COMMAND\x10\x16\x12\x16\n\x12\x44\x45LETE_HPI_COMMAND\x10\x17\x12\x16\n\x12\x43OMMIT_HPI_COMMAND\x10\x18\x12\x1e\n\x1a\x45NTER_IN_ERROR_HPI_COMMAND\x10\x19\x12*\n&ORIGINATE_MEDICATION_STATEMENT_COMMAND\x10\x1a\x12%\n!EDIT_MEDICATION_STATEMENT_COMMAND\x10\x1b\x12\'\n#DELETE_MEDICATION_STATEMENT_COMMAND\x10\x1c\x12\'\n#COMMIT_MEDICATION_STATEMENT_COMMAND\x10\x1d\x12/\n+ENTER_IN_ERROR_MEDICATION_STATEMENT_COMMAND\x10\x1e\x12\x1a\n\x16ORIGINATE_PLAN_COMMAND\x10\x1f\x12\x15\n\x11\x45\x44IT_PLAN_COMMAND\x10 \x12\x17\n\x13\x44\x45LETE_PLAN_COMMAND\x10!\x12\x17\n\x13\x43OMMIT_PLAN_COMMAND\x10\"\x12\x1f\n\x1b\x45NTER_IN_ERROR_PLAN_COMMAND\x10#\x12\x1f\n\x1bORIGINATE_PRESCRIBE_COMMAND\x10$\x12\x1a\n\x16\x45\x44IT_PRESCRIBE_COMMAND\x10%\x12\x1c\n\x18\x44\x45LETE_PRESCRIBE_COMMAND\x10&\x12\x1c\n\x18\x43OMMIT_PRESCRIBE_COMMAND\x10\'\x12$\n ENTER_IN_ERROR_PRESCRIBE_COMMAND\x10(\x12#\n\x1fORIGINATE_QUESTIONNAIRE_COMMAND\x10)\x12\x1e\n\x1a\x45\x44IT_QUESTIONNAIRE_COMMAND\x10*\x12 \n\x1c\x44\x45LETE_QUESTIONNAIRE_COMMAND\x10+\x12 \n\x1c\x43OMMIT_QUESTIONNAIRE_COMMAND\x10,\x12(\n$ENTER_IN_ERROR_QUESTIONNAIRE_COMMAND\x10-\x12&\n\"ORIGINATE_REASON_FOR_VISIT_COMMAND\x10.\x12!\n\x1d\x45\x44IT_REASON_FOR_VISIT_COMMAND\x10/\x12#\n\x1f\x44\x45LETE_REASON_FOR_VISIT_COMMAND\x10\x30\x12#\n\x1f\x43OMMIT_REASON_FOR_VISIT_COMMAND\x10\x31\x12+\n\'ENTER_IN_ERROR_REASON_FOR_VISIT_COMMAND\x10\x32\x12%\n!ORIGINATE_STOP_MEDICATION_COMMAND\x10\x33\x12 \n\x1c\x45\x44IT_STOP_MEDICATION_COMMAND\x10\x34\x12\"\n\x1e\x44\x45LETE_STOP_MEDICATION_COMMAND\x10\x35\x12\"\n\x1e\x43OMMIT_STOP_MEDICATION_COMMAND\x10\x36\x12*\n&ENTER_IN_ERROR_STOP_MEDICATION_COMMAND\x10\x37\x12!\n\x1dORIGINATE_UPDATE_GOAL_COMMAND\x10\x38\x12\x1c\n\x18\x45\x44IT_UPDATE_GOAL_COMMAND\x10\x39\x12\x1e\n\x1a\x44\x45LETE_UPDATE_GOAL_COMMAND\x10:\x12\x1e\n\x1a\x43OMMIT_UPDATE_GOAL_COMMAND\x10;\x12&\n\"ENTER_IN_ERROR_UPDATE_GOAL_COMMAND\x10<\x12\x1d\n\x19ORIGINATE_PERFORM_COMMAND\x10=\x12\x18\n\x14\x45\x44IT_PERFORM_COMMAND\x10>\x12\x1a\n\x16\x44\x45LETE_PERFORM_COMMAND\x10?\x12\x1a\n\x16\x43OMMIT_PERFORM_COMMAND\x10@\x12\"\n\x1e\x45NTER_IN_ERROR_PERFORM_COMMAND\x10\x41\x12\x1e\n\x1aORIGINATE_INSTRUCT_COMMAND\x10\x42\x12\x19\n\x15\x45\x44IT_INSTRUCT_COMMAND\x10\x43\x12\x1b\n\x17\x44\x45LETE_INSTRUCT_COMMAND\x10\x44\x12\x1b\n\x17\x43OMMIT_INSTRUCT_COMMAND\x10\x45\x12#\n\x1f\x45NTER_IN_ERROR_INSTRUCT_COMMAND\x10\x46\x12\x1f\n\x1bORIGINATE_LAB_ORDER_COMMAND\x10G\x12\x1a\n\x16\x45\x44IT_LAB_ORDER_COMMAND\x10H\x12\x1c\n\x18\x44\x45LETE_LAB_ORDER_COMMAND\x10I\x12\x1c\n\x18\x43OMMIT_LAB_ORDER_COMMAND\x10J\x12$\n ENTER_IN_ERROR_LAB_ORDER_COMMAND\x10K\x12$\n ORIGINATE_FAMILY_HISTORY_COMMAND\x10L\x12\x1f\n\x1b\x45\x44IT_FAMILY_HISTORY_COMMAND\x10M\x12!\n\x1d\x44\x45LETE_FAMILY_HISTORY_COMMAND\x10N\x12!\n\x1d\x43OMMIT_FAMILY_HISTORY_COMMAND\x10O\x12)\n%ENTER_IN_ERROR_FAMILY_HISTORY_COMMAND\x10P\x12\x1d\n\x19ORIGINATE_ALLERGY_COMMAND\x10Q\x12\x18\n\x14\x45\x44IT_ALLERGY_COMMAND\x10R\x12\x1a\n\x16\x44\x45LETE_ALLERGY_COMMAND\x10S\x12\x1a\n\x16\x43OMMIT_ALLERGY_COMMAND\x10T\x12\"\n\x1e\x45NTER_IN_ERROR_ALLERGY_COMMAND\x10U\x12$\n ORIGINATE_REMOVE_ALLERGY_COMMAND\x10V\x12\x1f\n\x1b\x45\x44IT_REMOVE_ALLERGY_COMMAND\x10W\x12!\n\x1d\x44\x45LETE_REMOVE_ALLERGY_COMMAND\x10X\x12!\n\x1d\x43OMMIT_REMOVE_ALLERGY_COMMAND\x10Y\x12)\n%ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND\x10Z\x12&\n\"ORIGINATE_SURGICAL_HISTORY_COMMAND\x10[\x12!\n\x1d\x45\x44IT_SURGICAL_HISTORY_COMMAND\x10\\\x12#\n\x1f\x44\x45LETE_SURGICAL_HISTORY_COMMAND\x10]\x12#\n\x1f\x43OMMIT_SURGICAL_HISTORY_COMMAND\x10^\x12+\n\'ENTER_IN_ERROR_SURGICAL_HISTORY_COMMAND\x10_\x12\x0f\n\x0b\x43REATE_TASK\x10\x64\x12\x0f\n\x0bUPDATE_TASK\x10\x65\x12\x17\n\x13\x43REATE_TASK_COMMENT\x10\x66\x12%\n!ORIGINATE_MEDICAL_HISTORY_COMMAND\x10g\x12 \n\x1c\x45\x44IT_MEDICAL_HISTORY_COMMAND\x10h\x12\"\n\x1e\x44\x45LETE_MEDICAL_HISTORY_COMMAND\x10i\x12\"\n\x1e\x43OMMIT_MEDICAL_HISTORY_COMMAND\x10j\x12*\n&ENTER_IN_ERROR_MEDICAL_HISTORY_COMMAND\x10k\x12\x1f\n\x1b\x41\x44\x44_OR_UPDATE_PROTOCOL_CARD\x10n\x12\x1b\n\x16ORIGINATE_TASK_COMMAND\x10\x85\x01\x12\x16\n\x11\x45\x44IT_TASK_COMMAND\x10\x86\x01\x12\x18\n\x13\x44\x45LETE_TASK_COMMAND\x10\x87\x01\x12\x18\n\x13\x43OMMIT_TASK_COMMAND\x10\x88\x01\x12 \n\x1b\x45NTER_IN_ERROR_TASK_COMMAND\x10\x89\x01\x12\x1c\n\x18ORIGINATE_REFILL_COMMAND\x10q\x12\x17\n\x13\x45\x44IT_REFILL_COMMAND\x10r\x12\x19\n\x15\x44\x45LETE_REFILL_COMMAND\x10s\x12\x19\n\x15\x43OMMIT_REFILL_COMMAND\x10t\x12!\n\x1d\x45NTER_IN_ERROR_REFILL_COMMAND\x10u\x12\x1c\n\x18ORIGINATE_VITALS_COMMAND\x10v\x12\x17\n\x13\x45\x44IT_VITALS_COMMAND\x10w\x12\x19\n\x15\x44\x45LETE_VITALS_COMMAND\x10x\x12\x19\n\x15\x43OMMIT_VITALS_COMMAND\x10y\x12!\n\x1d\x45NTER_IN_ERROR_VITALS_COMMAND\x10z\x12&\n\"ORIGINATE_UPDATE_DIAGNOSIS_COMMAND\x10{\x12!\n\x1d\x45\x44IT_UPDATE_DIAGNOSIS_COMMAND\x10|\x12#\n\x1f\x44\x45LETE_UPDATE_DIAGNOSIS_COMMAND\x10}\x12#\n\x1f\x43OMMIT_UPDATE_DIAGNOSIS_COMMAND\x10~\x12+\n\'ENTER_IN_ERROR_UPDATE_DIAGNOSIS_COMMAND\x10\x7f\x12!\n\x1cORIGINATE_CLOSE_GOAL_COMMAND\x10\x80\x01\x12\x1c\n\x17\x45\x44IT_CLOSE_GOAL_COMMAND\x10\x81\x01\x12\x1e\n\x19\x44\x45LETE_CLOSE_GOAL_COMMAND\x10\x82\x01\x12\x1e\n\x19\x43OMMIT_CLOSE_GOAL_COMMAND\x10\x83\x01\x12&\n!ENTER_IN_ERROR_CLOSE_GOAL_COMMAND\x10\x84\x01\x12-\n(ANNOTATE_PATIENT_CHART_CONDITION_RESULTS\x10\xc8\x01\x12%\n ANNOTATE_CLAIM_CONDITION_RESULTS\x10\xac\x02\x12(\n#SHOW_PATIENT_CHART_SUMMARY_SECTIONS\x10\x90\x03\x62\x06proto3')
|
|
18
|
+
|
|
19
|
+
_globals = globals()
|
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'canvas_generated.messages.effects_pb2', _globals)
|
|
22
|
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
23
|
+
DESCRIPTOR._options = None
|
|
24
|
+
_globals['_EFFECTTYPE']._serialized_start=134
|
|
25
|
+
_globals['_EFFECTTYPE']._serialized_end=4448
|
|
26
|
+
_globals['_EFFECT']._serialized_start=51
|
|
27
|
+
_globals['_EFFECT']._serialized_end=131
|
|
28
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -68,10 +68,78 @@ class EffectType(int, metaclass=_enum_type_wrapper.EnumTypeWrapper):
|
|
|
68
68
|
DELETE_UPDATE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
69
69
|
COMMIT_UPDATE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
70
70
|
ENTER_IN_ERROR_UPDATE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
71
|
+
ORIGINATE_PERFORM_COMMAND: _ClassVar[EffectType]
|
|
72
|
+
EDIT_PERFORM_COMMAND: _ClassVar[EffectType]
|
|
73
|
+
DELETE_PERFORM_COMMAND: _ClassVar[EffectType]
|
|
74
|
+
COMMIT_PERFORM_COMMAND: _ClassVar[EffectType]
|
|
75
|
+
ENTER_IN_ERROR_PERFORM_COMMAND: _ClassVar[EffectType]
|
|
76
|
+
ORIGINATE_INSTRUCT_COMMAND: _ClassVar[EffectType]
|
|
77
|
+
EDIT_INSTRUCT_COMMAND: _ClassVar[EffectType]
|
|
78
|
+
DELETE_INSTRUCT_COMMAND: _ClassVar[EffectType]
|
|
79
|
+
COMMIT_INSTRUCT_COMMAND: _ClassVar[EffectType]
|
|
80
|
+
ENTER_IN_ERROR_INSTRUCT_COMMAND: _ClassVar[EffectType]
|
|
81
|
+
ORIGINATE_LAB_ORDER_COMMAND: _ClassVar[EffectType]
|
|
82
|
+
EDIT_LAB_ORDER_COMMAND: _ClassVar[EffectType]
|
|
83
|
+
DELETE_LAB_ORDER_COMMAND: _ClassVar[EffectType]
|
|
84
|
+
COMMIT_LAB_ORDER_COMMAND: _ClassVar[EffectType]
|
|
85
|
+
ENTER_IN_ERROR_LAB_ORDER_COMMAND: _ClassVar[EffectType]
|
|
86
|
+
ORIGINATE_FAMILY_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
87
|
+
EDIT_FAMILY_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
88
|
+
DELETE_FAMILY_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
89
|
+
COMMIT_FAMILY_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
90
|
+
ENTER_IN_ERROR_FAMILY_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
91
|
+
ORIGINATE_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
92
|
+
EDIT_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
93
|
+
DELETE_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
94
|
+
COMMIT_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
95
|
+
ENTER_IN_ERROR_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
96
|
+
ORIGINATE_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
97
|
+
EDIT_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
98
|
+
DELETE_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
99
|
+
COMMIT_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
100
|
+
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND: _ClassVar[EffectType]
|
|
101
|
+
ORIGINATE_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
102
|
+
EDIT_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
103
|
+
DELETE_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
104
|
+
COMMIT_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
105
|
+
ENTER_IN_ERROR_SURGICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
71
106
|
CREATE_TASK: _ClassVar[EffectType]
|
|
72
107
|
UPDATE_TASK: _ClassVar[EffectType]
|
|
73
108
|
CREATE_TASK_COMMENT: _ClassVar[EffectType]
|
|
109
|
+
ORIGINATE_MEDICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
110
|
+
EDIT_MEDICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
111
|
+
DELETE_MEDICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
112
|
+
COMMIT_MEDICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
113
|
+
ENTER_IN_ERROR_MEDICAL_HISTORY_COMMAND: _ClassVar[EffectType]
|
|
114
|
+
ADD_OR_UPDATE_PROTOCOL_CARD: _ClassVar[EffectType]
|
|
115
|
+
ORIGINATE_TASK_COMMAND: _ClassVar[EffectType]
|
|
116
|
+
EDIT_TASK_COMMAND: _ClassVar[EffectType]
|
|
117
|
+
DELETE_TASK_COMMAND: _ClassVar[EffectType]
|
|
118
|
+
COMMIT_TASK_COMMAND: _ClassVar[EffectType]
|
|
119
|
+
ENTER_IN_ERROR_TASK_COMMAND: _ClassVar[EffectType]
|
|
120
|
+
ORIGINATE_REFILL_COMMAND: _ClassVar[EffectType]
|
|
121
|
+
EDIT_REFILL_COMMAND: _ClassVar[EffectType]
|
|
122
|
+
DELETE_REFILL_COMMAND: _ClassVar[EffectType]
|
|
123
|
+
COMMIT_REFILL_COMMAND: _ClassVar[EffectType]
|
|
124
|
+
ENTER_IN_ERROR_REFILL_COMMAND: _ClassVar[EffectType]
|
|
125
|
+
ORIGINATE_VITALS_COMMAND: _ClassVar[EffectType]
|
|
126
|
+
EDIT_VITALS_COMMAND: _ClassVar[EffectType]
|
|
127
|
+
DELETE_VITALS_COMMAND: _ClassVar[EffectType]
|
|
128
|
+
COMMIT_VITALS_COMMAND: _ClassVar[EffectType]
|
|
129
|
+
ENTER_IN_ERROR_VITALS_COMMAND: _ClassVar[EffectType]
|
|
130
|
+
ORIGINATE_UPDATE_DIAGNOSIS_COMMAND: _ClassVar[EffectType]
|
|
131
|
+
EDIT_UPDATE_DIAGNOSIS_COMMAND: _ClassVar[EffectType]
|
|
132
|
+
DELETE_UPDATE_DIAGNOSIS_COMMAND: _ClassVar[EffectType]
|
|
133
|
+
COMMIT_UPDATE_DIAGNOSIS_COMMAND: _ClassVar[EffectType]
|
|
134
|
+
ENTER_IN_ERROR_UPDATE_DIAGNOSIS_COMMAND: _ClassVar[EffectType]
|
|
135
|
+
ORIGINATE_CLOSE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
136
|
+
EDIT_CLOSE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
137
|
+
DELETE_CLOSE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
138
|
+
COMMIT_CLOSE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
139
|
+
ENTER_IN_ERROR_CLOSE_GOAL_COMMAND: _ClassVar[EffectType]
|
|
74
140
|
ANNOTATE_PATIENT_CHART_CONDITION_RESULTS: _ClassVar[EffectType]
|
|
141
|
+
ANNOTATE_CLAIM_CONDITION_RESULTS: _ClassVar[EffectType]
|
|
142
|
+
SHOW_PATIENT_CHART_SUMMARY_SECTIONS: _ClassVar[EffectType]
|
|
75
143
|
UNKNOWN_EFFECT: EffectType
|
|
76
144
|
LOG: EffectType
|
|
77
145
|
ADD_PLAN_COMMAND: EffectType
|
|
@@ -133,10 +201,78 @@ EDIT_UPDATE_GOAL_COMMAND: EffectType
|
|
|
133
201
|
DELETE_UPDATE_GOAL_COMMAND: EffectType
|
|
134
202
|
COMMIT_UPDATE_GOAL_COMMAND: EffectType
|
|
135
203
|
ENTER_IN_ERROR_UPDATE_GOAL_COMMAND: EffectType
|
|
204
|
+
ORIGINATE_PERFORM_COMMAND: EffectType
|
|
205
|
+
EDIT_PERFORM_COMMAND: EffectType
|
|
206
|
+
DELETE_PERFORM_COMMAND: EffectType
|
|
207
|
+
COMMIT_PERFORM_COMMAND: EffectType
|
|
208
|
+
ENTER_IN_ERROR_PERFORM_COMMAND: EffectType
|
|
209
|
+
ORIGINATE_INSTRUCT_COMMAND: EffectType
|
|
210
|
+
EDIT_INSTRUCT_COMMAND: EffectType
|
|
211
|
+
DELETE_INSTRUCT_COMMAND: EffectType
|
|
212
|
+
COMMIT_INSTRUCT_COMMAND: EffectType
|
|
213
|
+
ENTER_IN_ERROR_INSTRUCT_COMMAND: EffectType
|
|
214
|
+
ORIGINATE_LAB_ORDER_COMMAND: EffectType
|
|
215
|
+
EDIT_LAB_ORDER_COMMAND: EffectType
|
|
216
|
+
DELETE_LAB_ORDER_COMMAND: EffectType
|
|
217
|
+
COMMIT_LAB_ORDER_COMMAND: EffectType
|
|
218
|
+
ENTER_IN_ERROR_LAB_ORDER_COMMAND: EffectType
|
|
219
|
+
ORIGINATE_FAMILY_HISTORY_COMMAND: EffectType
|
|
220
|
+
EDIT_FAMILY_HISTORY_COMMAND: EffectType
|
|
221
|
+
DELETE_FAMILY_HISTORY_COMMAND: EffectType
|
|
222
|
+
COMMIT_FAMILY_HISTORY_COMMAND: EffectType
|
|
223
|
+
ENTER_IN_ERROR_FAMILY_HISTORY_COMMAND: EffectType
|
|
224
|
+
ORIGINATE_ALLERGY_COMMAND: EffectType
|
|
225
|
+
EDIT_ALLERGY_COMMAND: EffectType
|
|
226
|
+
DELETE_ALLERGY_COMMAND: EffectType
|
|
227
|
+
COMMIT_ALLERGY_COMMAND: EffectType
|
|
228
|
+
ENTER_IN_ERROR_ALLERGY_COMMAND: EffectType
|
|
229
|
+
ORIGINATE_REMOVE_ALLERGY_COMMAND: EffectType
|
|
230
|
+
EDIT_REMOVE_ALLERGY_COMMAND: EffectType
|
|
231
|
+
DELETE_REMOVE_ALLERGY_COMMAND: EffectType
|
|
232
|
+
COMMIT_REMOVE_ALLERGY_COMMAND: EffectType
|
|
233
|
+
ENTER_IN_ERROR_REMOVE_ALLERGY_COMMAND: EffectType
|
|
234
|
+
ORIGINATE_SURGICAL_HISTORY_COMMAND: EffectType
|
|
235
|
+
EDIT_SURGICAL_HISTORY_COMMAND: EffectType
|
|
236
|
+
DELETE_SURGICAL_HISTORY_COMMAND: EffectType
|
|
237
|
+
COMMIT_SURGICAL_HISTORY_COMMAND: EffectType
|
|
238
|
+
ENTER_IN_ERROR_SURGICAL_HISTORY_COMMAND: EffectType
|
|
136
239
|
CREATE_TASK: EffectType
|
|
137
240
|
UPDATE_TASK: EffectType
|
|
138
241
|
CREATE_TASK_COMMENT: EffectType
|
|
242
|
+
ORIGINATE_MEDICAL_HISTORY_COMMAND: EffectType
|
|
243
|
+
EDIT_MEDICAL_HISTORY_COMMAND: EffectType
|
|
244
|
+
DELETE_MEDICAL_HISTORY_COMMAND: EffectType
|
|
245
|
+
COMMIT_MEDICAL_HISTORY_COMMAND: EffectType
|
|
246
|
+
ENTER_IN_ERROR_MEDICAL_HISTORY_COMMAND: EffectType
|
|
247
|
+
ADD_OR_UPDATE_PROTOCOL_CARD: EffectType
|
|
248
|
+
ORIGINATE_TASK_COMMAND: EffectType
|
|
249
|
+
EDIT_TASK_COMMAND: EffectType
|
|
250
|
+
DELETE_TASK_COMMAND: EffectType
|
|
251
|
+
COMMIT_TASK_COMMAND: EffectType
|
|
252
|
+
ENTER_IN_ERROR_TASK_COMMAND: EffectType
|
|
253
|
+
ORIGINATE_REFILL_COMMAND: EffectType
|
|
254
|
+
EDIT_REFILL_COMMAND: EffectType
|
|
255
|
+
DELETE_REFILL_COMMAND: EffectType
|
|
256
|
+
COMMIT_REFILL_COMMAND: EffectType
|
|
257
|
+
ENTER_IN_ERROR_REFILL_COMMAND: EffectType
|
|
258
|
+
ORIGINATE_VITALS_COMMAND: EffectType
|
|
259
|
+
EDIT_VITALS_COMMAND: EffectType
|
|
260
|
+
DELETE_VITALS_COMMAND: EffectType
|
|
261
|
+
COMMIT_VITALS_COMMAND: EffectType
|
|
262
|
+
ENTER_IN_ERROR_VITALS_COMMAND: EffectType
|
|
263
|
+
ORIGINATE_UPDATE_DIAGNOSIS_COMMAND: EffectType
|
|
264
|
+
EDIT_UPDATE_DIAGNOSIS_COMMAND: EffectType
|
|
265
|
+
DELETE_UPDATE_DIAGNOSIS_COMMAND: EffectType
|
|
266
|
+
COMMIT_UPDATE_DIAGNOSIS_COMMAND: EffectType
|
|
267
|
+
ENTER_IN_ERROR_UPDATE_DIAGNOSIS_COMMAND: EffectType
|
|
268
|
+
ORIGINATE_CLOSE_GOAL_COMMAND: EffectType
|
|
269
|
+
EDIT_CLOSE_GOAL_COMMAND: EffectType
|
|
270
|
+
DELETE_CLOSE_GOAL_COMMAND: EffectType
|
|
271
|
+
COMMIT_CLOSE_GOAL_COMMAND: EffectType
|
|
272
|
+
ENTER_IN_ERROR_CLOSE_GOAL_COMMAND: EffectType
|
|
139
273
|
ANNOTATE_PATIENT_CHART_CONDITION_RESULTS: EffectType
|
|
274
|
+
ANNOTATE_CLAIM_CONDITION_RESULTS: EffectType
|
|
275
|
+
SHOW_PATIENT_CHART_SUMMARY_SECTIONS: EffectType
|
|
140
276
|
|
|
141
277
|
class Effect(_message.Message):
|
|
142
278
|
__slots__ = ("type", "payload", "plugin_name")
|