canvas 0.32.0__py3-none-any.whl → 0.33.1__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.

Files changed (257) hide show
  1. {canvas-0.32.0.dist-info → canvas-0.33.1.dist-info}/METADATA +2 -1
  2. canvas-0.33.1.dist-info/RECORD +272 -0
  3. canvas_generated/messages/effects_pb2.py +2 -2
  4. canvas_generated/messages/effects_pb2.pyi +4 -0
  5. canvas_sdk/__init__.py +3 -0
  6. canvas_sdk/commands/__init__.py +1 -1
  7. canvas_sdk/commands/base.py +3 -0
  8. canvas_sdk/commands/commands/__init__.py +1 -0
  9. canvas_sdk/commands/commands/adjust_prescription.py +3 -0
  10. canvas_sdk/commands/commands/allergy.py +7 -0
  11. canvas_sdk/commands/commands/assess.py +2 -0
  12. canvas_sdk/commands/commands/close_goal.py +3 -0
  13. canvas_sdk/commands/commands/diagnose.py +3 -0
  14. canvas_sdk/commands/commands/exam.py +3 -0
  15. canvas_sdk/commands/commands/family_history.py +3 -0
  16. canvas_sdk/commands/commands/follow_up.py +3 -0
  17. canvas_sdk/commands/commands/goal.py +3 -0
  18. canvas_sdk/commands/commands/history_present_illness.py +3 -0
  19. canvas_sdk/commands/commands/imaging_order.py +3 -0
  20. canvas_sdk/commands/commands/instruct.py +3 -0
  21. canvas_sdk/commands/commands/lab_order.py +3 -0
  22. canvas_sdk/commands/commands/medical_history.py +3 -0
  23. canvas_sdk/commands/commands/medication_statement.py +2 -0
  24. canvas_sdk/commands/commands/past_surgical_history.py +3 -0
  25. canvas_sdk/commands/commands/perform.py +3 -0
  26. canvas_sdk/commands/commands/plan.py +3 -0
  27. canvas_sdk/commands/commands/prescribe.py +8 -0
  28. canvas_sdk/commands/commands/questionnaire/__init__.py +3 -13
  29. canvas_sdk/commands/commands/questionnaire/question.py +10 -0
  30. canvas_sdk/commands/commands/reason_for_visit.py +3 -0
  31. canvas_sdk/commands/commands/refer.py +3 -0
  32. canvas_sdk/commands/commands/refill.py +3 -0
  33. canvas_sdk/commands/commands/remove_allergy.py +3 -0
  34. canvas_sdk/commands/commands/resolve_condition.py +3 -0
  35. canvas_sdk/commands/commands/review_of_systems.py +3 -0
  36. canvas_sdk/commands/commands/stop_medication.py +3 -0
  37. canvas_sdk/commands/commands/structured_assessment.py +3 -0
  38. canvas_sdk/commands/commands/task.py +7 -0
  39. canvas_sdk/commands/commands/update_diagnosis.py +3 -0
  40. canvas_sdk/commands/commands/update_goal.py +3 -0
  41. canvas_sdk/commands/commands/vitals.py +3 -0
  42. canvas_sdk/commands/constants.py +8 -0
  43. canvas_sdk/effects/__init__.py +1 -1
  44. canvas_sdk/effects/banner_alert/__init__.py +1 -1
  45. canvas_sdk/effects/banner_alert/add_banner_alert.py +3 -0
  46. canvas_sdk/effects/banner_alert/remove_banner_alert.py +3 -0
  47. canvas_sdk/effects/base.py +7 -0
  48. canvas_sdk/effects/billing_line_item/__init__.py +5 -1
  49. canvas_sdk/effects/billing_line_item/add_billing_line_item.py +3 -0
  50. canvas_sdk/effects/billing_line_item/remove_billing_line_item.py +3 -0
  51. canvas_sdk/effects/billing_line_item/update_billing_line_item.py +3 -0
  52. canvas_sdk/effects/launch_modal.py +3 -0
  53. canvas_sdk/effects/patient_chart_summary_configuration.py +3 -0
  54. canvas_sdk/effects/patient_portal/__init__.py +1 -0
  55. canvas_sdk/effects/patient_portal/application_configuration.py +3 -0
  56. canvas_sdk/effects/patient_portal/form_result.py +3 -0
  57. canvas_sdk/effects/patient_portal_menu_configuration.py +3 -0
  58. canvas_sdk/effects/patient_profile_configuration.py +6 -1
  59. canvas_sdk/effects/protocol_card/__init__.py +1 -1
  60. canvas_sdk/effects/protocol_card/protocol_card.py +6 -0
  61. canvas_sdk/effects/questionnaire_result.py +3 -0
  62. canvas_sdk/effects/send_invite.py +46 -0
  63. canvas_sdk/effects/show_button.py +3 -0
  64. canvas_sdk/effects/simple_api.py +9 -0
  65. canvas_sdk/effects/surescripts/__init__.py +2 -2
  66. canvas_sdk/effects/surescripts/surescripts_messages.py +7 -0
  67. canvas_sdk/effects/task/__init__.py +6 -1
  68. canvas_sdk/effects/task/task.py +8 -0
  69. canvas_sdk/effects/update_user.py +81 -0
  70. canvas_sdk/effects/widgets/__init__.py +1 -1
  71. canvas_sdk/effects/widgets/portal_widget.py +3 -0
  72. canvas_sdk/events/__init__.py +6 -1
  73. canvas_sdk/events/base.py +3 -0
  74. canvas_sdk/handlers/__init__.py +1 -1
  75. canvas_sdk/handlers/action_button.py +6 -0
  76. canvas_sdk/handlers/application.py +3 -0
  77. canvas_sdk/handlers/base.py +3 -0
  78. canvas_sdk/handlers/cron_task.py +3 -0
  79. canvas_sdk/handlers/simple_api/__init__.py +3 -2
  80. canvas_sdk/handlers/simple_api/api.py +26 -1
  81. canvas_sdk/handlers/simple_api/exceptions.py +10 -0
  82. canvas_sdk/handlers/simple_api/security.py +21 -5
  83. canvas_sdk/handlers/simple_api/tools.py +9 -0
  84. canvas_sdk/protocols/__init__.py +1 -1
  85. canvas_sdk/protocols/base.py +3 -0
  86. canvas_sdk/protocols/clinical_quality_measure.py +6 -1
  87. canvas_sdk/protocols/timeframe.py +3 -0
  88. canvas_sdk/questionnaires/__init__.py +1 -1
  89. canvas_sdk/questionnaires/utils.py +7 -0
  90. canvas_sdk/templates/__init__.py +1 -1
  91. canvas_sdk/templates/utils.py +3 -0
  92. canvas_sdk/utils/__init__.py +1 -1
  93. canvas_sdk/utils/http.py +69 -35
  94. canvas_sdk/utils/plugins.py +4 -0
  95. canvas_sdk/utils/stats.py +11 -0
  96. canvas_sdk/v1/__init__.py +1 -0
  97. canvas_sdk/v1/apps.py +3 -0
  98. canvas_sdk/v1/data/__init__.py +2 -2
  99. canvas_sdk/v1/data/allergy_intolerance.py +3 -0
  100. canvas_sdk/v1/data/appointment.py +7 -0
  101. canvas_sdk/v1/data/assessment.py +3 -0
  102. canvas_sdk/v1/data/banner_alert.py +3 -0
  103. canvas_sdk/v1/data/base.py +3 -0
  104. canvas_sdk/v1/data/billing.py +7 -0
  105. canvas_sdk/v1/data/care_team.py +7 -0
  106. canvas_sdk/v1/data/command.py +3 -0
  107. canvas_sdk/v1/data/common.py +18 -0
  108. canvas_sdk/v1/data/condition.py +7 -0
  109. canvas_sdk/v1/data/coverage.py +14 -0
  110. canvas_sdk/v1/data/detected_issue.py +3 -0
  111. canvas_sdk/v1/data/device.py +3 -0
  112. canvas_sdk/v1/data/imaging.py +7 -0
  113. canvas_sdk/v1/data/lab.py +16 -0
  114. canvas_sdk/v1/data/medication.py +3 -0
  115. canvas_sdk/v1/data/note.py +9 -0
  116. canvas_sdk/v1/data/observation.py +9 -0
  117. canvas_sdk/v1/data/organization.py +3 -0
  118. canvas_sdk/v1/data/patient.py +20 -3
  119. canvas_sdk/v1/data/practicelocation.py +7 -0
  120. canvas_sdk/v1/data/protocol_override.py +7 -0
  121. canvas_sdk/v1/data/questionnaire.py +16 -3
  122. canvas_sdk/v1/data/reason_for_visit.py +3 -0
  123. canvas_sdk/v1/data/staff.py +3 -0
  124. canvas_sdk/v1/data/task.py +12 -0
  125. canvas_sdk/v1/data/team.py +8 -1
  126. canvas_sdk/v1/data/user.py +5 -1
  127. canvas_sdk/v1/models.py +2 -0
  128. canvas_sdk/value_set/__init__.py +1 -0
  129. canvas_sdk/value_set/_utilities.py +16 -0
  130. canvas_sdk/value_set/custom.py +4 -0
  131. canvas_sdk/value_set/hcc2018.py +3 -0
  132. canvas_sdk/value_set/v2022/__init__.py +1 -0
  133. canvas_sdk/value_set/v2022/adverse_event.py +3 -0
  134. canvas_sdk/value_set/v2022/allergy.py +5 -0
  135. canvas_sdk/value_set/v2022/assessment.py +5 -0
  136. canvas_sdk/value_set/v2022/communication.py +5 -0
  137. canvas_sdk/value_set/v2022/condition.py +5 -0
  138. canvas_sdk/value_set/v2022/device.py +5 -0
  139. canvas_sdk/value_set/v2022/diagnostic_study.py +5 -0
  140. canvas_sdk/value_set/v2022/encounter.py +5 -0
  141. canvas_sdk/value_set/v2022/immunization.py +5 -0
  142. canvas_sdk/value_set/v2022/individual_characteristic.py +5 -0
  143. canvas_sdk/value_set/v2022/intervention.py +5 -0
  144. canvas_sdk/value_set/v2022/laboratory_test.py +5 -0
  145. canvas_sdk/value_set/v2022/medication.py +5 -0
  146. canvas_sdk/value_set/v2022/physical_exam.py +5 -0
  147. canvas_sdk/value_set/v2022/procedure.py +5 -0
  148. canvas_sdk/value_set/v2022/symptom.py +3 -0
  149. canvas_sdk/value_set/value_set.py +9 -0
  150. canvas_sdk/views/__init__.py +1 -0
  151. logger/__init__.py +2 -0
  152. logger/logger.py +3 -0
  153. plugin_runner/aws_headers.py +1 -1
  154. plugin_runner/load_all_plugins.py +202 -0
  155. plugin_runner/plugin_runner.py +26 -24
  156. plugin_runner/sandbox.py +497 -115
  157. protobufs/canvas_generated/messages/effects.proto +3 -0
  158. settings.py +5 -2
  159. canvas-0.32.0.dist-info/RECORD +0 -364
  160. canvas_cli/apps/auth/tests.py +0 -155
  161. canvas_cli/apps/plugin/tests.py +0 -85
  162. canvas_cli/conftest.py +0 -28
  163. canvas_cli/tests.py +0 -217
  164. canvas_cli/utils/context/tests.py +0 -131
  165. canvas_cli/utils/print/tests.py +0 -69
  166. canvas_cli/utils/urls/tests.py +0 -12
  167. canvas_cli/utils/validators/tests.py +0 -37
  168. canvas_sdk/commands/tests/protocol/__init__.py +0 -0
  169. canvas_sdk/commands/tests/protocol/tests.py +0 -83
  170. canvas_sdk/commands/tests/schema/__init__.py +0 -0
  171. canvas_sdk/commands/tests/schema/tests.py +0 -108
  172. canvas_sdk/commands/tests/test_base_command.py +0 -81
  173. canvas_sdk/commands/tests/test_utils.py +0 -375
  174. canvas_sdk/commands/tests/unit/__init__.py +0 -0
  175. canvas_sdk/commands/tests/unit/tests.py +0 -278
  176. canvas_sdk/effects/banner_alert/tests.py +0 -288
  177. canvas_sdk/effects/protocol_card/tests.py +0 -191
  178. canvas_sdk/questionnaires/tests/__init__.py +0 -0
  179. canvas_sdk/questionnaires/tests/test_utils.py +0 -74
  180. canvas_sdk/templates/tests/__init__.py +0 -0
  181. canvas_sdk/templates/tests/test_utils.py +0 -43
  182. canvas_sdk/tests/__init__.py +0 -0
  183. canvas_sdk/tests/handlers/__init__.py +0 -0
  184. canvas_sdk/tests/handlers/test_simple_api.py +0 -1167
  185. canvas_sdk/utils/tests.py +0 -72
  186. canvas_sdk/value_set/tests/test_value_sets.py +0 -72
  187. plugin_runner/tests/__init__.py +0 -0
  188. plugin_runner/tests/fixtures/plugins/example_plugin/CANVAS_MANIFEST.json +0 -29
  189. plugin_runner/tests/fixtures/plugins/example_plugin/README.md +0 -12
  190. plugin_runner/tests/fixtures/plugins/example_plugin/__init__.py +0 -0
  191. plugin_runner/tests/fixtures/plugins/example_plugin/protocols/__init__.py +0 -0
  192. plugin_runner/tests/fixtures/plugins/example_plugin/protocols/my_protocol.py +0 -18
  193. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/CANVAS_MANIFEST.json +0 -38
  194. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/README.md +0 -11
  195. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/protocols/__init__.py +0 -0
  196. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/protocols/my_protocol.py +0 -33
  197. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/templates/__init__.py +0 -3
  198. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/templates/base.py +0 -6
  199. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/utils/__init__.py +0 -5
  200. plugin_runner/tests/fixtures/plugins/test_implicit_imports_plugin/utils/base.py +0 -4
  201. plugin_runner/tests/fixtures/plugins/test_load_questionnaire/CANVAS_MANIFEST.json +0 -52
  202. plugin_runner/tests/fixtures/plugins/test_load_questionnaire/README.md +0 -11
  203. plugin_runner/tests/fixtures/plugins/test_load_questionnaire/protocols/__init__.py +0 -0
  204. plugin_runner/tests/fixtures/plugins/test_load_questionnaire/protocols/my_protocol.py +0 -39
  205. plugin_runner/tests/fixtures/plugins/test_load_questionnaire/questionnaires/example_questionnaire.yml +0 -61
  206. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_plugin/CANVAS_MANIFEST.json +0 -29
  207. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_plugin/README.md +0 -12
  208. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_plugin/other_module/__init__.py +0 -0
  209. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_plugin/other_module/base.py +0 -10
  210. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_plugin/protocols/__init__.py +0 -0
  211. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_plugin/protocols/my_protocol.py +0 -18
  212. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_runtime_plugin/CANVAS_MANIFEST.json +0 -29
  213. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_runtime_plugin/README.md +0 -12
  214. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_runtime_plugin/other_module/__init__.py +0 -0
  215. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_runtime_plugin/other_module/base.py +0 -10
  216. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_runtime_plugin/protocols/__init__.py +0 -0
  217. plugin_runner/tests/fixtures/plugins/test_module_forbidden_imports_runtime_plugin/protocols/my_protocol.py +0 -18
  218. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v1/CANVAS_MANIFEST.json +0 -29
  219. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v1/README.md +0 -12
  220. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v1/other_module/__init__.py +0 -0
  221. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v1/other_module/base.py +0 -3
  222. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v1/protocols/__init__.py +0 -0
  223. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v1/protocols/my_protocol.py +0 -18
  224. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v2/CANVAS_MANIFEST.json +0 -29
  225. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v2/README.md +0 -12
  226. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v2/other_module/__init__.py +0 -0
  227. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v2/other_module/base.py +0 -6
  228. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v2/protocols/__init__.py +0 -0
  229. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v2/protocols/my_protocol.py +0 -18
  230. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v3/CANVAS_MANIFEST.json +0 -29
  231. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v3/README.md +0 -12
  232. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v3/other_module/__init__.py +0 -0
  233. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v3/other_module/base.py +0 -8
  234. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v3/protocols/__init__.py +0 -0
  235. plugin_runner/tests/fixtures/plugins/test_module_imports_outside_plugin_v3/protocols/my_protocol.py +0 -18
  236. plugin_runner/tests/fixtures/plugins/test_module_imports_plugin/CANVAS_MANIFEST.json +0 -29
  237. plugin_runner/tests/fixtures/plugins/test_module_imports_plugin/README.md +0 -12
  238. plugin_runner/tests/fixtures/plugins/test_module_imports_plugin/other_module/__init__.py +0 -0
  239. plugin_runner/tests/fixtures/plugins/test_module_imports_plugin/other_module/base.py +0 -3
  240. plugin_runner/tests/fixtures/plugins/test_module_imports_plugin/protocols/__init__.py +0 -0
  241. plugin_runner/tests/fixtures/plugins/test_module_imports_plugin/protocols/my_protocol.py +0 -18
  242. plugin_runner/tests/fixtures/plugins/test_render_template/CANVAS_MANIFEST.json +0 -47
  243. plugin_runner/tests/fixtures/plugins/test_render_template/README.md +0 -11
  244. plugin_runner/tests/fixtures/plugins/test_render_template/protocols/__init__.py +0 -0
  245. plugin_runner/tests/fixtures/plugins/test_render_template/protocols/my_protocol.py +0 -43
  246. plugin_runner/tests/fixtures/plugins/test_render_template/templates/template.html +0 -10
  247. plugin_runner/tests/fixtures/plugins/test_simple_api/CANVAS_MANIFEST.json +0 -47
  248. plugin_runner/tests/fixtures/plugins/test_simple_api/README.md +0 -11
  249. plugin_runner/tests/fixtures/plugins/test_simple_api/__init__.py +0 -0
  250. plugin_runner/tests/fixtures/plugins/test_simple_api/protocols/__init__.py +0 -0
  251. plugin_runner/tests/fixtures/plugins/test_simple_api/protocols/my_protocol.py +0 -43
  252. plugin_runner/tests/test_application.py +0 -65
  253. plugin_runner/tests/test_plugin_installer.py +0 -127
  254. plugin_runner/tests/test_plugin_runner.py +0 -388
  255. plugin_runner/tests/test_sandbox.py +0 -137
  256. {canvas-0.32.0.dist-info → canvas-0.33.1.dist-info}/WHEEL +0 -0
  257. {canvas-0.32.0.dist-info → canvas-0.33.1.dist-info}/entry_points.txt +0 -0
