canvas 0.1.15__py3-none-any.whl → 0.2.10__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.
- {canvas-0.1.15.dist-info → canvas-0.2.10.dist-info}/METADATA +7 -1
- canvas-0.2.10.dist-info/RECORD +143 -0
- canvas_cli/apps/plugin/plugin.py +51 -9
- canvas_cli/apps/plugin/tests.py +51 -0
- canvas_cli/tests.py +193 -4
- canvas_cli/utils/validators/manifest_schema.py +1 -0
- canvas_generated/messages/effects_pb2.py +2 -2
- canvas_generated/messages/effects_pb2.pyi +138 -0
- canvas_generated/messages/events_pb2.py +3 -3
- canvas_generated/messages/events_pb2.pyi +616 -0
- canvas_sdk/__init__.py +7 -0
- canvas_sdk/base.py +6 -2
- canvas_sdk/commands/__init__.py +26 -0
- canvas_sdk/commands/base.py +35 -32
- canvas_sdk/commands/commands/allergy.py +49 -0
- canvas_sdk/commands/commands/assess.py +1 -1
- canvas_sdk/commands/commands/close_goal.py +22 -0
- canvas_sdk/commands/commands/diagnose.py +3 -3
- canvas_sdk/commands/commands/family_history.py +18 -0
- canvas_sdk/commands/commands/goal.py +3 -3
- canvas_sdk/commands/commands/history_present_illness.py +1 -1
- canvas_sdk/commands/commands/instruct.py +17 -0
- canvas_sdk/commands/commands/lab_order.py +33 -0
- canvas_sdk/commands/commands/medical_history.py +34 -0
- canvas_sdk/commands/commands/medication_statement.py +1 -1
- canvas_sdk/commands/commands/past_surgical_history.py +28 -0
- canvas_sdk/commands/commands/perform.py +17 -0
- canvas_sdk/commands/commands/plan.py +2 -2
- canvas_sdk/commands/commands/prescribe.py +10 -7
- canvas_sdk/commands/commands/questionnaire.py +1 -1
- canvas_sdk/commands/commands/refill.py +16 -0
- canvas_sdk/commands/commands/remove_allergy.py +26 -0
- canvas_sdk/commands/commands/stop_medication.py +1 -1
- canvas_sdk/commands/commands/task.py +52 -0
- canvas_sdk/commands/commands/update_diagnosis.py +27 -0
- canvas_sdk/commands/commands/update_goal.py +1 -1
- canvas_sdk/commands/commands/vitals.py +78 -0
- canvas_sdk/commands/constants.py +7 -0
- canvas_sdk/commands/tests/protocol/__init__.py +0 -0
- canvas_sdk/commands/tests/protocol/tests.py +55 -0
- canvas_sdk/commands/tests/schema/__init__.py +0 -0
- canvas_sdk/commands/tests/schema/tests.py +104 -0
- canvas_sdk/commands/tests/test_utils.py +170 -6
- canvas_sdk/commands/tests/unit/__init__.py +0 -0
- canvas_sdk/commands/tests/{tests.py → unit/tests.py} +20 -194
- canvas_sdk/data/client.py +82 -0
- canvas_sdk/data/patient.py +1 -21
- canvas_sdk/effects/banner_alert/add_banner_alert.py +8 -7
- canvas_sdk/effects/banner_alert/remove_banner_alert.py +3 -2
- canvas_sdk/effects/banner_alert/tests.py +224 -0
- canvas_sdk/effects/base.py +3 -5
- canvas_sdk/effects/patient_chart_summary_configuration.py +39 -0
- canvas_sdk/effects/protocol_card/__init__.py +1 -0
- canvas_sdk/effects/protocol_card/protocol_card.py +83 -0
- canvas_sdk/effects/protocol_card/tests.py +184 -0
- canvas_sdk/handlers/base.py +14 -1
- canvas_sdk/protocols/base.py +14 -0
- canvas_sdk/protocols/clinical_quality_measure.py +41 -0
- canvas_sdk/utils/db.py +17 -0
- canvas_sdk/v1/__init__.py +0 -0
- canvas_sdk/v1/data/__init__.py +3 -0
- canvas_sdk/v1/data/allergy_intolerance.py +63 -0
- canvas_sdk/v1/data/base.py +47 -0
- canvas_sdk/v1/data/condition.py +48 -0
- canvas_sdk/v1/data/lab.py +96 -0
- canvas_sdk/v1/data/medication.py +54 -0
- canvas_sdk/v1/data/patient.py +49 -0
- canvas_sdk/v1/data/user.py +10 -0
- canvas_sdk/value_set/tests/test_value_sets.py +65 -0
- canvas_sdk/value_set/v2022/adverse_event.py +33 -0
- canvas_sdk/value_set/v2022/allergy.py +232 -0
- canvas_sdk/value_set/v2022/assessment.py +215 -0
- canvas_sdk/value_set/v2022/communication.py +325 -0
- canvas_sdk/value_set/v2022/condition.py +40654 -0
- canvas_sdk/value_set/v2022/device.py +174 -0
- canvas_sdk/value_set/v2022/diagnostic_study.py +4967 -0
- canvas_sdk/value_set/v2022/encounter.py +2564 -0
- canvas_sdk/value_set/v2022/immunization.py +341 -0
- canvas_sdk/value_set/v2022/individual_characteristic.py +307 -0
- canvas_sdk/value_set/v2022/intervention.py +1356 -0
- canvas_sdk/value_set/v2022/laboratory_test.py +1250 -0
- canvas_sdk/value_set/v2022/medication.py +5130 -0
- canvas_sdk/value_set/v2022/physical_exam.py +201 -0
- canvas_sdk/value_set/v2022/procedure.py +4037 -0
- canvas_sdk/value_set/v2022/symptom.py +176 -0
- canvas_sdk/value_set/value_set.py +91 -0
- canvas-0.1.15.dist-info/RECORD +0 -95
- canvas_generated/data_access_layer/data_access_layer_pb2.py +0 -30
- canvas_generated/data_access_layer/data_access_layer_pb2.pyi +0 -23
- canvas_generated/data_access_layer/data_access_layer_pb2_grpc.py +0 -66
- canvas_sdk/data/data_access_layer_client.py +0 -95
- canvas_sdk/data/exceptions.py +0 -16
- {canvas-0.1.15.dist-info → canvas-0.2.10.dist-info}/WHEEL +0 -0
- {canvas-0.1.15.dist-info → canvas-0.2.10.dist-info}/entry_points.txt +0 -0
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
from ..value_set import ValueSet
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
class FrailtySymptom(ValueSet):
|
|
5
|
+
"""
|
|
6
|
+
**Clinical Focus:** The purpose of this value set is to represent concepts for symptoms of frailty.
|
|
7
|
+
|
|
8
|
+
**Data Element Scope:** This value set may use a model element related to Symptom.
|
|
9
|
+
|
|
10
|
+
**Inclusion Criteria:** Includes concepts that represent a symptom of frailty.
|
|
11
|
+
|
|
12
|
+
**Exclusion Criteria:** No exclusions.
|
|
13
|
+
|
|
14
|
+
** Used in:** CMS134v10, CMS165v10, CMS131v10, CMS122v10, CMS125v10, CMS130v10
|
|
15
|
+
"""
|
|
16
|
+
|
|
17
|
+
VALUE_SET_NAME = "Frailty Symptom"
|
|
18
|
+
OID = "2.16.840.1.113883.3.464.1003.113.12.1075"
|
|
19
|
+
DEFINITION_VERSION = "20190315"
|
|
20
|
+
EXPANSION_VERSION = "eCQM Update 2021-05-06"
|
|
21
|
+
|
|
22
|
+
ICD10CM = {
|
|
23
|
+
"R260", # Ataxic gait
|
|
24
|
+
"R261", # Paralytic gait
|
|
25
|
+
"R262", # Difficulty in walking, not elsewhere classified
|
|
26
|
+
"R2689", # Other abnormalities of gait and mobility
|
|
27
|
+
"R269", # Unspecified abnormalities of gait and mobility
|
|
28
|
+
"R4181", # Age-related cognitive decline
|
|
29
|
+
"R531", # Weakness
|
|
30
|
+
"R5381", # Other malaise
|
|
31
|
+
"R5383", # Other fatigue
|
|
32
|
+
"R54", # Age-related physical debility
|
|
33
|
+
"R627", # Adult failure to thrive
|
|
34
|
+
"R634", # Abnormal weight loss
|
|
35
|
+
"R636", # Underweight
|
|
36
|
+
"R64", # Cachexia
|
|
37
|
+
}
|
|
38
|
+
SNOMEDCT = {
|
|
39
|
+
"4468000", # Oppenheim's gait (finding)
|
|
40
|
+
"8510008", # Reduced mobility (finding)
|
|
41
|
+
"13791008", # Asthenia (finding)
|
|
42
|
+
"18726006", # Senile asthenia (finding)
|
|
43
|
+
"20940004", # Spinal hemiparesis (finding)
|
|
44
|
+
"22090007", # Scissoring gait (finding)
|
|
45
|
+
"22325002", # Abnormal gait (finding)
|
|
46
|
+
"22631008", # Unsteady when walking (finding)
|
|
47
|
+
"23042008", # Spinal paraparesis (finding)
|
|
48
|
+
"25136009", # Ataxic gait (finding)
|
|
49
|
+
"26544005", # Muscle weakness (finding)
|
|
50
|
+
"41786007", # Neurological muscle weakness (finding)
|
|
51
|
+
"43005009", # Shuffling gait (finding)
|
|
52
|
+
"50314001", # Partial bilateral paresis (finding)
|
|
53
|
+
"67141003", # Antalgic gait (finding)
|
|
54
|
+
"78119002", # Complete bilateral paresis (finding)
|
|
55
|
+
"78691002", # Staggering gait (finding)
|
|
56
|
+
"84229001", # Fatigue (finding)
|
|
57
|
+
"89362005", # Weight loss (finding)
|
|
58
|
+
"102492002", # Failure to maintain weight (finding)
|
|
59
|
+
"102568007", # Paresis of lower extremity (finding)
|
|
60
|
+
"102891000", # Age-related cognitive decline (finding)
|
|
61
|
+
"105501005", # Dependence on enabling machine or device (finding)
|
|
62
|
+
"105503008", # Dependence on wheelchair (finding)
|
|
63
|
+
"105504002", # Dependence on walking stick (finding)
|
|
64
|
+
"126013009", # Subjective muscle weakness (finding)
|
|
65
|
+
"127378008", # Bilateral paresis (finding)
|
|
66
|
+
"135834002", # Pseudoparalysis (finding)
|
|
67
|
+
"160681005", # Mobile outside with aid (finding)
|
|
68
|
+
"160683008", # Needs walking aid in home (finding)
|
|
69
|
+
"160684002", # Confined to chair (finding)
|
|
70
|
+
"160685001", # Bed-ridden (finding)
|
|
71
|
+
"160692006", # Mobility very poor (finding)
|
|
72
|
+
"160693001", # Mobility poor (finding)
|
|
73
|
+
"160734000", # Lives in a nursing home (finding)
|
|
74
|
+
"160737007", # Lives in an old peoples home (finding)
|
|
75
|
+
"161832001", # Weight decreasing (finding)
|
|
76
|
+
"161873000", # Heavy legs (finding)
|
|
77
|
+
"161874006", # Heavy feeling (finding)
|
|
78
|
+
"162236007", # Weakness present (finding)
|
|
79
|
+
"162239000", # Abdominal weakness (finding)
|
|
80
|
+
"163600007", # On examination - paresis (weakness) (finding)
|
|
81
|
+
"163686004", # On examination - gait ataxic (finding)
|
|
82
|
+
"163695007", # On examination - muscle power reduced (finding)
|
|
83
|
+
"165243005", # Independent in wheelchair (finding)
|
|
84
|
+
"165244004", # Minimal help in wheelchair (finding)
|
|
85
|
+
"224960004", # Tired (finding)
|
|
86
|
+
"225612007", # Wheelchair bound (finding)
|
|
87
|
+
"238108007", # Cachexia (finding)
|
|
88
|
+
"248269005", # Tired on least exertion (finding)
|
|
89
|
+
"248278004", # Attacks of weakness (finding)
|
|
90
|
+
"248279007", # Frailty (finding)
|
|
91
|
+
"249888000", # Weakness of sternomastoid (finding)
|
|
92
|
+
"249937002", # Truncal muscle weakness (finding)
|
|
93
|
+
"249938007", # Weakness of back (finding)
|
|
94
|
+
"249939004", # Proximal muscle weakness (finding)
|
|
95
|
+
"249940002", # Shoulder girdle weakness (finding)
|
|
96
|
+
"249941003", # Pelvic girdle weakness (finding)
|
|
97
|
+
"249942005", # Distal muscle weakness (finding)
|
|
98
|
+
"249943000", # Weakness of distal arms and legs (finding)
|
|
99
|
+
"249946008", # Pyramidal type muscle weakness (finding)
|
|
100
|
+
"250002000", # Rapid fatigue of gait (finding)
|
|
101
|
+
"250003005", # Low level sensorimotor gait disorder (finding)
|
|
102
|
+
"250015009", # Arthritic gait (finding)
|
|
103
|
+
"250029005", # Sensory ataxic gait (finding)
|
|
104
|
+
"250032008", # Vestibular ataxic gait (finding)
|
|
105
|
+
"250033003", # Visual ataxic gait (finding)
|
|
106
|
+
"250034009", # Middle level sensorimotor gait disorder (finding)
|
|
107
|
+
"250038007", # Retropulsion when walking (finding)
|
|
108
|
+
"250043000", # High level sensorimotor gait disorder (finding)
|
|
109
|
+
"250044006", # Cautious gait (finding)
|
|
110
|
+
"250045007", # Tottering gait (finding)
|
|
111
|
+
"250048009", # Frontal ataxia (finding)
|
|
112
|
+
"250052009", # Petren's gait (finding)
|
|
113
|
+
"250054005", # Frontal gait disorder (finding)
|
|
114
|
+
"262285001", # Weight decreased (finding)
|
|
115
|
+
"267024001", # Abnormal weight loss (finding)
|
|
116
|
+
"267031002", # Tiredness symptom (finding)
|
|
117
|
+
"267032009", # Tired all the time (finding)
|
|
118
|
+
"268964003", # On examination - festination-Parkinson gait (finding)
|
|
119
|
+
"271795006", # Malaise and fatigue (finding)
|
|
120
|
+
"271875007", # Senile debility (finding)
|
|
121
|
+
"272036004", # Complaining of debility and malaise (finding)
|
|
122
|
+
"272060000", # Fatigue - symptom (finding)
|
|
123
|
+
"272062008", # Complaining of "tired all the time" (finding)
|
|
124
|
+
"275313006", # Dragging leg (finding)
|
|
125
|
+
"284529003", # Cardiac cachexia (finding)
|
|
126
|
+
"298283006", # Hand muscle weakness (finding)
|
|
127
|
+
"300948004", # Quadriceps weakness (finding)
|
|
128
|
+
"309249007", # Calf muscle weakness (finding)
|
|
129
|
+
"309257005", # Excessive weight loss (finding)
|
|
130
|
+
"312444006", # Spastic paraparesis (finding)
|
|
131
|
+
"314109004", # Feeling tired (finding)
|
|
132
|
+
"365884000", # Cerebellar ataxic gait (finding)
|
|
133
|
+
"367391008", # Malaise (finding)
|
|
134
|
+
"371028005", # Spastic paresis (finding)
|
|
135
|
+
"373931001", # Sensation of heaviness in limbs (finding)
|
|
136
|
+
"394616008", # Unsteady gait (finding)
|
|
137
|
+
"397776000", # Festinating gait (finding)
|
|
138
|
+
"404904002", # Frail elderly (finding)
|
|
139
|
+
"413121008", # Dependent on helper pushing wheelchair (finding)
|
|
140
|
+
"418073009", # Pseudoparalysis due to generalized arthritis (finding)
|
|
141
|
+
"422868009", # Unexplained weight loss (finding)
|
|
142
|
+
"426977000", # Recent weight loss (finding)
|
|
143
|
+
"428116008", # Multifactorial gait problem (finding)
|
|
144
|
+
"428264009", # Painful gait (finding)
|
|
145
|
+
"429091008", # Dependence on biphasic positive airway pressure ventilation (finding)
|
|
146
|
+
"429487005", # Dependence on continuous positive airway pressure ventilation (finding)
|
|
147
|
+
"431524008", # Abnormal gait due to impairment of balance (finding)
|
|
148
|
+
"432559006", # Abnormal gait due to muscle weakness (finding)
|
|
149
|
+
"442099003", # Psychogenic fatigue (finding)
|
|
150
|
+
"444042007", # Excessive postexertional fatigue (finding)
|
|
151
|
+
"444932008", # Dependence on ventilator (finding)
|
|
152
|
+
"448765001", # Unintentional weight loss (finding)
|
|
153
|
+
"713512009", # Muscle weakness of upper limb (finding)
|
|
154
|
+
"713514005", # Muscle weakness of limb (finding)
|
|
155
|
+
"713568000", # Occasionally tired (finding)
|
|
156
|
+
"713655003", # Dependence on non-invasive ventilation (finding)
|
|
157
|
+
"784317004", # Fatigue due to chemotherapy (finding)
|
|
158
|
+
"784318009", # Fatigue due to radiation therapy (finding)
|
|
159
|
+
"788876001", # Cachexia due to malignant neoplastic disease (finding)
|
|
160
|
+
"788900007", # Dependence on artificial heart (finding)
|
|
161
|
+
"931000119107", # Dependence on supplemental oxygen (finding)
|
|
162
|
+
"60631000119109", # Dependence on home ventilator (finding)
|
|
163
|
+
"60651000119103", # Dependence on continuous supplemental oxygen (finding)
|
|
164
|
+
"69161000119103", # Functional gait abnormality (finding)
|
|
165
|
+
"79021000119104", # Dependence on aspirator (finding)
|
|
166
|
+
"79031000119101", # Dependence on respirator (finding)
|
|
167
|
+
"85711000119103", # Stumbling due to lack of coordination (finding)
|
|
168
|
+
"89201000119106", # Dependence on supplemental oxygen when ambulating (finding)
|
|
169
|
+
"152921000119101", # Dependence on respiratory device (finding)
|
|
170
|
+
"250991000119100", # Stumbling gait (finding)
|
|
171
|
+
"459821000124104", # McArdle sign (finding)
|
|
172
|
+
"15634971000119107", # Weakness of bilateral upper limbs (finding)
|
|
173
|
+
"16018391000119104", # Paresis of left lower limb (finding)
|
|
174
|
+
"16018431000119109", # Paresis of right lower limb (finding)
|
|
175
|
+
"16419651000119103", # Dependence on biphasic positive airway pressure ventilation due to central sleep apnea syndrome (finding)
|
|
176
|
+
}
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
from collections import defaultdict
|
|
2
|
+
from typing import Dict, Union
|
|
3
|
+
|
|
4
|
+
|
|
5
|
+
class CodeConstants:
|
|
6
|
+
CPT = "CPT"
|
|
7
|
+
HCPCSLEVELII = "HCPCSLEVELII"
|
|
8
|
+
CVX = "CVX"
|
|
9
|
+
LOINC = "LOINC"
|
|
10
|
+
SNOMEDCT = "SNOMEDCT"
|
|
11
|
+
FDB = "FDB"
|
|
12
|
+
RXNORM = "RXNORM"
|
|
13
|
+
ICD10CM = "ICD10CM"
|
|
14
|
+
ICD10PCS = "ICD10PCS"
|
|
15
|
+
NUCC = "NUCC"
|
|
16
|
+
CANVAS = "CANVAS"
|
|
17
|
+
INTERNAL = "INTERNAL"
|
|
18
|
+
NDC = "NDC"
|
|
19
|
+
|
|
20
|
+
URL_CPT = "http://www.ama-assn.org/go/cpt"
|
|
21
|
+
URL_HCPCSLEVELII = "https://coder.aapc.com/hcpcs-codes"
|
|
22
|
+
URL_CVX = "http://hl7.org/fhir/sid/cvx"
|
|
23
|
+
URL_LOINC = "http://loinc.org"
|
|
24
|
+
URL_SNOMEDCT = "http://snomed.info/sct"
|
|
25
|
+
URL_FDB = "http://www.fdbhealth.com/"
|
|
26
|
+
URL_RXNORM = "http://www.nlm.nih.gov/research/umls/rxnorm"
|
|
27
|
+
URL_ICD10 = "ICD-10"
|
|
28
|
+
URL_NUCC = "http://www.nucc.org/"
|
|
29
|
+
URL_CANVAS = "CANVAS"
|
|
30
|
+
URL_INTERNAL = "INTERNAL"
|
|
31
|
+
URL_NDC = "http://hl7.org/fhir/sid/ndc"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class CodeConstantsURLMapping:
|
|
35
|
+
CODE_SYSTEM_MAPPING = {
|
|
36
|
+
CodeConstants.CPT: CodeConstants.URL_CPT,
|
|
37
|
+
CodeConstants.HCPCSLEVELII: CodeConstants.URL_HCPCSLEVELII,
|
|
38
|
+
CodeConstants.CVX: CodeConstants.URL_CVX,
|
|
39
|
+
CodeConstants.LOINC: CodeConstants.URL_LOINC,
|
|
40
|
+
CodeConstants.SNOMEDCT: CodeConstants.URL_SNOMEDCT,
|
|
41
|
+
CodeConstants.FDB: CodeConstants.URL_FDB,
|
|
42
|
+
CodeConstants.RXNORM: CodeConstants.URL_RXNORM,
|
|
43
|
+
CodeConstants.ICD10CM: CodeConstants.URL_ICD10,
|
|
44
|
+
CodeConstants.ICD10PCS: CodeConstants.URL_ICD10,
|
|
45
|
+
CodeConstants.NUCC: CodeConstants.URL_NUCC,
|
|
46
|
+
CodeConstants.CANVAS: CodeConstants.URL_CANVAS,
|
|
47
|
+
CodeConstants.INTERNAL: CodeConstants.URL_INTERNAL,
|
|
48
|
+
CodeConstants.NDC: CodeConstants.URL_NDC,
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
|
|
52
|
+
class CombinedValueSet(CodeConstantsURLMapping):
|
|
53
|
+
def __init__(
|
|
54
|
+
self,
|
|
55
|
+
value_set_1: Union["ValueSet", "CombinedValueSet"],
|
|
56
|
+
value_set_2: Union["ValueSet", "CombinedValueSet"],
|
|
57
|
+
) -> None:
|
|
58
|
+
self.value_set_1 = value_set_1
|
|
59
|
+
self.value_set_2 = value_set_2
|
|
60
|
+
|
|
61
|
+
@property
|
|
62
|
+
def values(self):
|
|
63
|
+
values: Dict[str, set] = defaultdict(set)
|
|
64
|
+
|
|
65
|
+
for vs in [self.value_set_1, self.value_set_2]:
|
|
66
|
+
sub_values = vs.values
|
|
67
|
+
|
|
68
|
+
for key in sub_values:
|
|
69
|
+
values[key] |= sub_values[key]
|
|
70
|
+
|
|
71
|
+
return values
|
|
72
|
+
|
|
73
|
+
def __or__(self, value_set: Union["ValueSet", "CombinedValueSet"]) -> "CombinedValueSet":
|
|
74
|
+
return CombinedValueSet(self, value_set)
|
|
75
|
+
|
|
76
|
+
|
|
77
|
+
class ValueSystems(type):
|
|
78
|
+
@property
|
|
79
|
+
def values(cls) -> dict[str, set]:
|
|
80
|
+
return {
|
|
81
|
+
system: getattr(cls, system)
|
|
82
|
+
for system in cls.CODE_SYSTEM_MAPPING.keys()
|
|
83
|
+
if hasattr(cls, system)
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
def __or__(self, value_set: Union["ValueSet", "CombinedValueSet"]) -> CombinedValueSet:
|
|
87
|
+
return CombinedValueSet(self, value_set)
|
|
88
|
+
|
|
89
|
+
|
|
90
|
+
class ValueSet(CodeConstantsURLMapping, metaclass=ValueSystems):
|
|
91
|
+
pass
|
canvas-0.1.15.dist-info/RECORD
DELETED
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
canvas_cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
canvas_cli/apps/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
3
|
-
canvas_cli/apps/auth/__init__.py,sha256=gIwJ2qWvRlLqbiRkudrGqTKV-orlb8OTkG487qoRda4,105
|
|
4
|
-
canvas_cli/apps/auth/tests.py,sha256=WK7hSLTK95gEweMRaj3RdPC-qSwjnuulxMUg6D0bY_k,4528
|
|
5
|
-
canvas_cli/apps/auth/utils.py,sha256=IH5oZB3pdlb4_FRfCZKkNTncx_kdKagpiBqlhtM8h2U,5434
|
|
6
|
-
canvas_cli/apps/logs/__init__.py,sha256=ehY9SRb6nBw81xZF50yyBlUZJtNR2VeVSNI5sFuWJ7o,64
|
|
7
|
-
canvas_cli/apps/logs/logs.py,sha256=Ixue8Z1wgxABunVIx6TzmsH6oZ0FPf2H51Sd3nFUnAI,1969
|
|
8
|
-
canvas_cli/apps/plugin/__init__.py,sha256=G_nLsu6cdko5OjatnbqUyEboGcNlGGLwpZmCBxMKdfo,236
|
|
9
|
-
canvas_cli/apps/plugin/plugin.py,sha256=MBA1JAFN6wknm5l1A1Tmb3jXNQj3L_67mLkakp1gRxE,11380
|
|
10
|
-
canvas_cli/apps/plugin/tests.py,sha256=_8fHTGlQermt4AVs20nsTYcs2bDRNEqr9CGE29pD6YQ,1035
|
|
11
|
-
canvas_cli/conftest.py,sha256=pGvVS6VT0Zll_Lp3ezLh2jykOk-2HTBVH8RP5FwLUVw,930
|
|
12
|
-
canvas_cli/main.py,sha256=lUCh5M7u0KJ9CWOL_oPa0J4284ggxHxteURYv6dGU4g,3790
|
|
13
|
-
canvas_cli/templates/plugins/default/cookiecutter.json,sha256=dWEB3wJ8U4bko8jX26PgLLg_jgWlafLTNqsGnY1PUcg,124
|
|
14
|
-
canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/CANVAS_MANIFEST.json,sha256=9N0u5hN0GqjPvUh_B3YHtvyntEvxUGbInbQeprU0TS0,787
|
|
15
|
-
canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/README.md,sha256=7QdF2JWlWwq6Us9LzkO9XWJU4IU7Q6RD_w8ImcS-hrI,347
|
|
16
|
-
canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/protocols/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
17
|
-
canvas_cli/templates/plugins/default/{{ cookiecutter.__project_slug }}/protocols/my_protocol.py,sha256=liFrvx-5NRfeODOBbRNB1Cg0P04UvxpAkkLtAiEmckQ,2252
|
|
18
|
-
canvas_cli/tests.py,sha256=LgiHeVHF5lxlH_pNT962uk-5D-JqNhhuu1LhSz90nK8,285
|
|
19
|
-
canvas_cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
20
|
-
canvas_cli/utils/context/__init__.py,sha256=HhYvI-hydP0mV18nJiU7uo5gk0yN7EYNgouxieoGDOE,102
|
|
21
|
-
canvas_cli/utils/context/context.py,sha256=Q-MniBuvzDKhLODOOrOVdaRTLz9Lp0m7cAz-i6YRRpA,5138
|
|
22
|
-
canvas_cli/utils/context/tests.py,sha256=aNmAggwvjKV-1WrgIvp66M46EX2QCbbHmity3bSCBTg,4211
|
|
23
|
-
canvas_cli/utils/print/__init__.py,sha256=zkRiQCUhPIB3wNGeJ1Hwfd12zJyvbRRiWqequJORvdE,88
|
|
24
|
-
canvas_cli/utils/print/print.py,sha256=GejLUtC5hfWuKHUBapyEwVHNIaIILxW60_xBQchiGpI,1420
|
|
25
|
-
canvas_cli/utils/print/tests.py,sha256=4kqp_uMpUUjSXokD_Hxs2aMyx50_JzGABAQoNC4XTrM,2376
|
|
26
|
-
canvas_cli/utils/urls/__init__.py,sha256=08hlrQhQ1pKBjlIRaC0j53IkgK723jfK8-j3djvR0ko,81
|
|
27
|
-
canvas_cli/utils/urls/tests.py,sha256=opXDF2i3lXTdsKJ7ywIRzWDDzZ5KAO0JbGIR3hbJdoE,407
|
|
28
|
-
canvas_cli/utils/urls/urls.py,sha256=KwWTh5ERrEsZEvdBrZpZB71xtyWkDuglpXUbycWmBOo,798
|
|
29
|
-
canvas_cli/utils/validators/__init__.py,sha256=rBvSR2O1hWkNAnUBdcr-zUkmqT796_A61b9pnvEhwrM,113
|
|
30
|
-
canvas_cli/utils/validators/manifest_schema.py,sha256=SIMpr_vTV8dtkO9cjsRnZZtRm5tgGkPR6QewTG8CztI,3117
|
|
31
|
-
canvas_cli/utils/validators/tests.py,sha256=cZHLSx7oteOfLOoU1tXGvw88n6itcvUT2B3ZBg-bmEY,1206
|
|
32
|
-
canvas_cli/utils/validators/validators.py,sha256=RKDKxIvZ1IuCPVuhQ1KHdpwu7aewAqT9ZX-nA-LZDdg,1614
|
|
33
|
-
canvas_generated/data_access_layer/data_access_layer_pb2.py,sha256=zifzwTsVs1pwNoBGEAlX_qJllIruk1gIeUSONQdvbP4,1673
|
|
34
|
-
canvas_generated/data_access_layer/data_access_layer_pb2.pyi,sha256=mJNO3x6UYhPMurn2aGBuYJYS6tFigd3znPknndy4dpk,868
|
|
35
|
-
canvas_generated/data_access_layer/data_access_layer_pb2_grpc.py,sha256=nmmH2hPYLcaAVOK_SMgX1ruZmiQGSJ3aRRnxiUVMftc,2828
|
|
36
|
-
canvas_generated/messages/effects_pb2.py,sha256=NX__XT0xZk3G2zchK-BW5huCVtoZ4jBW-F2hcYNK98Q,4376
|
|
37
|
-
canvas_generated/messages/effects_pb2.pyi,sha256=6YkzAOo6xnbWqxvv4gHdz1K6cz52JVQCRejpLVaX2y0,6640
|
|
38
|
-
canvas_generated/messages/effects_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
39
|
-
canvas_generated/messages/events_pb2.py,sha256=gInxe1HotF5wl-gcp86DQNp26IJpX4zFHd-Dm1jjbEk,13126
|
|
40
|
-
canvas_generated/messages/events_pb2.pyi,sha256=7awcbzViTZZ2mX_zK2igJj2zpSW6hYeRwb0Muz0R0ok,22157
|
|
41
|
-
canvas_generated/messages/events_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
42
|
-
canvas_generated/messages/plugins_pb2.py,sha256=rHXTVHly9zKsA8qoT4cFRGkRKvYt7rPftz4KNT7pEe0,1271
|
|
43
|
-
canvas_generated/messages/plugins_pb2.pyi,sha256=G1seqytP8GlJJh-AL2CJ0VyUNlReEvK61C-Oh8QuGiE,501
|
|
44
|
-
canvas_generated/messages/plugins_pb2_grpc.py,sha256=1oboBPFxaTEXt9Aw7EAj8gXHDCNMhZD2VXqocC9l_gk,159
|
|
45
|
-
canvas_generated/services/plugin_runner_pb2.py,sha256=amsds-ckCjpalFkkC-2mzVsj-gdj5BNY9tx-SRf8WHM,1557
|
|
46
|
-
canvas_generated/services/plugin_runner_pb2.pyi,sha256=1w-Pa4k7HtlmQAr7B6sgV64zdZplBKQKHN-S8bjwO3w,265
|
|
47
|
-
canvas_generated/services/plugin_runner_pb2_grpc.py,sha256=EzJJVkP_AZ3dwBA7OxUito0NSalRmjjg8q9TZ_P18ww,4549
|
|
48
|
-
canvas_sdk/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
49
|
-
canvas_sdk/base.py,sha256=zrjlx5kRdJNwEAGLX2leNgOaNNQ8cG-DcMifHF_53bE,1622
|
|
50
|
-
canvas_sdk/commands/__init__.py,sha256=4JTiljkBJ2Da2mU3_VAJ5dcpxg0X3QAocYJBBMJRpGc,1116
|
|
51
|
-
canvas_sdk/commands/base.py,sha256=OnQ3wsWngWy7tUm2G41McNf6cMGooR2jENY2vapcbtw,4620
|
|
52
|
-
canvas_sdk/commands/commands/assess.py,sha256=zhAfctxDO--GCag_8C5puMUjPeQXGvBoIQB5afPn0kM,1726
|
|
53
|
-
canvas_sdk/commands/commands/diagnose.py,sha256=wtutzqwLSiIOJp2ujDnwQnuPzs6aXUjrQiFIwUHICU4,1018
|
|
54
|
-
canvas_sdk/commands/commands/goal.py,sha256=6plOw0MCEIbjCoMkQ_qGh0ms0AcYrgl871-FbXVgcy4,1608
|
|
55
|
-
canvas_sdk/commands/commands/history_present_illness.py,sha256=0eFOS563dsdTaFW77qADQPYBPpcEGKLw3siu4yDlAyk,431
|
|
56
|
-
canvas_sdk/commands/commands/medication_statement.py,sha256=DLu1QyyWUITNtTHELR34SX0CmDlJRL2AM9W3SRZVMJg,1023
|
|
57
|
-
canvas_sdk/commands/commands/plan.py,sha256=ZEOdkQyH0vK6kVM4LPMSKn_m5fDU3GSSzldpQtWYpUU,415
|
|
58
|
-
canvas_sdk/commands/commands/prescribe.py,sha256=n1dx9QUnv38i3urLcfrx8Q5mywK4cWkHnufn9rTey_U,2038
|
|
59
|
-
canvas_sdk/commands/commands/questionnaire.py,sha256=AY6XlK-9rHgBrzkJUmxA1M4sbxkl8hU9Pyt8OJa0SWE,647
|
|
60
|
-
canvas_sdk/commands/commands/reason_for_visit.py,sha256=20i2A8V4of_Q-Kqb37k-fUJ-JaHVGsrMtoIGZAYhPNw,1480
|
|
61
|
-
canvas_sdk/commands/commands/stop_medication.py,sha256=8FS-dIxZI7aOU6m1xMyP9KOkDnNS6R59q6KLtJuOS6M,718
|
|
62
|
-
canvas_sdk/commands/commands/update_goal.py,sha256=lL5XCGizQS7FbHZpWkDx16L7KTrHGQ3-NlcQiOVHW1M,1583
|
|
63
|
-
canvas_sdk/commands/constants.py,sha256=LVAuWvxDuDzsW74JUWIzy_lMLvte0_Grlldr-YCjgBw,176
|
|
64
|
-
canvas_sdk/commands/tests/test_utils.py,sha256=008nUdp5UCTyyFXI58KSgIofMt9njEbpXUh0RN1yr0A,5143
|
|
65
|
-
canvas_sdk/commands/tests/tests.py,sha256=lawX4BKlibIhc04mZJWNsWKSzyVr_fDSrAHIN89pmYo,15613
|
|
66
|
-
canvas_sdk/data/__init__.py,sha256=dmqlcw11-0DCbH2lOebwBCq6njSQ6BDhxygmncUgZRs,28
|
|
67
|
-
canvas_sdk/data/base.py,sha256=XbUctLoEdY8egrPzw_x2Ox41nurubh8sl4Kjbhu8rTE,795
|
|
68
|
-
canvas_sdk/data/data_access_layer_client.py,sha256=ujd6LnC7IzOvD6_IVpDQOQgaz_ZDtClwUN5j360e0P8,3400
|
|
69
|
-
canvas_sdk/data/exceptions.py,sha256=PRSD0N7AzqajebSK-vfJDaN8BGBEG5WTxejZaEMDZ6Y,305
|
|
70
|
-
canvas_sdk/data/patient.py,sha256=k0pmxkPUYYoHzWWtQf6h1__0cn1dy42NRcFsetMxs3M,742
|
|
71
|
-
canvas_sdk/data/staff.py,sha256=zmwKZlndqFdwsE3j14DD79MSzM9doIkeqqzToGDBjTs,168
|
|
72
|
-
canvas_sdk/data/task.py,sha256=VeOh45M6tQ0IPwPr03yK6EYa8xox3iJhoRBzqUdcq2k,1756
|
|
73
|
-
canvas_sdk/effects/__init__.py,sha256=oChQi5y_8mK2zDiNMwWYp6CaQX1_zbmwXILPF7iSt-4,69
|
|
74
|
-
canvas_sdk/effects/banner_alert/__init__.py,sha256=8z5l9rwonKEcRkvD5q4DWvHPYhKJzwyGuUYoUNKYwX4,158
|
|
75
|
-
canvas_sdk/effects/banner_alert/add_banner_alert.py,sha256=3rEtoW0O5BjQ1KEsVYCKkdfti0FksZjc8dOanOtpNa4,1270
|
|
76
|
-
canvas_sdk/effects/banner_alert/remove_banner_alert.py,sha256=j_EvpHHyU5RgFHOxkd6ieBOXS-vJTvxnzaq-Ixjc7ds,477
|
|
77
|
-
canvas_sdk/effects/base.py,sha256=9Jo8hCCRMhlqSQ7PIBYPRj3M1o4sGcwpmZLBRg4_nUA,712
|
|
78
|
-
canvas_sdk/events/__init__.py,sha256=JGZ-3uf0Luzr4kg5UqduupD4w6B2WVEgQ9WlcoMaPwE,81
|
|
79
|
-
canvas_sdk/handlers/__init__.py,sha256=VVz2_Xyb9720R2MZmSbGPG0T8u2a5u6zSDkWlwiJZv4,49
|
|
80
|
-
canvas_sdk/handlers/base.py,sha256=f-ZwAdj8t6fZlIPuGvqCmoRen14uMqVIJRUaDXlSXEM,371
|
|
81
|
-
canvas_sdk/handlers/cron_task.py,sha256=Q4_D3bDKE5hyEpCf0JnGSgZlnLh_g9RSP3oEfIuLJ9Y,945
|
|
82
|
-
canvas_sdk/protocols/__init__.py,sha256=GKtNMsJ5XaNOJUz9adE2_pONLeZqkZIrd9hXAU-jzvU,51
|
|
83
|
-
canvas_sdk/protocols/base.py,sha256=aQYAL0wVjkwUfb8cL7C6JgOcwpc4VQeipYJDFOFvWHg,143
|
|
84
|
-
canvas_sdk/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
85
|
-
canvas_sdk/utils/__init__.py,sha256=sFuhqcWvXb2-33FOuXZgWuUeC5jZL2MDoqjGoQZGwd8,60
|
|
86
|
-
canvas_sdk/utils/http.py,sha256=YOgUFp7FOFhbDwkGhCiD3JLZ342oNZR-qncMxv2qSjw,2159
|
|
87
|
-
canvas_sdk/utils/stats.py,sha256=7CNBwglLGFDTrEcSjLv3jAcaLzxy4geFNZpQf90osKI,660
|
|
88
|
-
canvas_sdk/utils/tests.py,sha256=t3MScbIfzXkQttMIvj0dRzJlFVS8LFU8WgWRrChM-H0,1931
|
|
89
|
-
canvas_sdk/views/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
90
|
-
logger/__init__.py,sha256=sf54RfJ48tCbXm5jTHAea3WWuSH5-AXRHxTNNKVuxgA,60
|
|
91
|
-
logger/logger.py,sha256=u103k5-yP62ifK1Hcp-PDTRrw_vOfLGeC-5raxNmBC0,1428
|
|
92
|
-
canvas-0.1.15.dist-info/METADATA,sha256=1sbQDXfVO4ofQAcawRy1drfTEbYzVzUdBzDMz1ZupsU,4253
|
|
93
|
-
canvas-0.1.15.dist-info/WHEEL,sha256=sP946D7jFCHeNz5Iq4fL4Lu-PrWrFsgfLXbbkciIZwg,88
|
|
94
|
-
canvas-0.1.15.dist-info/entry_points.txt,sha256=VSmSo1IZ3aEfL7enmLmlWSraS_IIkoXNVeyXzgRxFiY,46
|
|
95
|
-
canvas-0.1.15.dist-info/RECORD,,
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
# -*- coding: utf-8 -*-
|
|
2
|
-
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
-
# source: canvas_generated/data_access_layer/data_access_layer.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/data_access_layer/data_access_layer.proto\"\x10\n\x02ID\x12\n\n\x02id\x18\x01 \x01(\t\"\x8b\x01\n\x07Patient\x12\n\n\x02id\x18\x01 \x01(\t\x12\x17\n\nfirst_name\x18\x02 \x01(\tH\x00\x88\x01\x01\x12\x16\n\tlast_name\x18\x03 \x01(\tH\x01\x88\x01\x01\x12\x17\n\nbirth_date\x18\x04 \x01(\tH\x02\x88\x01\x01\x42\r\n\x0b_first_nameB\x0c\n\n_last_nameB\r\n\x0b_birth_date20\n\x0f\x44\x61taAccessLayer\x12\x1d\n\nGetPatient\x12\x03.ID\x1a\x08.Patient\"\x00\x62\x06proto3')
|
|
18
|
-
|
|
19
|
-
_globals = globals()
|
|
20
|
-
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
-
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'canvas_generated.data_access_layer.data_access_layer_pb2', _globals)
|
|
22
|
-
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
23
|
-
DESCRIPTOR._options = None
|
|
24
|
-
_globals['_ID']._serialized_start=62
|
|
25
|
-
_globals['_ID']._serialized_end=78
|
|
26
|
-
_globals['_PATIENT']._serialized_start=81
|
|
27
|
-
_globals['_PATIENT']._serialized_end=220
|
|
28
|
-
_globals['_DATAACCESSLAYER']._serialized_start=222
|
|
29
|
-
_globals['_DATAACCESSLAYER']._serialized_end=270
|
|
30
|
-
# @@protoc_insertion_point(module_scope)
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
from google.protobuf import descriptor as _descriptor
|
|
2
|
-
from google.protobuf import message as _message
|
|
3
|
-
from typing import ClassVar as _ClassVar, Optional as _Optional
|
|
4
|
-
|
|
5
|
-
DESCRIPTOR: _descriptor.FileDescriptor
|
|
6
|
-
|
|
7
|
-
class ID(_message.Message):
|
|
8
|
-
__slots__ = ("id",)
|
|
9
|
-
ID_FIELD_NUMBER: _ClassVar[int]
|
|
10
|
-
id: str
|
|
11
|
-
def __init__(self, id: _Optional[str] = ...) -> None: ...
|
|
12
|
-
|
|
13
|
-
class Patient(_message.Message):
|
|
14
|
-
__slots__ = ("id", "first_name", "last_name", "birth_date")
|
|
15
|
-
ID_FIELD_NUMBER: _ClassVar[int]
|
|
16
|
-
FIRST_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
17
|
-
LAST_NAME_FIELD_NUMBER: _ClassVar[int]
|
|
18
|
-
BIRTH_DATE_FIELD_NUMBER: _ClassVar[int]
|
|
19
|
-
id: str
|
|
20
|
-
first_name: str
|
|
21
|
-
last_name: str
|
|
22
|
-
birth_date: str
|
|
23
|
-
def __init__(self, id: _Optional[str] = ..., first_name: _Optional[str] = ..., last_name: _Optional[str] = ..., birth_date: _Optional[str] = ...) -> None: ...
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
-
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
-
import grpc
|
|
4
|
-
|
|
5
|
-
from canvas_generated.data_access_layer import data_access_layer_pb2 as canvas__generated_dot_data__access__layer_dot_data__access__layer__pb2
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
class DataAccessLayerStub(object):
|
|
9
|
-
"""Missing associated documentation comment in .proto file."""
|
|
10
|
-
|
|
11
|
-
def __init__(self, channel):
|
|
12
|
-
"""Constructor.
|
|
13
|
-
|
|
14
|
-
Args:
|
|
15
|
-
channel: A grpc.Channel.
|
|
16
|
-
"""
|
|
17
|
-
self.GetPatient = channel.unary_unary(
|
|
18
|
-
'/DataAccessLayer/GetPatient',
|
|
19
|
-
request_serializer=canvas__generated_dot_data__access__layer_dot_data__access__layer__pb2.ID.SerializeToString,
|
|
20
|
-
response_deserializer=canvas__generated_dot_data__access__layer_dot_data__access__layer__pb2.Patient.FromString,
|
|
21
|
-
)
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
class DataAccessLayerServicer(object):
|
|
25
|
-
"""Missing associated documentation comment in .proto file."""
|
|
26
|
-
|
|
27
|
-
def GetPatient(self, request, context):
|
|
28
|
-
"""Missing associated documentation comment in .proto file."""
|
|
29
|
-
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
30
|
-
context.set_details('Method not implemented!')
|
|
31
|
-
raise NotImplementedError('Method not implemented!')
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
def add_DataAccessLayerServicer_to_server(servicer, server):
|
|
35
|
-
rpc_method_handlers = {
|
|
36
|
-
'GetPatient': grpc.unary_unary_rpc_method_handler(
|
|
37
|
-
servicer.GetPatient,
|
|
38
|
-
request_deserializer=canvas__generated_dot_data__access__layer_dot_data__access__layer__pb2.ID.FromString,
|
|
39
|
-
response_serializer=canvas__generated_dot_data__access__layer_dot_data__access__layer__pb2.Patient.SerializeToString,
|
|
40
|
-
),
|
|
41
|
-
}
|
|
42
|
-
generic_handler = grpc.method_handlers_generic_handler(
|
|
43
|
-
'DataAccessLayer', rpc_method_handlers)
|
|
44
|
-
server.add_generic_rpc_handlers((generic_handler,))
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
# This class is part of an EXPERIMENTAL API.
|
|
48
|
-
class DataAccessLayer(object):
|
|
49
|
-
"""Missing associated documentation comment in .proto file."""
|
|
50
|
-
|
|
51
|
-
@staticmethod
|
|
52
|
-
def GetPatient(request,
|
|
53
|
-
target,
|
|
54
|
-
options=(),
|
|
55
|
-
channel_credentials=None,
|
|
56
|
-
call_credentials=None,
|
|
57
|
-
insecure=False,
|
|
58
|
-
compression=None,
|
|
59
|
-
wait_for_ready=None,
|
|
60
|
-
timeout=None,
|
|
61
|
-
metadata=None):
|
|
62
|
-
return grpc.experimental.unary_unary(request, target, '/DataAccessLayer/GetPatient',
|
|
63
|
-
canvas__generated_dot_data__access__layer_dot_data__access__layer__pb2.ID.SerializeToString,
|
|
64
|
-
canvas__generated_dot_data__access__layer_dot_data__access__layer__pb2.Patient.FromString,
|
|
65
|
-
options, channel_credentials,
|
|
66
|
-
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@@ -1,95 +0,0 @@
|
|
|
1
|
-
"""
|
|
2
|
-
Data Access Layer client.
|
|
3
|
-
|
|
4
|
-
This module is primarily responsible for executing calls to the gRPC service so that such details
|
|
5
|
-
are abstracted away from callers. The return values of the methods on the client class are protobufs
|
|
6
|
-
which must be mapped to user-facing objects.
|
|
7
|
-
"""
|
|
8
|
-
|
|
9
|
-
import functools
|
|
10
|
-
from collections.abc import Callable
|
|
11
|
-
from types import FunctionType
|
|
12
|
-
from typing import Any
|
|
13
|
-
|
|
14
|
-
import grpc
|
|
15
|
-
from grpc import StatusCode
|
|
16
|
-
|
|
17
|
-
from canvas_generated.data_access_layer.data_access_layer_pb2 import ID, Patient
|
|
18
|
-
from canvas_generated.data_access_layer.data_access_layer_pb2_grpc import (
|
|
19
|
-
DataAccessLayerStub,
|
|
20
|
-
)
|
|
21
|
-
from settings import DAL_TARGET
|
|
22
|
-
|
|
23
|
-
from . import exceptions
|
|
24
|
-
from .exceptions import DataModuleError
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
class _DataAccessLayerClientMeta(type):
|
|
28
|
-
"""
|
|
29
|
-
Metaclass for the Data Access Layer client class.
|
|
30
|
-
|
|
31
|
-
Wraps all methods of a class with a gRPC error handler.
|
|
32
|
-
"""
|
|
33
|
-
|
|
34
|
-
def __new__(cls, name: str, bases: tuple, attrs: dict) -> type:
|
|
35
|
-
for attr_name, attr_value in attrs.items():
|
|
36
|
-
if isinstance(attr_value, FunctionType):
|
|
37
|
-
attrs[attr_name] = cls.handle_grpc_errors(attr_value)
|
|
38
|
-
return super().__new__(cls, name, bases, attrs)
|
|
39
|
-
|
|
40
|
-
@classmethod
|
|
41
|
-
def handle_grpc_errors(cls, func: Callable[..., Any]) -> Callable[..., Any]:
|
|
42
|
-
"""
|
|
43
|
-
Decorator that wraps a try-except block around all class methods. gRPC errors are mapped to
|
|
44
|
-
a defined set of exceptions from a Data Access Layer exception hierarchy.
|
|
45
|
-
"""
|
|
46
|
-
|
|
47
|
-
@functools.wraps(func)
|
|
48
|
-
def wrapper(*args: Any, **kwargs: Any) -> Any:
|
|
49
|
-
try:
|
|
50
|
-
return func(*args, **kwargs)
|
|
51
|
-
except grpc.RpcError as error:
|
|
52
|
-
# gRPC exceptions aren't tightly defined, so we'll try to get a status code and
|
|
53
|
-
# error details, and handle it if we can't
|
|
54
|
-
try:
|
|
55
|
-
status_code = error.code()
|
|
56
|
-
except Exception:
|
|
57
|
-
status_code = None
|
|
58
|
-
|
|
59
|
-
try:
|
|
60
|
-
error_details = error.details()
|
|
61
|
-
except Exception:
|
|
62
|
-
error_details = ""
|
|
63
|
-
|
|
64
|
-
# Map more gRPC status codes to exception types as needed
|
|
65
|
-
match status_code:
|
|
66
|
-
case StatusCode.NOT_FOUND:
|
|
67
|
-
raise exceptions.DataModuleNotFoundError(error_details) from error
|
|
68
|
-
case _:
|
|
69
|
-
raise exceptions.DataModuleError from error
|
|
70
|
-
except Exception as exception:
|
|
71
|
-
raise DataModuleError from exception
|
|
72
|
-
|
|
73
|
-
return wrapper
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
class _DataAccessLayerClient(metaclass=_DataAccessLayerClientMeta):
|
|
77
|
-
"""
|
|
78
|
-
Data Access Layer client.
|
|
79
|
-
|
|
80
|
-
Do not instantiate -- just import the global variable DAL_CLIENT.
|
|
81
|
-
"""
|
|
82
|
-
|
|
83
|
-
def __init__(self) -> None:
|
|
84
|
-
self._channel = grpc.insecure_channel(DAL_TARGET)
|
|
85
|
-
self._stub = DataAccessLayerStub(self._channel)
|
|
86
|
-
|
|
87
|
-
def get_patient(self, id: str) -> Patient:
|
|
88
|
-
"""Given an ID, get the Patient from the Data Access Layer."""
|
|
89
|
-
return self._stub.GetPatient(ID(id=id))
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
# There should only be one instantiation of the client, so this global will act as a singleton in a
|
|
93
|
-
# way. This is the value that should be imported; no one should be instantiating the DAL client
|
|
94
|
-
# (hence the underscore notation indicating that the class is "private").
|
|
95
|
-
DAL_CLIENT = _DataAccessLayerClient()
|
canvas_sdk/data/exceptions.py
DELETED
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
"""Data Access Layer exceptions."""
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
class DataModuleError(RuntimeError):
|
|
5
|
-
"""
|
|
6
|
-
General Data Access Layer error; base class and also used to represent errors of indeterminate
|
|
7
|
-
cause.
|
|
8
|
-
"""
|
|
9
|
-
|
|
10
|
-
pass
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
class DataModuleNotFoundError(DataModuleError):
|
|
14
|
-
"""Object not found error."""
|
|
15
|
-
|
|
16
|
-
pass
|
|
File without changes
|
|
File without changes
|