canvas 0.45.0__py3-none-any.whl → 0.47.0__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of canvas might be problematic. Click here for more details.
- {canvas-0.45.0.dist-info → canvas-0.47.0.dist-info}/METADATA +3 -2
- {canvas-0.45.0.dist-info → canvas-0.47.0.dist-info}/RECORD +62 -57
- canvas_generated/messages/effects_pb2.py +2 -2
- canvas_generated/messages/effects_pb2.pyi +10 -0
- canvas_generated/messages/events_pb2.py +2 -2
- canvas_generated/messages/events_pb2.pyi +18 -0
- canvas_sdk/commands/commands/exam.py +2 -1
- canvas_sdk/commands/commands/immunization_statement.py +32 -0
- canvas_sdk/commands/commands/questionnaire/__init__.py +18 -3
- canvas_sdk/commands/commands/questionnaire/question.py +3 -2
- canvas_sdk/commands/commands/questionnaire/toggle_questions.py +68 -0
- canvas_sdk/commands/commands/review_of_systems.py +2 -1
- canvas_sdk/v1/data/__init__.py +17 -3
- canvas_sdk/v1/data/allergy_intolerance.py +16 -19
- canvas_sdk/v1/data/appointment.py +10 -14
- canvas_sdk/v1/data/assessment.py +9 -10
- canvas_sdk/v1/data/banner_alert.py +12 -12
- canvas_sdk/v1/data/base.py +45 -1
- canvas_sdk/v1/data/billing.py +13 -18
- canvas_sdk/v1/data/business_line.py +7 -8
- canvas_sdk/v1/data/care_team.py +14 -17
- canvas_sdk/v1/data/charge_description_master.py +29 -0
- canvas_sdk/v1/data/claim.py +87 -95
- canvas_sdk/v1/data/claim_line_item.py +17 -18
- canvas_sdk/v1/data/command.py +8 -9
- canvas_sdk/v1/data/condition.py +9 -12
- canvas_sdk/v1/data/coverage.py +47 -53
- canvas_sdk/v1/data/detected_issue.py +16 -20
- canvas_sdk/v1/data/device.py +20 -21
- canvas_sdk/v1/data/discount.py +8 -8
- canvas_sdk/v1/data/imaging.py +24 -30
- canvas_sdk/v1/data/invoice.py +3 -3
- canvas_sdk/v1/data/lab.py +65 -84
- canvas_sdk/v1/data/line_item_transaction.py +7 -9
- canvas_sdk/v1/data/medication.py +14 -17
- canvas_sdk/v1/data/message.py +10 -17
- canvas_sdk/v1/data/note.py +27 -36
- canvas_sdk/v1/data/observation.py +24 -33
- canvas_sdk/v1/data/organization.py +14 -15
- canvas_sdk/v1/data/patient.py +57 -68
- canvas_sdk/v1/data/patient_consent.py +14 -19
- canvas_sdk/v1/data/payment_collection.py +7 -8
- canvas_sdk/v1/data/payor_specific_charge.py +10 -12
- canvas_sdk/v1/data/posting.py +10 -18
- canvas_sdk/v1/data/practicelocation.py +17 -21
- canvas_sdk/v1/data/protocol_override.py +8 -10
- canvas_sdk/v1/data/questionnaire.py +56 -73
- canvas_sdk/v1/data/reason_for_visit.py +7 -9
- canvas_sdk/v1/data/staff.py +61 -57
- canvas_sdk/v1/data/task.py +21 -31
- canvas_sdk/v1/data/team.py +15 -18
- canvas_sdk/v1/data/user.py +3 -3
- canvas_sdk/v1/data/utils.py +6 -0
- plugin_runner/allowed-module-imports.json +1340 -0
- plugin_runner/generate_allowed_imports.py +97 -0
- plugin_runner/plugin_runner.py +9 -0
- plugin_runner/sandbox.py +51 -60
- protobufs/canvas_generated/messages/effects.proto +6 -0
- protobufs/canvas_generated/messages/events.proto +12 -1
- settings.py +56 -22
- {canvas-0.45.0.dist-info → canvas-0.47.0.dist-info}/WHEEL +0 -0
- {canvas-0.45.0.dist-info → canvas-0.47.0.dist-info}/entry_points.txt +0 -0
canvas_sdk/v1/data/note.py
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
from django.contrib.postgres.fields import ArrayField
|
|
2
2
|
from django.db import models
|
|
3
3
|
|
|
4
|
+
from canvas_sdk.v1.data.base import IdentifiableModel
|
|
5
|
+
|
|
4
6
|
|
|
5
7
|
class NoteTypeCategories(models.TextChoices):
|
|
6
8
|
"""Note type categories."""
|
|
@@ -111,35 +113,34 @@ class NoteStates(models.TextChoices):
|
|
|
111
113
|
CONFIRM_IMPORT = "CNF", "Confirmed"
|
|
112
114
|
|
|
113
115
|
|
|
114
|
-
class NoteType(
|
|
116
|
+
class NoteType(IdentifiableModel):
|
|
115
117
|
"""NoteType."""
|
|
116
118
|
|
|
117
119
|
objects: models.Manager["NoteType"]
|
|
118
120
|
|
|
119
121
|
class Meta:
|
|
120
|
-
managed = False
|
|
121
122
|
db_table = "canvas_sdk_data_api_notetype_001"
|
|
122
123
|
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
code = models.CharField()
|
|
130
|
-
display = models.CharField()
|
|
124
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
125
|
+
modified = models.DateTimeField(auto_now=True)
|
|
126
|
+
system = models.CharField(max_length=255)
|
|
127
|
+
version = models.CharField(max_length=255)
|
|
128
|
+
code = models.CharField(max_length=255)
|
|
129
|
+
display = models.CharField(max_length=1000)
|
|
131
130
|
user_selected = models.BooleanField()
|
|
132
|
-
name = models.CharField()
|
|
133
|
-
icon = models.CharField()
|
|
134
|
-
category = models.CharField(choices=NoteTypeCategories.choices)
|
|
131
|
+
name = models.CharField(max_length=250)
|
|
132
|
+
icon = models.CharField(max_length=250)
|
|
133
|
+
category = models.CharField(choices=NoteTypeCategories.choices, max_length=50)
|
|
135
134
|
rank = models.PositiveIntegerField()
|
|
136
135
|
is_default_appointment_type = models.BooleanField()
|
|
137
136
|
is_scheduleable = models.BooleanField()
|
|
138
137
|
is_telehealth = models.BooleanField()
|
|
139
138
|
is_billable = models.BooleanField()
|
|
140
139
|
defer_place_of_service_to_practice_location = models.BooleanField()
|
|
141
|
-
available_places_of_service = ArrayField(
|
|
142
|
-
|
|
140
|
+
available_places_of_service = ArrayField(
|
|
141
|
+
models.CharField(choices=PracticeLocationPOS.choices, max_length=5)
|
|
142
|
+
)
|
|
143
|
+
default_place_of_service = models.CharField(choices=PracticeLocationPOS.choices, max_length=5)
|
|
143
144
|
is_system_managed = models.BooleanField()
|
|
144
145
|
is_visible = models.BooleanField()
|
|
145
146
|
is_active = models.BooleanField()
|
|
@@ -151,24 +152,21 @@ class NoteType(models.Model):
|
|
|
151
152
|
online_duration = models.IntegerField()
|
|
152
153
|
|
|
153
154
|
|
|
154
|
-
class Note(
|
|
155
|
+
class Note(IdentifiableModel):
|
|
155
156
|
"""Note."""
|
|
156
157
|
|
|
157
158
|
class Meta:
|
|
158
|
-
managed = False
|
|
159
159
|
db_table = "canvas_sdk_data_api_note_001"
|
|
160
160
|
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
created = models.DateTimeField()
|
|
164
|
-
modified = models.DateTimeField()
|
|
161
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
162
|
+
modified = models.DateTimeField(auto_now=True)
|
|
165
163
|
patient = models.ForeignKey(
|
|
166
164
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="notes", null=True
|
|
167
165
|
)
|
|
168
166
|
provider = models.ForeignKey(
|
|
169
167
|
"v1.Staff", on_delete=models.DO_NOTHING, related_name="notes", null=True
|
|
170
168
|
)
|
|
171
|
-
note_type = models.CharField(choices=NoteTypes.choices, null=True)
|
|
169
|
+
note_type = models.CharField(choices=NoteTypes.choices, null=True, max_length=50)
|
|
172
170
|
note_type_version = models.ForeignKey(
|
|
173
171
|
"v1.NoteType", on_delete=models.DO_NOTHING, related_name="notes", null=True
|
|
174
172
|
)
|
|
@@ -176,48 +174,41 @@ class Note(models.Model):
|
|
|
176
174
|
body = models.JSONField()
|
|
177
175
|
originator = models.ForeignKey("v1.CanvasUser", on_delete=models.DO_NOTHING, null=True)
|
|
178
176
|
last_modified_by_staff = models.ForeignKey("v1.Staff", on_delete=models.DO_NOTHING, null=True)
|
|
179
|
-
checksum = models.CharField()
|
|
177
|
+
checksum = models.CharField(max_length=32)
|
|
180
178
|
billing_note = models.TextField()
|
|
181
179
|
# TODO -implement InpatientStay model
|
|
182
180
|
# inpatient_stay = models.ForeignKey("v1.InpatientStay", on_delete=models.DO_NOTHING, null=True)
|
|
183
181
|
related_data = models.JSONField()
|
|
184
182
|
location = models.ForeignKey("v1.PracticeLocation", on_delete=models.DO_NOTHING, null=True)
|
|
185
183
|
datetime_of_service = models.DateTimeField()
|
|
186
|
-
place_of_service = models.CharField()
|
|
184
|
+
place_of_service = models.CharField(max_length=255)
|
|
187
185
|
|
|
188
186
|
|
|
189
|
-
class NoteStateChangeEvent(
|
|
187
|
+
class NoteStateChangeEvent(IdentifiableModel):
|
|
190
188
|
"""NoteStateChangeEvent."""
|
|
191
189
|
|
|
192
190
|
class Meta:
|
|
193
|
-
managed = False
|
|
194
191
|
db_table = "canvas_sdk_data_api_notestatechangeevent_001"
|
|
195
192
|
|
|
196
|
-
id = models.UUIDField()
|
|
197
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
198
193
|
created = models.DateTimeField()
|
|
199
194
|
modified = models.DateTimeField()
|
|
200
195
|
note = models.ForeignKey("v1.Note", on_delete=models.DO_NOTHING, related_name="state_history")
|
|
201
196
|
originator = models.ForeignKey("v1.CanvasUser", on_delete=models.DO_NOTHING, null=True)
|
|
202
|
-
state = models.CharField(choices=NoteStates.choices)
|
|
203
|
-
note_state_document = models.CharField()
|
|
197
|
+
state = models.CharField(choices=NoteStates.choices, max_length=3)
|
|
198
|
+
note_state_document = models.CharField(max_length=100, null=True)
|
|
204
199
|
note_state_html = models.TextField()
|
|
205
200
|
|
|
206
201
|
|
|
207
|
-
class CurrentNoteStateEvent(
|
|
202
|
+
class CurrentNoteStateEvent(IdentifiableModel):
|
|
208
203
|
"""
|
|
209
204
|
CurrentNoteStateEvent is a special model backed by a view which only includes the latest
|
|
210
205
|
NoteStateChangeEvent for any given note_id.
|
|
211
206
|
"""
|
|
212
207
|
|
|
213
208
|
class Meta:
|
|
214
|
-
managed = False
|
|
215
|
-
app_label = "canvas_sdk"
|
|
216
209
|
db_table = "canvas_sdk_data_current_note_state_001"
|
|
217
210
|
|
|
218
|
-
|
|
219
|
-
dbid: models.BigIntegerField = models.BigIntegerField(primary_key=True)
|
|
220
|
-
state: models.CharField = models.CharField(choices=NoteStates.choices)
|
|
211
|
+
state = models.CharField(choices=NoteStates.choices, max_length=3)
|
|
221
212
|
note = models.ForeignKey("v1.Note", on_delete=models.DO_NOTHING, related_name="+")
|
|
222
213
|
|
|
223
214
|
def editable(self) -> bool:
|
|
@@ -6,6 +6,8 @@ from canvas_sdk.v1.data.base import (
|
|
|
6
6
|
BaseModelManager,
|
|
7
7
|
CommittableQuerySetMixin,
|
|
8
8
|
ForPatientQuerySetMixin,
|
|
9
|
+
IdentifiableModel,
|
|
10
|
+
Model,
|
|
9
11
|
ValueSetLookupQuerySet,
|
|
10
12
|
)
|
|
11
13
|
|
|
@@ -21,19 +23,16 @@ class ObservationQuerySet(
|
|
|
21
23
|
ObservationManager = BaseModelManager.from_queryset(ObservationQuerySet)
|
|
22
24
|
|
|
23
25
|
|
|
24
|
-
class Observation(
|
|
26
|
+
class Observation(IdentifiableModel):
|
|
25
27
|
"""Observation."""
|
|
26
28
|
|
|
27
29
|
class Meta:
|
|
28
|
-
managed = False
|
|
29
30
|
db_table = "canvas_sdk_data_api_observation_001"
|
|
30
31
|
|
|
31
32
|
objects = cast(ObservationQuerySet, ObservationManager())
|
|
32
33
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
created = models.DateTimeField()
|
|
36
|
-
modified = models.DateTimeField()
|
|
34
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
35
|
+
modified = models.DateTimeField(auto_now=True)
|
|
37
36
|
originator = models.ForeignKey(
|
|
38
37
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
39
38
|
)
|
|
@@ -50,7 +49,7 @@ class Observation(models.Model):
|
|
|
50
49
|
is_member_of = models.ForeignKey(
|
|
51
50
|
"self", on_delete=models.DO_NOTHING, related_name="members", null=True
|
|
52
51
|
)
|
|
53
|
-
category = models.CharField()
|
|
52
|
+
category = models.CharField(max_length=14)
|
|
54
53
|
units = models.TextField()
|
|
55
54
|
value = models.TextField()
|
|
56
55
|
note_id = models.BigIntegerField()
|
|
@@ -58,34 +57,30 @@ class Observation(models.Model):
|
|
|
58
57
|
effective_datetime = models.DateTimeField()
|
|
59
58
|
|
|
60
59
|
|
|
61
|
-
class ObservationCoding(
|
|
60
|
+
class ObservationCoding(Model):
|
|
62
61
|
"""ObservationCoding."""
|
|
63
62
|
|
|
64
63
|
class Meta:
|
|
65
|
-
managed = False
|
|
66
64
|
db_table = "canvas_sdk_data_api_observationcoding_001"
|
|
67
65
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
display = models.CharField()
|
|
66
|
+
system = models.CharField(max_length=255)
|
|
67
|
+
version = models.CharField(max_length=255)
|
|
68
|
+
code = models.CharField(max_length=255)
|
|
69
|
+
display = models.CharField(max_length=1000)
|
|
73
70
|
user_selected = models.BooleanField()
|
|
74
71
|
observation = models.ForeignKey(
|
|
75
72
|
Observation, on_delete=models.DO_NOTHING, related_name="codings", null=True
|
|
76
73
|
)
|
|
77
74
|
|
|
78
75
|
|
|
79
|
-
class ObservationComponent(
|
|
76
|
+
class ObservationComponent(Model):
|
|
80
77
|
"""ObservationComponent."""
|
|
81
78
|
|
|
82
79
|
class Meta:
|
|
83
|
-
managed = False
|
|
84
80
|
db_table = "canvas_sdk_data_api_observationcomponent_001"
|
|
85
81
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
modified = models.DateTimeField()
|
|
82
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
83
|
+
modified = models.DateTimeField(auto_now=True)
|
|
89
84
|
observation = models.ForeignKey(
|
|
90
85
|
Observation, on_delete=models.DO_NOTHING, related_name="components", null=True
|
|
91
86
|
)
|
|
@@ -94,36 +89,32 @@ class ObservationComponent(models.Model):
|
|
|
94
89
|
name = models.TextField()
|
|
95
90
|
|
|
96
91
|
|
|
97
|
-
class ObservationComponentCoding(
|
|
92
|
+
class ObservationComponentCoding(Model):
|
|
98
93
|
"""ObservationComponentCoding."""
|
|
99
94
|
|
|
100
95
|
class Meta:
|
|
101
|
-
managed = False
|
|
102
96
|
db_table = "canvas_sdk_data_api_observationcomponentcoding_001"
|
|
103
97
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
display = models.CharField()
|
|
98
|
+
system = models.CharField(max_length=255)
|
|
99
|
+
version = models.CharField(max_length=255)
|
|
100
|
+
code = models.CharField(max_length=255)
|
|
101
|
+
display = models.CharField(max_length=1000)
|
|
109
102
|
user_selected = models.BooleanField()
|
|
110
103
|
observation_component = models.ForeignKey(
|
|
111
104
|
ObservationComponent, on_delete=models.DO_NOTHING, related_name="codings", null=True
|
|
112
105
|
)
|
|
113
106
|
|
|
114
107
|
|
|
115
|
-
class ObservationValueCoding(
|
|
108
|
+
class ObservationValueCoding(Model):
|
|
116
109
|
"""ObservationValueCoding."""
|
|
117
110
|
|
|
118
111
|
class Meta:
|
|
119
|
-
managed = False
|
|
120
112
|
db_table = "canvas_sdk_data_api_observationvaluecoding_001"
|
|
121
113
|
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
display = models.CharField()
|
|
114
|
+
system = models.CharField(max_length=255)
|
|
115
|
+
version = models.CharField(max_length=255)
|
|
116
|
+
code = models.CharField(max_length=255)
|
|
117
|
+
display = models.CharField(max_length=1000)
|
|
127
118
|
user_selected = models.BooleanField()
|
|
128
119
|
observation = models.ForeignKey(
|
|
129
120
|
Observation, on_delete=models.DO_NOTHING, related_name="value_codings", null=True
|
|
@@ -1,29 +1,28 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import Model
|
|
3
4
|
from canvas_sdk.v1.data.common import TaxIDType
|
|
4
5
|
|
|
5
6
|
|
|
6
|
-
class Organization(
|
|
7
|
+
class Organization(Model):
|
|
7
8
|
"""Organization."""
|
|
8
9
|
|
|
9
10
|
class Meta:
|
|
10
|
-
managed = False
|
|
11
11
|
db_table = "canvas_sdk_data_api_organization_001"
|
|
12
12
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
background_gradient = models.CharField()
|
|
13
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
14
|
+
modified = models.DateTimeField(auto_now=True)
|
|
15
|
+
full_name = models.CharField(max_length=255)
|
|
16
|
+
short_name = models.CharField(max_length=255)
|
|
17
|
+
subdomain = models.CharField(max_length=100)
|
|
18
|
+
logo_url = models.CharField(max_length=255)
|
|
19
|
+
background_image_url = models.CharField(max_length=255)
|
|
20
|
+
background_gradient = models.CharField(max_length=255)
|
|
22
21
|
active = models.BooleanField()
|
|
23
|
-
tax_id = models.CharField(null=True)
|
|
24
|
-
tax_id_type = models.CharField(choices=TaxIDType.choices)
|
|
25
|
-
group_npi_number = models.CharField()
|
|
26
|
-
group_taxonomy_number = models.CharField()
|
|
22
|
+
tax_id = models.CharField(null=True, max_length=25)
|
|
23
|
+
tax_id_type = models.CharField(choices=TaxIDType.choices, max_length=1)
|
|
24
|
+
group_npi_number = models.CharField(max_length=10)
|
|
25
|
+
group_taxonomy_number = models.CharField(max_length=10)
|
|
27
26
|
include_zz_qualifier = models.BooleanField()
|
|
28
27
|
main_location = models.OneToOneField(
|
|
29
28
|
"v1.PracticeLocation", on_delete=models.DO_NOTHING, related_name="+"
|
canvas_sdk/v1/data/patient.py
CHANGED
|
@@ -7,6 +7,7 @@ from django.contrib.postgres.fields import ArrayField
|
|
|
7
7
|
from django.db import models
|
|
8
8
|
from django.db.models import TextChoices
|
|
9
9
|
|
|
10
|
+
from canvas_sdk.v1.data.base import IdentifiableModel, Model
|
|
10
11
|
from canvas_sdk.v1.data.common import (
|
|
11
12
|
AddressState,
|
|
12
13
|
AddressType,
|
|
@@ -15,6 +16,7 @@ from canvas_sdk.v1.data.common import (
|
|
|
15
16
|
ContactPointSystem,
|
|
16
17
|
ContactPointUse,
|
|
17
18
|
)
|
|
19
|
+
from canvas_sdk.v1.data.utils import create_key
|
|
18
20
|
|
|
19
21
|
if TYPE_CHECKING:
|
|
20
22
|
from django_stubs_ext.db.models.manager import RelatedManager
|
|
@@ -40,47 +42,47 @@ class PatientSettingConstants:
|
|
|
40
42
|
PREFERRED_SCHEDULING_TIMEZONE = "preferredSchedulingTimezone"
|
|
41
43
|
|
|
42
44
|
|
|
43
|
-
class Patient(
|
|
45
|
+
class Patient(Model):
|
|
44
46
|
"""A class representing a patient."""
|
|
45
47
|
|
|
46
48
|
class Meta:
|
|
47
|
-
managed = False
|
|
48
49
|
db_table = "canvas_sdk_data_api_patient_001"
|
|
49
50
|
|
|
50
|
-
id = models.CharField(
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
51
|
+
id = models.CharField(
|
|
52
|
+
max_length=32, db_column="key", unique=True, editable=False, default=create_key
|
|
53
|
+
)
|
|
54
|
+
first_name = models.CharField(max_length=255)
|
|
55
|
+
last_name = models.CharField(max_length=255)
|
|
54
56
|
birth_date = models.DateField()
|
|
55
57
|
business_line = models.ForeignKey(
|
|
56
58
|
"v1.BusinessLine", on_delete=models.DO_NOTHING, related_name="patients"
|
|
57
59
|
)
|
|
58
|
-
sex_at_birth = models.CharField(choices=SexAtBirth.choices)
|
|
59
|
-
created = models.DateTimeField()
|
|
60
|
-
modified = models.DateTimeField()
|
|
61
|
-
prefix = models.CharField()
|
|
62
|
-
suffix = models.CharField()
|
|
63
|
-
middle_name = models.CharField()
|
|
64
|
-
maiden_name = models.CharField()
|
|
65
|
-
nickname = models.CharField()
|
|
66
|
-
sexual_orientation_term = models.CharField()
|
|
67
|
-
sexual_orientation_code = models.CharField()
|
|
68
|
-
gender_identity_term = models.CharField()
|
|
69
|
-
gender_identity_code = models.CharField()
|
|
70
|
-
preferred_pronouns = models.CharField()
|
|
71
|
-
biological_race_codes = ArrayField(models.CharField())
|
|
72
|
-
last_known_timezone = models.CharField()
|
|
73
|
-
mrn = models.CharField()
|
|
60
|
+
sex_at_birth = models.CharField(choices=SexAtBirth.choices, max_length=3)
|
|
61
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
62
|
+
modified = models.DateTimeField(auto_now=True)
|
|
63
|
+
prefix = models.CharField(max_length=100)
|
|
64
|
+
suffix = models.CharField(max_length=100)
|
|
65
|
+
middle_name = models.CharField(max_length=255)
|
|
66
|
+
maiden_name = models.CharField(max_length=255)
|
|
67
|
+
nickname = models.CharField(max_length=255)
|
|
68
|
+
sexual_orientation_term = models.CharField(max_length=255)
|
|
69
|
+
sexual_orientation_code = models.CharField(max_length=255)
|
|
70
|
+
gender_identity_term = models.CharField(max_length=255)
|
|
71
|
+
gender_identity_code = models.CharField(max_length=255)
|
|
72
|
+
preferred_pronouns = models.CharField(max_length=255)
|
|
73
|
+
biological_race_codes = ArrayField(models.CharField(max_length=100))
|
|
74
|
+
last_known_timezone = models.CharField(max_length=32)
|
|
75
|
+
mrn = models.CharField(max_length=9)
|
|
74
76
|
active = models.BooleanField()
|
|
75
77
|
deceased = models.BooleanField()
|
|
76
78
|
deceased_datetime = models.DateTimeField()
|
|
77
79
|
deceased_cause = models.TextField()
|
|
78
80
|
deceased_comment = models.TextField()
|
|
79
|
-
other_gender_description = models.CharField()
|
|
80
|
-
social_security_number = models.CharField()
|
|
81
|
+
other_gender_description = models.CharField(max_length=255)
|
|
82
|
+
social_security_number = models.CharField(max_length=9)
|
|
81
83
|
administrative_note = models.TextField()
|
|
82
84
|
clinical_note = models.TextField()
|
|
83
|
-
mothers_maiden_name = models.CharField()
|
|
85
|
+
mothers_maiden_name = models.CharField(max_length=255)
|
|
84
86
|
multiple_birth_indicator = models.BooleanField()
|
|
85
87
|
birth_order = models.BigIntegerField()
|
|
86
88
|
default_location_id = models.BigIntegerField()
|
|
@@ -143,53 +145,47 @@ class Patient(models.Model):
|
|
|
143
145
|
return self.nickname or self.first_name
|
|
144
146
|
|
|
145
147
|
|
|
146
|
-
class PatientContactPoint(
|
|
148
|
+
class PatientContactPoint(IdentifiableModel):
|
|
147
149
|
"""A class representing a patient contact point."""
|
|
148
150
|
|
|
149
151
|
class Meta:
|
|
150
|
-
managed = False
|
|
151
152
|
db_table = "canvas_sdk_data_api_patientcontactpoint_001"
|
|
152
153
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
use = models.CharField(choices=ContactPointUse.choices)
|
|
158
|
-
use_notes = models.CharField()
|
|
154
|
+
system = models.CharField(choices=ContactPointSystem.choices, max_length=20)
|
|
155
|
+
value = models.CharField(max_length=100)
|
|
156
|
+
use = models.CharField(choices=ContactPointUse.choices, max_length=20)
|
|
157
|
+
use_notes = models.CharField(max_length=255)
|
|
159
158
|
rank = models.IntegerField()
|
|
160
|
-
state = models.CharField(choices=ContactPointState.choices)
|
|
159
|
+
state = models.CharField(choices=ContactPointState.choices, max_length=20)
|
|
161
160
|
patient = models.ForeignKey(
|
|
162
161
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="telecom", null=True
|
|
163
162
|
)
|
|
164
163
|
has_consent = models.BooleanField()
|
|
165
164
|
last_verified = models.DateTimeField
|
|
166
|
-
verification_token = models.CharField()
|
|
165
|
+
verification_token = models.CharField(max_length=32)
|
|
167
166
|
opted_out = models.BooleanField()
|
|
168
167
|
|
|
169
168
|
|
|
170
|
-
class PatientAddress(
|
|
169
|
+
class PatientAddress(IdentifiableModel):
|
|
171
170
|
"""A class representing a patient address."""
|
|
172
171
|
|
|
173
172
|
class Meta:
|
|
174
|
-
managed = False
|
|
175
173
|
db_table = "canvas_sdk_data_api_patientaddress_001"
|
|
176
174
|
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
use = models.CharField(choices=AddressUse.choices)
|
|
186
|
-
type = models.CharField(choices=AddressType.choices)
|
|
175
|
+
line1 = models.CharField(max_length=255)
|
|
176
|
+
line2 = models.CharField(max_length=255)
|
|
177
|
+
city = models.CharField(max_length=255)
|
|
178
|
+
district = models.CharField(max_length=255)
|
|
179
|
+
state_code = models.CharField(max_length=2)
|
|
180
|
+
postal_code = models.CharField(max_length=255)
|
|
181
|
+
use = models.CharField(choices=AddressUse.choices, max_length=10)
|
|
182
|
+
type = models.CharField(choices=AddressType.choices, max_length=10)
|
|
187
183
|
longitude = models.FloatField()
|
|
188
184
|
latitude = models.FloatField()
|
|
189
185
|
start = models.DateField()
|
|
190
186
|
end = models.DateField()
|
|
191
|
-
country = models.CharField()
|
|
192
|
-
state = models.CharField(choices=AddressState.choices)
|
|
187
|
+
country = models.CharField(max_length=255)
|
|
188
|
+
state = models.CharField(choices=AddressState.choices, max_length=20)
|
|
193
189
|
patient = models.ForeignKey(
|
|
194
190
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="addresses", null=True
|
|
195
191
|
)
|
|
@@ -198,27 +194,24 @@ class PatientAddress(models.Model):
|
|
|
198
194
|
return f"id={self.id}"
|
|
199
195
|
|
|
200
196
|
|
|
201
|
-
class PatientExternalIdentifier(
|
|
197
|
+
class PatientExternalIdentifier(IdentifiableModel):
|
|
202
198
|
"""A class representing a patient external identifier."""
|
|
203
199
|
|
|
204
200
|
class Meta:
|
|
205
|
-
managed = False
|
|
206
201
|
db_table = "canvas_sdk_data_api_patientexternalidentifier_001"
|
|
207
202
|
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
created = models.DateTimeField()
|
|
211
|
-
modified = models.DateTimeField()
|
|
203
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
204
|
+
modified = models.DateTimeField(auto_now=True)
|
|
212
205
|
patient = models.ForeignKey(
|
|
213
206
|
"v1.Patient",
|
|
214
207
|
related_name="external_identifiers",
|
|
215
208
|
on_delete=models.DO_NOTHING,
|
|
216
209
|
null=True,
|
|
217
210
|
)
|
|
218
|
-
use = models.CharField()
|
|
219
|
-
identifier_type = models.CharField()
|
|
220
|
-
system = models.CharField()
|
|
221
|
-
value = models.CharField()
|
|
211
|
+
use = models.CharField(max_length=255)
|
|
212
|
+
identifier_type = models.CharField(max_length=255)
|
|
213
|
+
system = models.CharField(max_length=255)
|
|
214
|
+
value = models.CharField(max_length=255)
|
|
222
215
|
issued_date = models.DateField()
|
|
223
216
|
expiration_date = models.DateField()
|
|
224
217
|
|
|
@@ -226,31 +219,27 @@ class PatientExternalIdentifier(models.Model):
|
|
|
226
219
|
return f"id={self.id}"
|
|
227
220
|
|
|
228
221
|
|
|
229
|
-
class PatientSetting(
|
|
222
|
+
class PatientSetting(Model):
|
|
230
223
|
"""PatientSetting."""
|
|
231
224
|
|
|
232
225
|
class Meta:
|
|
233
|
-
managed = False
|
|
234
226
|
db_table = "canvas_sdk_data_api_patientsetting_001"
|
|
235
227
|
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
modified = models.DateTimeField()
|
|
228
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
229
|
+
modified = models.DateTimeField(auto_now=True)
|
|
239
230
|
patient = models.ForeignKey(
|
|
240
231
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="settings", null=True
|
|
241
232
|
)
|
|
242
|
-
name = models.CharField()
|
|
233
|
+
name = models.CharField(max_length=100)
|
|
243
234
|
value = models.JSONField()
|
|
244
235
|
|
|
245
236
|
|
|
246
|
-
class PatientMetadata(
|
|
237
|
+
class PatientMetadata(IdentifiableModel):
|
|
247
238
|
"""A class representing Patient Metadata."""
|
|
248
239
|
|
|
249
240
|
class Meta:
|
|
250
|
-
managed = False
|
|
251
241
|
db_table = "canvas_sdk_data_api_patientmetadata_001"
|
|
252
242
|
|
|
253
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
254
243
|
patient = models.ForeignKey(
|
|
255
244
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="metadata", null=True
|
|
256
245
|
)
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import IdentifiableModel, Model
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
class PatientConsentRejectionCoding(Model):
|
|
5
7
|
"""Patient Consent Rejection Coding."""
|
|
6
8
|
|
|
7
9
|
class Meta:
|
|
8
|
-
managed = False
|
|
9
10
|
db_table = "canvas_sdk_data_api_patientconsentrejectioncoding_001"
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
display = models.CharField()
|
|
12
|
+
system = models.CharField(max_length=255)
|
|
13
|
+
version = models.CharField(max_length=255)
|
|
14
|
+
code = models.CharField(max_length=255)
|
|
15
|
+
display = models.CharField(max_length=1000)
|
|
16
16
|
user_selected = models.BooleanField()
|
|
17
17
|
|
|
18
18
|
|
|
@@ -24,20 +24,18 @@ class PatientConsentExpirationRule(models.TextChoices):
|
|
|
24
24
|
END_OF_YEAR = "end_of_year", "End of year"
|
|
25
25
|
|
|
26
26
|
|
|
27
|
-
class PatientConsentCoding(
|
|
27
|
+
class PatientConsentCoding(Model):
|
|
28
28
|
"""Patient Consent Coding."""
|
|
29
29
|
|
|
30
30
|
class Meta:
|
|
31
|
-
managed = False
|
|
32
31
|
db_table = "canvas_sdk_data_api_patientconsentcoding_001"
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
display = models.CharField()
|
|
33
|
+
system = models.CharField(max_length=255)
|
|
34
|
+
version = models.CharField(max_length=255)
|
|
35
|
+
code = models.CharField(max_length=255)
|
|
36
|
+
display = models.CharField(max_length=1000)
|
|
39
37
|
user_selected = models.BooleanField()
|
|
40
|
-
expiration_rule = models.CharField(choices=PatientConsentExpirationRule, max_length=255)
|
|
38
|
+
expiration_rule = models.CharField(choices=PatientConsentExpirationRule.choices, max_length=255)
|
|
41
39
|
is_mandatory = models.BooleanField()
|
|
42
40
|
is_proof_required = models.BooleanField()
|
|
43
41
|
show_in_patient_portal = models.BooleanField()
|
|
@@ -56,15 +54,12 @@ class PatientConsentStatus(models.TextChoices):
|
|
|
56
54
|
REJECTED_VIA_PORTAL = "rejected_via_patient_portal", "Rejected Via Patient Portal"
|
|
57
55
|
|
|
58
56
|
|
|
59
|
-
class PatientConsent(
|
|
57
|
+
class PatientConsent(IdentifiableModel):
|
|
60
58
|
"""Patient Consent."""
|
|
61
59
|
|
|
62
60
|
class Meta:
|
|
63
|
-
managed = False
|
|
64
61
|
db_table = "canvas_sdk_data_api_patientconsent_001"
|
|
65
62
|
|
|
66
|
-
id = models.UUIDField()
|
|
67
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
68
63
|
patient = models.ForeignKey(
|
|
69
64
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="patient_consent"
|
|
70
65
|
)
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import IdentifiableModel
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
class PostingMethods(models.TextChoices):
|
|
5
7
|
"""PostingMethods."""
|
|
@@ -10,26 +12,23 @@ class PostingMethods(models.TextChoices):
|
|
|
10
12
|
OTHER = "other", "Other"
|
|
11
13
|
|
|
12
14
|
|
|
13
|
-
class PaymentCollection(
|
|
15
|
+
class PaymentCollection(IdentifiableModel):
|
|
14
16
|
"""Stores the total collected amount and the payment method."""
|
|
15
17
|
|
|
16
18
|
class Meta:
|
|
17
|
-
managed = False
|
|
18
19
|
db_table = "canvas_sdk_data_quality_and_revenue_paymentcollection_001"
|
|
19
20
|
|
|
20
|
-
id = models.UUIDField()
|
|
21
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
22
21
|
total_collected = models.DecimalField(max_digits=8, decimal_places=2)
|
|
23
|
-
method = models.CharField(choices=PostingMethods.choices)
|
|
22
|
+
method = models.CharField(choices=PostingMethods.choices, max_length=10)
|
|
24
23
|
|
|
25
|
-
check_number = models.CharField()
|
|
24
|
+
check_number = models.CharField(max_length=250)
|
|
26
25
|
check_date = models.DateField()
|
|
27
26
|
deposit_date = models.DateField()
|
|
28
27
|
|
|
29
28
|
description = models.TextField()
|
|
30
29
|
|
|
31
|
-
created = models.DateTimeField()
|
|
32
|
-
modified = models.DateTimeField()
|
|
30
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
31
|
+
modified = models.DateTimeField(auto_now=True)
|
|
33
32
|
|
|
34
33
|
|
|
35
34
|
__exports__ = ("PaymentCollection", "PostingMethods")
|