canvas 0.44.3__py3-none-any.whl → 0.46.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.44.3.dist-info → canvas-0.46.0.dist-info}/METADATA +4 -2
- {canvas-0.44.3.dist-info → canvas-0.46.0.dist-info}/RECORD +64 -59
- canvas_cli/apps/plugin/plugin.py +21 -2
- 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/utils/http.py +4 -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 +87 -24
- 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 +55 -60
- protobufs/canvas_generated/messages/effects.proto +6 -0
- protobufs/canvas_generated/messages/events.proto +12 -1
- settings.py +56 -22
- {canvas-0.44.3.dist-info → canvas-0.46.0.dist-info}/WHEEL +0 -0
- {canvas-0.44.3.dist-info → canvas-0.46.0.dist-info}/entry_points.txt +0 -0
canvas_sdk/v1/data/claim.py
CHANGED
|
@@ -3,6 +3,7 @@ from typing import TYPE_CHECKING, Self
|
|
|
3
3
|
|
|
4
4
|
from django.db import models
|
|
5
5
|
|
|
6
|
+
from canvas_sdk.v1.data.base import IdentifiableModel, Model
|
|
6
7
|
from canvas_sdk.v1.data.common import PersonSex
|
|
7
8
|
from canvas_sdk.v1.data.coverage import CoverageRelationshipCode, CoverageType
|
|
8
9
|
from canvas_sdk.v1.data.fields import ChoiceArrayField
|
|
@@ -20,15 +21,12 @@ class InstallmentPlanStatus(models.TextChoices):
|
|
|
20
21
|
CANCELLED = "cancelled", "Cancelled"
|
|
21
22
|
|
|
22
23
|
|
|
23
|
-
class InstallmentPlan(
|
|
24
|
+
class InstallmentPlan(Model):
|
|
24
25
|
"""InstallmentPlan."""
|
|
25
26
|
|
|
26
27
|
class Meta:
|
|
27
|
-
managed = False
|
|
28
28
|
db_table = "canvas_sdk_data_quality_and_revenue_installmentplan_001"
|
|
29
29
|
|
|
30
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
31
|
-
|
|
32
30
|
creator = models.ForeignKey("v1.CanvasUser", on_delete=models.CASCADE)
|
|
33
31
|
patient = models.ForeignKey(
|
|
34
32
|
"v1.Patient", on_delete=models.CASCADE, related_name="installment_plans"
|
|
@@ -37,8 +35,8 @@ class InstallmentPlan(models.Model):
|
|
|
37
35
|
status = models.CharField(choices=InstallmentPlanStatus.choices, max_length=10)
|
|
38
36
|
expected_payoff_date = models.DateField()
|
|
39
37
|
|
|
40
|
-
created = models.DateTimeField()
|
|
41
|
-
modified = models.DateTimeField()
|
|
38
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
39
|
+
modified = models.DateTimeField(auto_now=True)
|
|
42
40
|
|
|
43
41
|
|
|
44
42
|
class ClaimQueueColumns(models.TextChoices):
|
|
@@ -75,23 +73,23 @@ class ClaimQueues(models.IntegerChoices):
|
|
|
75
73
|
TRASH = 10, "Trash"
|
|
76
74
|
|
|
77
75
|
|
|
78
|
-
class ClaimQueue(
|
|
76
|
+
class ClaimQueue(Model):
|
|
79
77
|
"""ClaimQueue."""
|
|
80
78
|
|
|
81
79
|
class Meta:
|
|
82
|
-
managed = False
|
|
83
80
|
db_table = "canvas_sdk_data_quality_and_revenue_queue_001"
|
|
84
81
|
|
|
85
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
86
82
|
queue_sort_ordering = models.IntegerField()
|
|
87
|
-
name = models.CharField()
|
|
88
|
-
display_name = models.CharField()
|
|
89
|
-
description = models.CharField()
|
|
83
|
+
name = models.CharField(max_length=100)
|
|
84
|
+
display_name = models.CharField(max_length=100)
|
|
85
|
+
description = models.CharField(max_length=500)
|
|
90
86
|
show_in_revenue = models.BooleanField()
|
|
91
|
-
visible_columns = ChoiceArrayField(
|
|
87
|
+
visible_columns = ChoiceArrayField(
|
|
88
|
+
models.CharField(choices=ClaimQueueColumns.choices, max_length=64)
|
|
89
|
+
)
|
|
92
90
|
|
|
93
|
-
created = models.DateTimeField()
|
|
94
|
-
modified = models.DateTimeField()
|
|
91
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
92
|
+
modified = models.DateTimeField(auto_now=True)
|
|
95
93
|
|
|
96
94
|
|
|
97
95
|
class ClaimPayerOrder(models.TextChoices):
|
|
@@ -126,17 +124,14 @@ class ClaimCoverageQuerySet(models.QuerySet):
|
|
|
126
124
|
return self.filter(active=True)
|
|
127
125
|
|
|
128
126
|
|
|
129
|
-
class ClaimCoverage(
|
|
127
|
+
class ClaimCoverage(Model):
|
|
130
128
|
"""A model that represents the link between a claim and a specific insurance coverage."""
|
|
131
129
|
|
|
132
130
|
class Meta:
|
|
133
|
-
managed = False
|
|
134
131
|
db_table = "canvas_sdk_data_quality_and_revenue_claimcoverage_001"
|
|
135
132
|
|
|
136
133
|
objects = ClaimCoverageQuerySet.as_manager()
|
|
137
134
|
|
|
138
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
139
|
-
|
|
140
135
|
claim = models.ForeignKey("Claim", on_delete=models.CASCADE, related_name="coverages")
|
|
141
136
|
|
|
142
137
|
coverage = models.ForeignKey(
|
|
@@ -144,75 +139,75 @@ class ClaimCoverage(models.Model):
|
|
|
144
139
|
)
|
|
145
140
|
|
|
146
141
|
active = models.BooleanField()
|
|
147
|
-
payer_name = models.CharField()
|
|
148
|
-
payer_id = models.CharField()
|
|
149
|
-
payer_typecode = models.CharField()
|
|
150
|
-
payer_order = models.CharField(choices=ClaimPayerOrder.choices)
|
|
151
|
-
payer_addr1 = models.CharField()
|
|
152
|
-
payer_addr2 = models.CharField()
|
|
153
|
-
payer_city = models.CharField()
|
|
154
|
-
payer_state = models.CharField()
|
|
155
|
-
payer_zip = models.CharField()
|
|
156
|
-
payer_plan_type = models.CharField(choices=ClaimTypeCode.choices)
|
|
157
|
-
coverage_type = models.CharField(choices=CoverageType.choices)
|
|
158
|
-
|
|
159
|
-
subscriber_employer = models.CharField()
|
|
160
|
-
subscriber_group = models.CharField()
|
|
161
|
-
subscriber_number = models.CharField()
|
|
162
|
-
subscriber_plan = models.CharField()
|
|
163
|
-
subscriber_dob = models.CharField()
|
|
164
|
-
subscriber_first_name = models.CharField()
|
|
165
|
-
subscriber_last_name = models.CharField()
|
|
166
|
-
subscriber_middle_name = models.CharField()
|
|
167
|
-
subscriber_phone = models.CharField()
|
|
168
|
-
subscriber_sex = models.CharField(choices=PersonSex.choices)
|
|
169
|
-
subscriber_addr1 = models.CharField()
|
|
170
|
-
subscriber_addr2 = models.CharField()
|
|
171
|
-
subscriber_city = models.CharField()
|
|
172
|
-
subscriber_state = models.CharField()
|
|
173
|
-
subscriber_zip = models.CharField()
|
|
174
|
-
subscriber_country = models.CharField()
|
|
175
|
-
patient_relationship_to_subscriber = models.CharField(
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
142
|
+
payer_name = models.CharField(max_length=255)
|
|
143
|
+
payer_id = models.CharField(max_length=255)
|
|
144
|
+
payer_typecode = models.CharField(max_length=2)
|
|
145
|
+
payer_order = models.CharField(choices=ClaimPayerOrder.choices, max_length=10)
|
|
146
|
+
payer_addr1 = models.CharField(max_length=255)
|
|
147
|
+
payer_addr2 = models.CharField(max_length=255)
|
|
148
|
+
payer_city = models.CharField(max_length=255)
|
|
149
|
+
payer_state = models.CharField(max_length=2)
|
|
150
|
+
payer_zip = models.CharField(max_length=255)
|
|
151
|
+
payer_plan_type = models.CharField(choices=ClaimTypeCode.choices, max_length=20)
|
|
152
|
+
coverage_type = models.CharField(choices=CoverageType.choices, max_length=64)
|
|
153
|
+
|
|
154
|
+
subscriber_employer = models.CharField(max_length=255)
|
|
155
|
+
subscriber_group = models.CharField(max_length=255)
|
|
156
|
+
subscriber_number = models.CharField(max_length=100)
|
|
157
|
+
subscriber_plan = models.CharField(max_length=255)
|
|
158
|
+
subscriber_dob = models.CharField(max_length=10)
|
|
159
|
+
subscriber_first_name = models.CharField(max_length=255)
|
|
160
|
+
subscriber_last_name = models.CharField(max_length=255)
|
|
161
|
+
subscriber_middle_name = models.CharField(max_length=255)
|
|
162
|
+
subscriber_phone = models.CharField(max_length=50)
|
|
163
|
+
subscriber_sex = models.CharField(choices=PersonSex.choices, max_length=3)
|
|
164
|
+
subscriber_addr1 = models.CharField(max_length=255)
|
|
165
|
+
subscriber_addr2 = models.CharField(max_length=255)
|
|
166
|
+
subscriber_city = models.CharField(max_length=255)
|
|
167
|
+
subscriber_state = models.CharField(max_length=2)
|
|
168
|
+
subscriber_zip = models.CharField(max_length=255)
|
|
169
|
+
subscriber_country = models.CharField(max_length=50)
|
|
170
|
+
patient_relationship_to_subscriber = models.CharField(
|
|
171
|
+
choices=CoverageRelationshipCode.choices, max_length=2
|
|
172
|
+
)
|
|
173
|
+
|
|
174
|
+
pay_to_addr1 = models.CharField(max_length=255)
|
|
175
|
+
pay_to_addr2 = models.CharField(max_length=255)
|
|
176
|
+
pay_to_city = models.CharField(max_length=255)
|
|
177
|
+
pay_to_state = models.CharField(max_length=2)
|
|
178
|
+
pay_to_zip = models.CharField(max_length=255)
|
|
179
|
+
|
|
180
|
+
resubmission_code = models.CharField(max_length=1)
|
|
181
|
+
payer_icn = models.CharField(max_length=250)
|
|
182
|
+
|
|
183
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
184
|
+
modified = models.DateTimeField(auto_now=True)
|
|
185
|
+
|
|
186
|
+
|
|
187
|
+
class ClaimPatient(Model):
|
|
191
188
|
"""ClaimPatient."""
|
|
192
189
|
|
|
193
190
|
class Meta:
|
|
194
|
-
managed = False
|
|
195
191
|
db_table = "canvas_sdk_data_quality_and_revenue_claimpatient_001"
|
|
196
192
|
|
|
197
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
198
193
|
claim = models.OneToOneField("v1.Claim", on_delete=models.CASCADE, related_name="patient")
|
|
199
|
-
photo = models.CharField()
|
|
200
|
-
dob = models.CharField()
|
|
201
|
-
first_name = models.CharField()
|
|
202
|
-
last_name = models.CharField()
|
|
203
|
-
middle_name = models.CharField()
|
|
204
|
-
phone = models.CharField()
|
|
205
|
-
sex = models.CharField(choices=PersonSex.choices)
|
|
206
|
-
ssn = models.CharField()
|
|
207
|
-
addr1 = models.CharField()
|
|
208
|
-
addr2 = models.CharField()
|
|
209
|
-
city = models.CharField()
|
|
210
|
-
state = models.CharField()
|
|
211
|
-
zip = models.CharField()
|
|
212
|
-
country = models.CharField()
|
|
213
|
-
|
|
214
|
-
created = models.DateTimeField()
|
|
215
|
-
modified = models.DateTimeField()
|
|
194
|
+
photo = models.CharField(max_length=512)
|
|
195
|
+
dob = models.CharField(max_length=10)
|
|
196
|
+
first_name = models.CharField(max_length=255)
|
|
197
|
+
last_name = models.CharField(max_length=255)
|
|
198
|
+
middle_name = models.CharField(max_length=255)
|
|
199
|
+
phone = models.CharField(max_length=50)
|
|
200
|
+
sex = models.CharField(choices=PersonSex.choices, max_length=3)
|
|
201
|
+
ssn = models.CharField(max_length=10)
|
|
202
|
+
addr1 = models.CharField(max_length=255)
|
|
203
|
+
addr2 = models.CharField(max_length=255)
|
|
204
|
+
city = models.CharField(max_length=255)
|
|
205
|
+
state = models.CharField(max_length=2)
|
|
206
|
+
zip = models.CharField(max_length=255)
|
|
207
|
+
country = models.CharField(max_length=50)
|
|
208
|
+
|
|
209
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
210
|
+
modified = models.DateTimeField(auto_now=True)
|
|
216
211
|
|
|
217
212
|
|
|
218
213
|
class ClaimQueryset(models.QuerySet):
|
|
@@ -223,17 +218,14 @@ class ClaimQueryset(models.QuerySet):
|
|
|
223
218
|
return self.exclude(current_queue__queue_sort_ordering=ClaimQueues.TRASH)
|
|
224
219
|
|
|
225
220
|
|
|
226
|
-
class Claim(
|
|
221
|
+
class Claim(IdentifiableModel):
|
|
227
222
|
"""Claim."""
|
|
228
223
|
|
|
229
224
|
class Meta:
|
|
230
|
-
managed = False
|
|
231
225
|
db_table = "canvas_sdk_data_quality_and_revenue_claim_001"
|
|
232
226
|
|
|
233
227
|
objects = ClaimQueryset.as_manager()
|
|
234
228
|
|
|
235
|
-
id = models.UUIDField()
|
|
236
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
237
229
|
note = models.ForeignKey("v1.Note", on_delete=models.PROTECT, related_name="claims", null=True)
|
|
238
230
|
installment_plan = models.ForeignKey(
|
|
239
231
|
InstallmentPlan, on_delete=models.SET_NULL, related_name="claims", null=True
|
|
@@ -246,23 +238,23 @@ class Claim(models.Model):
|
|
|
246
238
|
|
|
247
239
|
accept_assign = models.BooleanField()
|
|
248
240
|
auto_accident = models.BooleanField()
|
|
249
|
-
auto_accident_state = models.CharField()
|
|
241
|
+
auto_accident_state = models.CharField(max_length=2)
|
|
250
242
|
employment_related = models.BooleanField()
|
|
251
243
|
other_accident = models.BooleanField()
|
|
252
|
-
accident_code = models.CharField()
|
|
244
|
+
accident_code = models.CharField(max_length=10)
|
|
253
245
|
illness_date = models.DateField()
|
|
254
|
-
remote_batch_id = models.CharField()
|
|
255
|
-
remote_file_id = models.CharField()
|
|
256
|
-
prior_auth = models.CharField()
|
|
246
|
+
remote_batch_id = models.CharField(max_length=100)
|
|
247
|
+
remote_file_id = models.CharField(max_length=100)
|
|
248
|
+
prior_auth = models.CharField(max_length=100)
|
|
257
249
|
|
|
258
|
-
narrative = models.CharField()
|
|
259
|
-
account_number = models.CharField()
|
|
250
|
+
narrative = models.CharField(max_length=2500)
|
|
251
|
+
account_number = models.CharField(max_length=255)
|
|
260
252
|
snoozed_until = models.DateField()
|
|
261
253
|
|
|
262
254
|
patient_balance = models.DecimalField(max_digits=8, decimal_places=2)
|
|
263
255
|
aggregate_coverage_balance = models.DecimalField(max_digits=8, decimal_places=2)
|
|
264
|
-
created = models.DateTimeField()
|
|
265
|
-
modified = models.DateTimeField()
|
|
256
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
257
|
+
modified = models.DateTimeField(auto_now=True)
|
|
266
258
|
|
|
267
259
|
@property
|
|
268
260
|
def total_charges(self) -> Decimal:
|
|
@@ -5,6 +5,7 @@ from django.db import models
|
|
|
5
5
|
from django.db.models import Q, Sum
|
|
6
6
|
from django.db.models.functions import Coalesce
|
|
7
7
|
|
|
8
|
+
from canvas_sdk.v1.data.base import Model
|
|
8
9
|
from canvas_sdk.v1.data.note import PracticeLocationPOS
|
|
9
10
|
|
|
10
11
|
|
|
@@ -105,36 +106,34 @@ class ClaimLineItemQuerySet(models.QuerySet):
|
|
|
105
106
|
return self.exclude(proc_code=LineItemCodes.UNLINKED.value).apply_ordering()
|
|
106
107
|
|
|
107
108
|
|
|
108
|
-
class ClaimLineItem(
|
|
109
|
+
class ClaimLineItem(Model):
|
|
109
110
|
"""ClaimLineItem."""
|
|
110
111
|
|
|
111
112
|
class Meta:
|
|
112
|
-
managed = False
|
|
113
113
|
db_table = "canvas_sdk_data_quality_and_revenue_claimlineitem_001"
|
|
114
114
|
|
|
115
115
|
objects = ClaimLineItemQuerySet.as_manager()
|
|
116
116
|
|
|
117
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
118
117
|
billing_line_item = models.ForeignKey("v1.BillingLineItem", on_delete=models.CASCADE, null=True)
|
|
119
118
|
claim = models.ForeignKey("v1.Claim", on_delete=models.CASCADE, related_name="line_items")
|
|
120
|
-
status = models.CharField(choices=ClaimLineItemStatus.choices)
|
|
119
|
+
status = models.CharField(choices=ClaimLineItemStatus.choices, max_length=10)
|
|
121
120
|
charge = models.DecimalField(max_digits=8, decimal_places=2)
|
|
122
|
-
from_date = models.CharField()
|
|
123
|
-
thru_date = models.CharField()
|
|
124
|
-
narrative = models.CharField()
|
|
125
|
-
ndc_code = models.CharField()
|
|
126
|
-
ndc_dosage = models.CharField()
|
|
127
|
-
ndc_measure = models.CharField()
|
|
128
|
-
place_of_service = models.CharField(choices=PracticeLocationPOS.choices)
|
|
129
|
-
proc_code = models.CharField()
|
|
130
|
-
display = models.CharField()
|
|
131
|
-
remote_chg_id = models.CharField()
|
|
121
|
+
from_date = models.CharField(max_length=10)
|
|
122
|
+
thru_date = models.CharField(max_length=10)
|
|
123
|
+
narrative = models.CharField(max_length=2000)
|
|
124
|
+
ndc_code = models.CharField(max_length=100)
|
|
125
|
+
ndc_dosage = models.CharField(max_length=100)
|
|
126
|
+
ndc_measure = models.CharField(max_length=100)
|
|
127
|
+
place_of_service = models.CharField(choices=PracticeLocationPOS.choices, max_length=2)
|
|
128
|
+
proc_code = models.CharField(max_length=10)
|
|
129
|
+
display = models.CharField(max_length=255)
|
|
130
|
+
remote_chg_id = models.CharField(max_length=100)
|
|
132
131
|
units = models.IntegerField()
|
|
133
|
-
epsdt = models.CharField()
|
|
134
|
-
family_planning = models.CharField(choices=FamilyPlanningOptions.choices)
|
|
132
|
+
epsdt = models.CharField(max_length=2)
|
|
133
|
+
family_planning = models.CharField(choices=FamilyPlanningOptions.choices, max_length=1)
|
|
135
134
|
|
|
136
|
-
created = models.DateTimeField()
|
|
137
|
-
modified = models.DateTimeField()
|
|
135
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
136
|
+
modified = models.DateTimeField(auto_now=True)
|
|
138
137
|
|
|
139
138
|
|
|
140
139
|
__exports__ = ("ClaimLineItem", "ClaimLineItemStatus", "LineItemCodes", "FamilyPlanningOptions")
|
canvas_sdk/v1/data/command.py
CHANGED
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
from django.apps import apps
|
|
2
2
|
from django.db import models
|
|
3
3
|
|
|
4
|
+
from canvas_sdk.v1.data.base import IdentifiableModel
|
|
4
5
|
|
|
5
|
-
|
|
6
|
+
|
|
7
|
+
class Command(IdentifiableModel):
|
|
6
8
|
"""Command."""
|
|
7
9
|
|
|
8
10
|
class Meta:
|
|
9
|
-
managed = False
|
|
10
11
|
db_table = "canvas_sdk_data_commands_command_001"
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
created = models.DateTimeField()
|
|
15
|
-
modified = models.DateTimeField()
|
|
13
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
14
|
+
modified = models.DateTimeField(auto_now=True)
|
|
16
15
|
originator = models.ForeignKey(
|
|
17
16
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="commands_originated"
|
|
18
17
|
)
|
|
@@ -25,13 +24,13 @@ class Command(models.Model):
|
|
|
25
24
|
null=True,
|
|
26
25
|
related_name="commands_entered_in_error",
|
|
27
26
|
)
|
|
28
|
-
state = models.CharField()
|
|
27
|
+
state = models.CharField(max_length=20)
|
|
29
28
|
patient = models.ForeignKey("v1.Patient", on_delete=models.DO_NOTHING, null=True)
|
|
30
29
|
note = models.ForeignKey("v1.Note", on_delete=models.DO_NOTHING, related_name="commands")
|
|
31
30
|
schema_key = models.TextField()
|
|
32
31
|
data = models.JSONField()
|
|
33
|
-
origination_source = models.CharField()
|
|
34
|
-
anchor_object_type = models.CharField()
|
|
32
|
+
origination_source = models.CharField(max_length=20)
|
|
33
|
+
anchor_object_type = models.CharField(max_length=100)
|
|
35
34
|
anchor_object_dbid = models.BigIntegerField()
|
|
36
35
|
|
|
37
36
|
@property
|
canvas_sdk/v1/data/condition.py
CHANGED
|
@@ -8,6 +8,8 @@ from canvas_sdk.v1.data.base import (
|
|
|
8
8
|
BaseQuerySet,
|
|
9
9
|
CommittableQuerySetMixin,
|
|
10
10
|
ForPatientQuerySetMixin,
|
|
11
|
+
IdentifiableModel,
|
|
12
|
+
Model,
|
|
11
13
|
ValueSetLookupQuerySetMixin,
|
|
12
14
|
)
|
|
13
15
|
|
|
@@ -38,17 +40,14 @@ class ConditionQuerySet(
|
|
|
38
40
|
ConditionManager = BaseModelManager.from_queryset(ConditionQuerySet)
|
|
39
41
|
|
|
40
42
|
|
|
41
|
-
class Condition(
|
|
43
|
+
class Condition(IdentifiableModel):
|
|
42
44
|
"""Condition."""
|
|
43
45
|
|
|
44
46
|
class Meta:
|
|
45
|
-
managed = False
|
|
46
47
|
db_table = "canvas_sdk_data_api_condition_001"
|
|
47
48
|
|
|
48
49
|
objects = cast(ConditionQuerySet, ConditionManager())
|
|
49
50
|
|
|
50
|
-
id = models.UUIDField()
|
|
51
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
52
51
|
deleted = models.BooleanField()
|
|
53
52
|
entered_in_error = models.ForeignKey(
|
|
54
53
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
@@ -61,22 +60,20 @@ class Condition(models.Model):
|
|
|
61
60
|
)
|
|
62
61
|
onset_date = models.DateField()
|
|
63
62
|
resolution_date = models.DateField()
|
|
64
|
-
clinical_status = models.CharField(choices=ClinicalStatus.choices)
|
|
63
|
+
clinical_status = models.CharField(choices=ClinicalStatus.choices, max_length=20)
|
|
65
64
|
surgical = models.BooleanField()
|
|
66
65
|
|
|
67
66
|
|
|
68
|
-
class ConditionCoding(
|
|
67
|
+
class ConditionCoding(Model):
|
|
69
68
|
"""ConditionCoding."""
|
|
70
69
|
|
|
71
70
|
class Meta:
|
|
72
|
-
managed = False
|
|
73
71
|
db_table = "canvas_sdk_data_api_conditioncoding_001"
|
|
74
72
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
display = models.CharField()
|
|
73
|
+
system = models.CharField(max_length=255)
|
|
74
|
+
version = models.CharField(max_length=255)
|
|
75
|
+
code = models.CharField(max_length=255)
|
|
76
|
+
display = models.CharField(max_length=1000)
|
|
80
77
|
user_selected = models.BooleanField()
|
|
81
78
|
condition = models.ForeignKey(
|
|
82
79
|
Condition, on_delete=models.DO_NOTHING, related_name="codings", null=True
|
canvas_sdk/v1/data/coverage.py
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
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, Model
|
|
4
5
|
from canvas_sdk.v1.data.common import (
|
|
5
6
|
AddressState,
|
|
6
7
|
AddressType,
|
|
@@ -144,17 +145,14 @@ class TransactorType(models.TextChoices):
|
|
|
144
145
|
BCBS = "bcbs", "Blue Cross Blue Shield"
|
|
145
146
|
|
|
146
147
|
|
|
147
|
-
class Coverage(
|
|
148
|
+
class Coverage(IdentifiableModel):
|
|
148
149
|
"""Coverage."""
|
|
149
150
|
|
|
150
151
|
class Meta:
|
|
151
|
-
managed = False
|
|
152
152
|
db_table = "canvas_sdk_data_api_coverage_001"
|
|
153
153
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
created = models.DateTimeField()
|
|
157
|
-
modified = models.DateTimeField()
|
|
154
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
155
|
+
modified = models.DateTimeField(auto_now=True)
|
|
158
156
|
patient = models.ForeignKey(
|
|
159
157
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="coverages", null=True
|
|
160
158
|
)
|
|
@@ -164,22 +162,24 @@ class Coverage(models.Model):
|
|
|
164
162
|
subscriber = models.ForeignKey(
|
|
165
163
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="subscribed_coverages", null=True
|
|
166
164
|
)
|
|
167
|
-
patient_relationship_to_subscriber = models.CharField(
|
|
165
|
+
patient_relationship_to_subscriber = models.CharField(
|
|
166
|
+
choices=CoverageRelationshipCode.choices, max_length=2
|
|
167
|
+
)
|
|
168
168
|
issuer = models.ForeignKey(
|
|
169
169
|
"v1.Transactor", on_delete=models.DO_NOTHING, related_name="coverages", null=True
|
|
170
170
|
)
|
|
171
|
-
id_number = models.CharField()
|
|
172
|
-
plan = models.CharField()
|
|
173
|
-
sub_plan = models.CharField()
|
|
174
|
-
group = models.CharField()
|
|
175
|
-
sub_group = models.CharField()
|
|
176
|
-
employer = models.CharField()
|
|
171
|
+
id_number = models.CharField(max_length=100)
|
|
172
|
+
plan = models.CharField(max_length=255)
|
|
173
|
+
sub_plan = models.CharField(max_length=255)
|
|
174
|
+
group = models.CharField(max_length=255)
|
|
175
|
+
sub_group = models.CharField(max_length=255)
|
|
176
|
+
employer = models.CharField(max_length=255)
|
|
177
177
|
coverage_start_date = models.DateField()
|
|
178
178
|
coverage_end_date = models.DateField()
|
|
179
179
|
coverage_rank = models.IntegerField()
|
|
180
|
-
state = models.CharField(choices=CoverageState.choices)
|
|
181
|
-
plan_type = models.CharField(choices=CoverageType.choices)
|
|
182
|
-
coverage_type = models.CharField(choices=TransactorCoverageType.choices)
|
|
180
|
+
state = models.CharField(choices=CoverageState.choices, max_length=20)
|
|
181
|
+
plan_type = models.CharField(choices=CoverageType.choices, max_length=20)
|
|
182
|
+
coverage_type = models.CharField(choices=TransactorCoverageType.choices, max_length=64)
|
|
183
183
|
issuer_address = models.ForeignKey(
|
|
184
184
|
"v1.TransactorAddress",
|
|
185
185
|
on_delete=models.DO_NOTHING,
|
|
@@ -190,24 +190,22 @@ class Coverage(models.Model):
|
|
|
190
190
|
"v1.TransactorPhone", on_delete=models.DO_NOTHING, related_name="coverages", null=True
|
|
191
191
|
)
|
|
192
192
|
comments = models.TextField()
|
|
193
|
-
stack = models.CharField(choices=CoverageStack.choices)
|
|
193
|
+
stack = models.CharField(choices=CoverageStack.choices, max_length=8)
|
|
194
194
|
|
|
195
195
|
def __str__(self) -> str:
|
|
196
196
|
return f"id={self.id}"
|
|
197
197
|
|
|
198
198
|
|
|
199
|
-
class Transactor(
|
|
199
|
+
class Transactor(Model):
|
|
200
200
|
"""Transactor."""
|
|
201
201
|
|
|
202
202
|
class Meta:
|
|
203
|
-
managed = False
|
|
204
203
|
db_table = "canvas_sdk_data_quality_and_revenue_transactor_001"
|
|
205
204
|
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
transactor_type = models.CharField(choices=TransactorType.choices)
|
|
205
|
+
payer_id = models.CharField(max_length=50)
|
|
206
|
+
name = models.CharField(max_length=255)
|
|
207
|
+
type = models.CharField(max_length=50)
|
|
208
|
+
transactor_type = models.CharField(choices=TransactorType.choices, max_length=100)
|
|
211
209
|
clearinghouse_payer = models.BooleanField()
|
|
212
210
|
institutional = models.BooleanField(null=True)
|
|
213
211
|
institutional_enrollment_req = models.BooleanField(null=True)
|
|
@@ -221,8 +219,8 @@ class Transactor(models.Model):
|
|
|
221
219
|
secondary_support = models.BooleanField(null=True)
|
|
222
220
|
claim_fee = models.BooleanField(null=True)
|
|
223
221
|
remit_fee = models.BooleanField(null=True)
|
|
224
|
-
state = models.CharField()
|
|
225
|
-
description = models.CharField()
|
|
222
|
+
state = models.CharField(max_length=50)
|
|
223
|
+
description = models.CharField(max_length=1000)
|
|
226
224
|
active = models.BooleanField()
|
|
227
225
|
use_provider_for_eligibility = models.BooleanField()
|
|
228
226
|
|
|
@@ -233,34 +231,33 @@ class Transactor(models.Model):
|
|
|
233
231
|
related_name="used_for_submission_by",
|
|
234
232
|
)
|
|
235
233
|
|
|
236
|
-
coverage_types = ArrayField(
|
|
234
|
+
coverage_types = ArrayField(
|
|
235
|
+
models.CharField(choices=TransactorCoverageType.choices, max_length=64)
|
|
236
|
+
)
|
|
237
237
|
|
|
238
238
|
|
|
239
|
-
class TransactorAddress(
|
|
239
|
+
class TransactorAddress(IdentifiableModel):
|
|
240
240
|
"""TransactorAddress."""
|
|
241
241
|
|
|
242
242
|
class Meta:
|
|
243
|
-
managed = False
|
|
244
243
|
db_table = "canvas_sdk_data_quality_and_revenue_transactoraddress_001"
|
|
245
244
|
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
use = models.CharField(choices=AddressUse.choices)
|
|
257
|
-
type = models.CharField(choices=AddressType.choices)
|
|
245
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
246
|
+
modified = models.DateTimeField(auto_now=True)
|
|
247
|
+
line1 = models.CharField(max_length=255)
|
|
248
|
+
line2 = models.CharField(max_length=255)
|
|
249
|
+
city = models.CharField(max_length=255)
|
|
250
|
+
district = models.CharField(max_length=255)
|
|
251
|
+
state_code = models.CharField(max_length=2)
|
|
252
|
+
postal_code = models.CharField(max_length=255)
|
|
253
|
+
use = models.CharField(choices=AddressUse.choices, max_length=10)
|
|
254
|
+
type = models.CharField(choices=AddressType.choices, max_length=10)
|
|
258
255
|
longitude = models.FloatField(null=True, default=None, blank=True)
|
|
259
256
|
latitude = models.FloatField(null=True, default=None, blank=True)
|
|
260
257
|
start = models.DateField(null=True, blank=True)
|
|
261
258
|
end = models.DateField(null=True, blank=True)
|
|
262
259
|
country = models.CharField(max_length=255)
|
|
263
|
-
state = models.CharField(choices=AddressState.choices)
|
|
260
|
+
state = models.CharField(choices=AddressState.choices, max_length=20)
|
|
264
261
|
transactor = models.ForeignKey(
|
|
265
262
|
"v1.Transactor", on_delete=models.DO_NOTHING, related_name="addresses", null=True
|
|
266
263
|
)
|
|
@@ -269,23 +266,20 @@ class TransactorAddress(models.Model):
|
|
|
269
266
|
return f"id={self.id}"
|
|
270
267
|
|
|
271
268
|
|
|
272
|
-
class TransactorPhone(
|
|
269
|
+
class TransactorPhone(IdentifiableModel):
|
|
273
270
|
"""TransactorPhone."""
|
|
274
271
|
|
|
275
272
|
class Meta:
|
|
276
|
-
managed = False
|
|
277
273
|
db_table = "canvas_sdk_data_quality_and_revenue_transactorphone_001"
|
|
278
274
|
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
use = models.CharField(choices=ContactPointUse.choices)
|
|
286
|
-
use_notes = models.CharField()
|
|
275
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
276
|
+
modified = models.DateTimeField(auto_now=True)
|
|
277
|
+
system = models.CharField(choices=ContactPointSystem.choices, max_length=20)
|
|
278
|
+
value = models.CharField(max_length=100)
|
|
279
|
+
use = models.CharField(choices=ContactPointUse.choices, max_length=20)
|
|
280
|
+
use_notes = models.CharField(max_length=255)
|
|
287
281
|
rank = models.IntegerField()
|
|
288
|
-
state = models.CharField(choices=ContactPointState.choices)
|
|
282
|
+
state = models.CharField(choices=ContactPointState.choices, max_length=20)
|
|
289
283
|
transactor = models.ForeignKey(
|
|
290
284
|
"v1.Transactor", on_delete=models.DO_NOTHING, related_name="phones", null=True
|
|
291
285
|
)
|