canvas_sdk/utils/tests.py DELETED
@@ -1,72 +0,0 @@
1
- from unittest.mock import MagicMock, patch
2
-
3
- from canvas_sdk.utils import Http
4
-
5
-
6
- @patch("requests.Session.get")
7
- def test_http_get(mock_get: MagicMock) -> None:
8
- """Test that the Http.get method calls requests.get with the correct arguments."""
9
- http = Http()
10
- http.get("https://www.canvasmedical.com/", headers={"Authorization": "Bearer as;ldkfjdkj"})
11
- mock_get.assert_called_once_with(
12
- "https://www.canvasmedical.com/",
13
- headers={"Authorization": "Bearer as;ldkfjdkj"},
14
- timeout=30,
15
- )
16
-
17
-
18
- @patch("requests.Session.post")
19
- def test_http_post(mock_post: MagicMock) -> None:
20
- """Test that the Http.post method calls requests.post with the correct arguments."""
21
- http = Http()
22
- http.post(
23
- "https://www.canvasmedical.com/",
24
- json={"hey": "hi"},
25
- data="grant-type=client_credentials",
26
- headers={"Content-type": "application/json"},
27
- )
28
- mock_post.assert_called_once_with(
29
- "https://www.canvasmedical.com/",
30
- json={"hey": "hi"},
31
- data="grant-type=client_credentials",
32
- headers={"Content-type": "application/json"},
33
- timeout=30,
34
- )
35
-
36
-
37
- @patch("requests.Session.put")
38
- def test_http_put(mock_put: MagicMock) -> None:
39
- """Test that the Http.put method calls requests.put with the correct arguments."""
40
- http = Http()
41
- http.put(
42
- "https://www.canvasmedical.com/",
43
- json={"hey": "hi"},
44
- data="grant-type=client_credentials",
45
- headers={"Content-type": "application/json"},
46
- )
47
- mock_put.assert_called_once_with(
48
- "https://www.canvasmedical.com/",
49
- json={"hey": "hi"},
50
- data="grant-type=client_credentials",
51
- headers={"Content-type": "application/json"},
52
- timeout=30,
53
- )
54
-
55
-
56
- @patch("requests.Session.patch")
57
- def test_http_patch(mock_patch: MagicMock) -> None:
58
- """Test that the Http.patch method calls requests.patch with the correct arguments."""
59
- http = Http()
60
- http.patch(
61
- "https://www.canvasmedical.com/",
62
- json={"hey": "hi"},
63
- data="grant-type=client_credentials",
64
- headers={"Content-type": "application/json"},
65
- )
66
- mock_patch.assert_called_once_with(
67
- "https://www.canvasmedical.com/",
68
- json={"hey": "hi"},
69
- data="grant-type=client_credentials",
70
- headers={"Content-type": "application/json"},
71
- timeout=30,
72
- )
@@ -1,72 +0,0 @@
1
- from canvas_sdk.value_set.v2022.condition import (
2
- DisordersOfTheImmuneSystem,
3
- EncephalopathyDueToChildhoodVaccination,
4
- Rhabdomyolysis,
5
- StableAndUnstableAngina,
6
- )
7
- from canvas_sdk.value_set.value_set import CombinedValueSet
8
-
9
-
10
- def test_value_set_class_values_property() -> None:
11
- """Test that the value_set returns the correct values."""
12
- value_set = DisordersOfTheImmuneSystem
13
- assert value_set.values["ICD10CM"] == DisordersOfTheImmuneSystem.ICD10CM
14
- assert value_set.values["SNOMEDCT"] == DisordersOfTheImmuneSystem.SNOMEDCT
15
-
16
-
17
- def test_value_set_class_pipe_operator_with_two_value_sets() -> None:
18
- """Test that the pipe operator returns the correct values."""
19
- combined_value_set: CombinedValueSet = (
20
- DisordersOfTheImmuneSystem | EncephalopathyDueToChildhoodVaccination
21
- )
22
-
23
- both_classes_icd_10_codes = DisordersOfTheImmuneSystem.ICD10CM.union(
24
- EncephalopathyDueToChildhoodVaccination.ICD10CM
25
- )
26
- both_classes_snomed_codes = DisordersOfTheImmuneSystem.SNOMEDCT.union(
27
- EncephalopathyDueToChildhoodVaccination.SNOMEDCT
28
- )
29
-
30
- assert both_classes_icd_10_codes == combined_value_set.values["ICD10CM"]
31
- assert both_classes_snomed_codes == combined_value_set.values["SNOMEDCT"]
32
-
33
-
34
- def test_value_set_class_pipe_operator_with_three_value_sets() -> None:
35
- """Test that the pipe operator returns the correct values with multiple operands."""
36
- combined_value_set: CombinedValueSet = (
37
- DisordersOfTheImmuneSystem | EncephalopathyDueToChildhoodVaccination | Rhabdomyolysis
38
- )
39
-
40
- all_classes_icd_10_codes = DisordersOfTheImmuneSystem.ICD10CM.union(
41
- EncephalopathyDueToChildhoodVaccination.ICD10CM
42
- ).union(Rhabdomyolysis.ICD10CM)
43
- all_classes_snomed_codes = DisordersOfTheImmuneSystem.SNOMEDCT.union(
44
- EncephalopathyDueToChildhoodVaccination.SNOMEDCT
45
- ).union(Rhabdomyolysis.SNOMEDCT)
46
-
47
- assert all_classes_icd_10_codes == combined_value_set.values["ICD10CM"]
48
- assert all_classes_snomed_codes == combined_value_set.values["SNOMEDCT"]
49
-
50
-
51
- def test_value_set_class_pipe_operator_with_two_combined_value_sets() -> None:
52
- """Test that the pipe operator returns the correct values with two combined value_sets."""
53
- combined_value_set_1: CombinedValueSet = (
54
- DisordersOfTheImmuneSystem | EncephalopathyDueToChildhoodVaccination
55
- )
56
- combined_value_set_2: CombinedValueSet = Rhabdomyolysis | StableAndUnstableAngina
57
-
58
- combined_value_set = combined_value_set_1 | combined_value_set_2
59
-
60
- all_classes_icd_10_codes = (
61
- DisordersOfTheImmuneSystem.ICD10CM.union(EncephalopathyDueToChildhoodVaccination.ICD10CM)
62
- .union(Rhabdomyolysis.ICD10CM)
63
- .union(StableAndUnstableAngina.ICD10CM)
64
- )
65
- all_classes_snomed_codes = (
66
- DisordersOfTheImmuneSystem.SNOMEDCT.union(EncephalopathyDueToChildhoodVaccination.SNOMEDCT)
67
- .union(Rhabdomyolysis.SNOMEDCT)
68
- .union(StableAndUnstableAngina.SNOMEDCT)
69
- )
70
-
71
- assert combined_value_set.values["ICD10CM"] == all_classes_icd_10_codes
72
- assert combined_value_set.values["SNOMEDCT"] == all_classes_snomed_codes
File without changes
@@ -1,29 +0,0 @@
1
- {
2
- "sdk_version": "0.1.4",
3
- "plugin_version": "0.0.1",
4
- "name": "example_plugin",
5
- "description": "Edit the description in CANVAS_MANIFEST.json",
6
- "components": {
7
- "protocols": [
8
- {
9
- "class": "example_plugin.protocols.my_protocol:Protocol",
10
- "description": "A protocol that does xyz...",
11
- "data_access": {
12
- "event": "",
13
- "read": [],
14
- "write": []
15
- }
16
- }
17
- ],
18
- "commands": [],
19
- "content": [],
20
- "effects": [],
21
- "views": []
22
- },
23
- "secrets": [],
24
- "tags": {},
25
- "references": [],
26
- "license": "",
27
- "diagram": false,
28
- "readme": "./README.md"
29
- }
@@ -1,12 +0,0 @@
1
- ==============
2
- example_plugin
3
- ==============
4
-
5
- ## Description
6
-
7
- A description of this plugin
8
-
9
- ### Important Note!
10
-
11
- The CANVAS_MANIFEST.json is used when installing your plugin. Please ensure it
12
- gets updated if you add, remove, or rename protocols.
@@ -1,18 +0,0 @@
1
- from canvas_sdk.effects import Effect, EffectType
2
- from canvas_sdk.events import EventType
3
- from canvas_sdk.protocols import BaseProtocol
4
-
5
-
6
- class Protocol(BaseProtocol):
7
- """
8
- You should put a helpful description of this protocol's behavior here.
9
- """
10
-
11
- # Name the event type you wish to run in response to
12
- RESPONDS_TO = EventType.Name(EventType.UNKNOWN)
13
-
14
- NARRATIVE_STRING = "I was inserted from my plugin's protocol."
15
-
16
- def compute(self) -> list[Effect]:
17
- """This method gets called when an event of the type RESPONDS_TO is fired."""
18
- return [Effect(type=EffectType.LOG, payload="Hello, world!")]
@@ -1,38 +0,0 @@
1
- {
2
- "sdk_version": "0.1.4",
3
- "plugin_version": "0.0.1",
4
- "name": "test_implicit_imports_plugin",
5
- "description": "Edit the description in CANVAS_MANIFEST.json",
6
- "components": {
7
- "protocols": [
8
- {
9
- "class": "test_implicit_imports_plugin.protocols.my_protocol:Forbidden",
10
- "description": "A protocol that does xyz...",
11
- "data_access": {
12
- "event": "",
13
- "read": [],
14
- "write": []
15
- }
16
- },
17
- {
18
- "class": "test_implicit_imports_plugin.protocols.my_protocol:Allowed",
19
- "description": "A protocol that does xyz...",
20
- "data_access": {
21
- "event": "",
22
- "read": [],
23
- "write": []
24
- }
25
- }
26
- ],
27
- "commands": [],
28
- "content": [],
29
- "effects": [],
30
- "views": []
31
- },
32
- "secrets": [],
33
- "tags": {},
34
- "references": [],
35
- "license": "",
36
- "diagram": false,
37
- "readme": "./README.md"
38
- }
@@ -1,11 +0,0 @@
1
- test_forbiden_implicit_imports_plugin
2
- =====================================
3
-
4
- ## Description
5
-
6
- A description of this plugin
7
-
8
- ### Important Note!
9
-
10
- The CANVAS_MANIFEST.json is used when installing your plugin. Please ensure it
11
- gets updated if you add, remove, or rename protocols.
@@ -1,33 +0,0 @@
1
- from canvas_sdk.effects import Effect
2
- from canvas_sdk.events import EventType
3
- from canvas_sdk.protocols import BaseProtocol
4
- from logger import log
5
-
6
-
7
- class Forbidden(BaseProtocol):
8
- """You should put a helpful description of this protocol's behavior here."""
9
-
10
- # Name the event type you wish to run in response to
11
- RESPONDS_TO = EventType.Name(EventType.UNKNOWN)
12
-
13
- def compute(self) -> list[Effect]:
14
- """This method gets called when an event of the type RESPONDS_TO is fired."""
15
- from test_implicit_imports_plugin.utils.base import OtherClass
16
-
17
- OtherClass()
18
-
19
- return []
20
-
21
-
22
- class Allowed(BaseProtocol):
23
- """You should put a helpful description of this protocol's behavior here."""
24
-
25
- RESPONDS_TO = EventType.Name(EventType.UNKNOWN)
26
-
27
- def compute(self) -> list[Effect]:
28
- """This method gets called when an event of the type RESPONDS_TO is fired."""
29
- from test_implicit_imports_plugin.templates import Template
30
-
31
- log.info(Template().render())
32
-
33
- return []
@@ -1,3 +0,0 @@
1
- from test_implicit_imports_plugin.templates.base import Template
2
-
3
- __all__ = ("Template",)
@@ -1,6 +0,0 @@
1
- class Template:
2
- """A template class for testing implicit imports."""
3
-
4
- def render(self) -> str:
5
- """Renders the template."""
6
- return "Hello, World!"
@@ -1,5 +0,0 @@
1
- import os
2
-
3
- from logger import log
4
-
5
- log.info(f"os list dir: {os.listdir('.')}")
@@ -1,4 +0,0 @@
1
- class OtherClass:
2
- """This class is used to test implicit imports."""
3
-
4
- pass
@@ -1,52 +0,0 @@
1
- {
2
- "sdk_version": "0.1.4",
3
- "plugin_version": "0.0.1",
4
- "name": "test_load_questionnaire",
5
- "description": "Edit the description in CANVAS_MANIFEST.json",
6
- "components": {
7
- "protocols": [
8
- {
9
- "class": "test_load_questionnaire.protocols.my_protocol:ValidQuestionnaire",
10
- "description": "A protocol that does xyz...",
11
- "data_access": {
12
- "event": "",
13
- "read": [],
14
- "write": []
15
- }
16
- },
17
- {
18
- "class": "test_load_questionnaire.protocols.my_protocol:InvalidQuestionnaire",
19
- "description": "A protocol that does xyz...",
20
- "data_access": {
21
- "event": "",
22
- "read": [],
23
- "write": []
24
- }
25
- },
26
- {
27
- "class": "test_load_questionnaire.protocols.my_protocol:ForbiddenQuestionnaire",
28
- "description": "A protocol that does xyz...",
29
- "data_access": {
30
- "event": "",
31
- "read": [],
32
- "write": []
33
- }
34
- }
35
- ],
36
- "commands": [],
37
- "content": [],
38
- "effects": [],
39
- "views": [],
40
- "questionnaires": [
41
- {
42
- "template": "questionnaires/example_questionnaire.yml"
43
- }
44
- ]
45
- },
46
- "secrets": [],
47
- "tags": {},
48
- "references": [],
49
- "license": "",
50
- "diagram": false,
51
- "readme": "./README.md"
52
- }
@@ -1,11 +0,0 @@
1
- test_load_questionnaire
2
- ====================
3
-
4
- ## Description
5
-
6
- A description of this plugin
7
-
8
- ### Important Note!
9
-
10
- The CANVAS_MANIFEST.json is used when installing your plugin. Please ensure it
11
- gets updated if you add, remove, or rename protocols.
@@ -1,39 +0,0 @@
1
- import json
2
-
3
- from canvas_sdk.effects import Effect
4
- from canvas_sdk.events import EventType
5
- from canvas_sdk.handlers import BaseHandler
6
- from canvas_sdk.questionnaires import questionnaire_from_yaml
7
-
8
-
9
- class ValidQuestionnaire(BaseHandler):
10
- """You should put a helpful description of this protocol's behavior here."""
11
-
12
- RESPONDS_TO = [EventType.Name(EventType.UNKNOWN)]
13
-
14
- def compute(self) -> list[Effect]:
15
- """This method gets called when an event of the type RESPONDS_TO is fired."""
16
- config = questionnaire_from_yaml("questionnaires/example_questionnaire.yml")
17
- return [Effect(payload=json.dumps(config))]
18
-
19
-
20
- class InvalidQuestionnaire(BaseHandler):
21
- """You should put a helpful description of this protocol's behavior here."""
22
-
23
- RESPONDS_TO = [EventType.Name(EventType.UNKNOWN)]
24
-
25
- def compute(self) -> list[Effect]:
26
- """This method gets called when an event of the type RESPONDS_TO is fired."""
27
- questionnaire_from_yaml("questionnaires/example_questionnaire1.yml")
28
- return []
29
-
30
-
31
- class ForbiddenQuestionnaire(BaseHandler):
32
- """You should put a helpful description of this protocol's behavior here."""
33
-
34
- RESPONDS_TO = [EventType.Name(EventType.UNKNOWN)]
35
-
36
- def compute(self) -> list[Effect]:
37
- """This method gets called when an event of the type RESPONDS_TO is fired."""
38
- questionnaire_from_yaml("../../questionnaires/example_questionnaire.yml")
39
- return []
@@ -1,61 +0,0 @@
1
- # yaml-language-server: $schema=../../../../../../schemas/questionnaire.json
2
-
3
- name: Example Name
4
- form_type: QUES
5
- code_system: LOINC
6
- code: QUES_EXAMPLE_NAME
7
- can_originate_in_charting: true
8
- prologue: This is an example of a structured assessment with single select, multiselect, and free text responses.
9
- questions:
10
- - content: "This is question #1"
11
- code_system: CPT
12
- code: H0005
13
- code_description: ""
14
- responses_code_system: INTERNAL
15
- responses_type: SING
16
- display_result_in_social_history_section: true
17
- responses:
18
- - name: "Single select response #1"
19
- code: QUES_EXAMPLE_NAME_Q1_A1
20
- code_description: ''
21
- value: "1"
22
- - name: "Single select response #2"
23
- code: QUES_EXAMPLE_NAME_Q1_A2
24
- code_description: ''
25
- value: "0"
26
- - name: "Single select response #3"
27
- code: QUES_EXAMPLE_NAME_Q1_A3
28
- code_description: ''
29
- value: "0"
30
- - content: "This is question #2"
31
- code_system: INTERNAL
32
- code: QUES_EXAMPLE_NAME_Q2
33
- code_description: ""
34
- responses_code_system: ICD-10
35
- responses_type: MULT
36
- display_result_in_social_history_section: true
37
- responses:
38
- - name: "Multi select response #1"
39
- code: F1910
40
- code_description: ''
41
- value: "0"
42
- - name: "Multi select response #2"
43
- code: QUES_EXAMPLE_NAME_Q1_A1
44
- code_description: ''
45
- value: "2"
46
- - name: "Multi select response #3"
47
- code: QUES_EXAMPLE_NAME_Q1_A2
48
- code_description: ''
49
- value: "0"
50
- - content: "This is question #3"
51
- code_system: INTERNAL
52
- code: QUES_EXAMPLE_NAME_Q3
53
- code_description: ""
54
- responses_code_system: INTERNAL
55
- responses_type: TXT
56
- display_result_in_social_history_section: true
57
- responses:
58
- - name: "Free text response"
59
- code: QUES_EXAMPLE_NAME_Q3_A1
60
- code_description: ''
61
- value: "This is a default pre-populated free text response."
@@ -1,29 +0,0 @@
1
- {
2
- "sdk_version": "0.1.4",
3
- "plugin_version": "0.0.1",
4
- "name": "test_module_forbidden_imports_plugin",
5
- "description": "Edit the description in CANVAS_MANIFEST.json",
6
- "components": {
7
- "protocols": [
8
- {
9
- "class": "test_module_forbidden_imports_plugin.protocols.my_protocol:Protocol",
10
- "description": "A protocol that does xyz...",
11
- "data_access": {
12
- "event": "",
13
- "read": [],
14
- "write": []
15
- }
16
- }
17
- ],
18
- "commands": [],
19
- "content": [],
20
- "effects": [],
21
- "views": []
22
- },
23
- "secrets": [],
24
- "tags": {},
25
- "references": [],
26
- "license": "",
27
- "diagram": false,
28
- "readme": "./README.md"
29
- }
@@ -1,12 +0,0 @@
1
- ==========================
2
- test_module_forbidden_imports_plugin
3
- ==========================
4
-
5
- ## Description
6
-
7
- A description of this plugin
8
-
9
- ### Important Note!
10
-
11
- The CANVAS_MANIFEST.json is used when installing your plugin. Please ensure it
12
- gets updated if you add, remove, or rename protocols.
@@ -1,10 +0,0 @@
1
- import os
2
-
3
- from logger import log
4
-
5
- log.info(f"This is a forbidden import. {os}")
6
-
7
-
8
- def import_me() -> str:
9
- """Test method."""
10
- return "Successfully imported!"
@@ -1,18 +0,0 @@
1
- from test_module_forbidden_imports_plugin.other_module.base import import_me
2
-
3
- from canvas_sdk.effects import Effect, EffectType
4
- from canvas_sdk.events import EventType
5
- from canvas_sdk.protocols import BaseProtocol
6
-
7
-
8
- class Protocol(BaseProtocol):
9
- """
10
- You should put a helpful description of this protocol's behavior here.
11
- """
12
-
13
- # Name the event type you wish to run in response to
14
- RESPONDS_TO = EventType.Name(EventType.UNKNOWN)
15
-
16
- def compute(self) -> list[Effect]:
17
- """This method gets called when an event of the type RESPONDS_TO is fired."""
18
- return [Effect(type=EffectType.LOG, payload=import_me())]
@@ -1,29 +0,0 @@
1
- {
2
- "sdk_version": "0.1.4",
3
- "plugin_version": "0.0.1",
4
- "name": "test_module_forbidden_imports_runtime_plugin",
5
- "description": "Edit the description in CANVAS_MANIFEST.json",
6
- "components": {
7
- "protocols": [
8
- {
9
- "class": "test_module_forbidden_imports_runtime_plugin.protocols.my_protocol:Protocol",
10
- "description": "A protocol that does xyz...",
11
- "data_access": {
12
- "event": "",
13
- "read": [],
14
- "write": []
15
- }
16
- }
17
- ],
18
- "commands": [],
19
- "content": [],
20
- "effects": [],
21
- "views": []
22
- },
23
- "secrets": [],
24
- "tags": {},
25
- "references": [],
26
- "license": "",
27
- "diagram": false,
28
- "readme": "./README.md"
29
- }
@@ -1,12 +0,0 @@
1
- ==========================
2
- test_module_forbidden_imports_runtime_plugin
3
- ==========================
4
-
5
- ## Description
6
-
7
- A description of this plugin
8
-
9
- ### Important Note!
10
-
11
- The CANVAS_MANIFEST.json is used when installing your plugin. Please ensure it
12
- gets updated if you add, remove, or rename protocols.
@@ -1,10 +0,0 @@
1
- import os
2
-
3
- from logger import log
4
-
5
- log.info(f"This is a forbidden import. {os}")
6
-
7
-
8
- def import_me() -> str:
9
- """Test method."""
10
- return "Successfully imported!"
@@ -1,18 +0,0 @@
1
- from canvas_sdk.effects import Effect, EffectType
2
- from canvas_sdk.events import EventType
3
- from canvas_sdk.protocols import BaseProtocol
4
-
5
-
6
- class Protocol(BaseProtocol):
7
- """
8
- You should put a helpful description of this protocol's behavior here.
9
- """
10
-
11
- # Name the event type you wish to run in response to
12
- RESPONDS_TO = EventType.Name(EventType.UNKNOWN)
13
-
14
- def compute(self) -> list[Effect]:
15
- """This method gets called when an event of the type RESPONDS_TO is fired."""
16
- from test_module_forbidden_imports_runtime_plugin.other_module.base import import_me
17
-
18
- return [Effect(type=EffectType.LOG, payload=import_me())]