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
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import IdentifiableModel
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
class DetectedIssue(IdentifiableModel):
|
|
5
7
|
"""DetectedIssue."""
|
|
6
8
|
|
|
7
9
|
class Meta:
|
|
8
|
-
managed = False
|
|
9
10
|
db_table = "canvas_sdk_data_api_detectedissue_001"
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
created = models.DateTimeField()
|
|
14
|
-
modified = models.DateTimeField()
|
|
12
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
13
|
+
modified = models.DateTimeField(auto_now=True)
|
|
15
14
|
identified = models.DateTimeField()
|
|
16
15
|
deleted = models.BooleanField()
|
|
17
16
|
originator = models.ForeignKey(
|
|
@@ -26,28 +25,25 @@ class DetectedIssue(models.Model):
|
|
|
26
25
|
patient = models.ForeignKey(
|
|
27
26
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="detected_issues", null=True
|
|
28
27
|
)
|
|
29
|
-
code = models.CharField()
|
|
30
|
-
status = models.CharField()
|
|
31
|
-
severity = models.CharField()
|
|
32
|
-
reference = models.CharField()
|
|
33
|
-
issue_identifier = models.CharField()
|
|
34
|
-
issue_identifier_system = models.CharField()
|
|
28
|
+
code = models.CharField(max_length=20)
|
|
29
|
+
status = models.CharField(max_length=16)
|
|
30
|
+
severity = models.CharField(max_length=10)
|
|
31
|
+
reference = models.CharField(max_length=200)
|
|
32
|
+
issue_identifier = models.CharField(max_length=255)
|
|
33
|
+
issue_identifier_system = models.CharField(max_length=255)
|
|
35
34
|
detail = models.TextField()
|
|
36
35
|
|
|
37
36
|
|
|
38
|
-
class DetectedIssueEvidence(
|
|
37
|
+
class DetectedIssueEvidence(IdentifiableModel):
|
|
39
38
|
"""DetectedIssueEvidence."""
|
|
40
39
|
|
|
41
40
|
class Meta:
|
|
42
|
-
managed = False
|
|
43
41
|
db_table = "canvas_sdk_data_api_detectedissueevidence_001"
|
|
44
42
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
code = models.CharField()
|
|
50
|
-
display = models.CharField()
|
|
43
|
+
system = models.CharField(max_length=255)
|
|
44
|
+
version = models.CharField(max_length=255)
|
|
45
|
+
code = models.CharField(max_length=255)
|
|
46
|
+
display = models.CharField(max_length=1000)
|
|
51
47
|
user_selected = models.BooleanField()
|
|
52
48
|
detected_issue = models.ForeignKey(
|
|
53
49
|
DetectedIssue,
|
canvas_sdk/v1/data/device.py
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import IdentifiableModel
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
class Device(IdentifiableModel):
|
|
5
7
|
"""Device."""
|
|
6
8
|
|
|
7
9
|
class Meta:
|
|
8
|
-
managed = False
|
|
9
10
|
db_table = "canvas_sdk_data_api_device_001"
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
created = models.DateTimeField()
|
|
14
|
-
modified = models.DateTimeField()
|
|
12
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
13
|
+
modified = models.DateTimeField(auto_now=True)
|
|
15
14
|
originator = models.ForeignKey(
|
|
16
15
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
17
16
|
)
|
|
@@ -27,24 +26,24 @@ class Device(models.Model):
|
|
|
27
26
|
note_id = models.BigIntegerField()
|
|
28
27
|
deleted = models.BooleanField()
|
|
29
28
|
labeled_contains_NRL = models.BooleanField()
|
|
30
|
-
assigning_authority = models.CharField()
|
|
31
|
-
scoping_entity = models.CharField()
|
|
32
|
-
udi = models.CharField()
|
|
33
|
-
di = models.CharField()
|
|
34
|
-
issuing_agency = models.CharField()
|
|
35
|
-
lot_number = models.CharField()
|
|
36
|
-
brand_name = models.CharField()
|
|
37
|
-
mri_safety_status = models.CharField()
|
|
38
|
-
version_model_number = models.CharField()
|
|
39
|
-
company_name = models.CharField()
|
|
29
|
+
assigning_authority = models.CharField(max_length=255)
|
|
30
|
+
scoping_entity = models.CharField(max_length=255)
|
|
31
|
+
udi = models.CharField(max_length=255)
|
|
32
|
+
di = models.CharField(max_length=255)
|
|
33
|
+
issuing_agency = models.CharField(max_length=255)
|
|
34
|
+
lot_number = models.CharField(max_length=100)
|
|
35
|
+
brand_name = models.CharField(max_length=255)
|
|
36
|
+
mri_safety_status = models.CharField(max_length=255)
|
|
37
|
+
version_model_number = models.CharField(max_length=100)
|
|
38
|
+
company_name = models.CharField(max_length=100)
|
|
40
39
|
gmdnPTName = models.TextField()
|
|
41
|
-
status = models.CharField()
|
|
40
|
+
status = models.CharField(max_length=20)
|
|
42
41
|
expiration_date = models.DateField()
|
|
43
|
-
expiration_date_original = models.CharField()
|
|
44
|
-
serial_number = models.CharField()
|
|
45
|
-
manufacturing_date_original = models.CharField()
|
|
42
|
+
expiration_date_original = models.CharField(max_length=100)
|
|
43
|
+
serial_number = models.CharField(max_length=255)
|
|
44
|
+
manufacturing_date_original = models.CharField(max_length=255)
|
|
46
45
|
manufacturing_date = models.DateField()
|
|
47
|
-
manufacturer = models.CharField()
|
|
46
|
+
manufacturer = models.CharField(max_length=255)
|
|
48
47
|
procedure_id = models.BigIntegerField()
|
|
49
48
|
|
|
50
49
|
|
canvas_sdk/v1/data/discount.py
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import Model
|
|
3
4
|
|
|
4
|
-
|
|
5
|
+
|
|
6
|
+
class Discount(Model):
|
|
5
7
|
"""Model to represent a discount applied to a claim or patient posting."""
|
|
6
8
|
|
|
7
9
|
class Meta:
|
|
8
|
-
managed = False
|
|
9
10
|
db_table = "canvas_sdk_data_quality_and_revenue_discount_001"
|
|
10
11
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
adjustment_code = models.CharField()
|
|
12
|
+
name = models.CharField(max_length=500)
|
|
13
|
+
adjustment_group = models.CharField(max_length=3)
|
|
14
|
+
adjustment_code = models.CharField(max_length=3)
|
|
15
15
|
discount = models.DecimalField(max_digits=8, decimal_places=2)
|
|
16
16
|
|
|
17
|
-
created = models.DateTimeField()
|
|
18
|
-
modified = models.DateTimeField()
|
|
17
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
18
|
+
modified = models.DateTimeField(auto_now=True)
|
|
19
19
|
|
|
20
20
|
|
|
21
21
|
__exports__ = ("Discount",)
|
canvas_sdk/v1/data/imaging.py
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import IdentifiableModel
|
|
3
4
|
from canvas_sdk.v1.data.common import (
|
|
4
5
|
DocumentReviewMode,
|
|
5
6
|
OrderStatus,
|
|
@@ -8,17 +9,14 @@ from canvas_sdk.v1.data.common import (
|
|
|
8
9
|
)
|
|
9
10
|
|
|
10
11
|
|
|
11
|
-
class ImagingOrder(
|
|
12
|
+
class ImagingOrder(IdentifiableModel):
|
|
12
13
|
"""Model to read ImagingOrder data."""
|
|
13
14
|
|
|
14
15
|
class Meta:
|
|
15
|
-
managed = False
|
|
16
16
|
db_table = "canvas_sdk_data_api_imagingorder_001"
|
|
17
17
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
created = models.DateTimeField()
|
|
21
|
-
modified = models.DateTimeField()
|
|
18
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
19
|
+
modified = models.DateTimeField(auto_now=True)
|
|
22
20
|
originator = models.ForeignKey(
|
|
23
21
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
24
22
|
)
|
|
@@ -34,30 +32,27 @@ class ImagingOrder(models.Model):
|
|
|
34
32
|
)
|
|
35
33
|
# TODO - uncomment when Note model is complete
|
|
36
34
|
# note = models.ForeigneKey(Note, on_delete=models.DO_NOTHING, related_name="imaging_orders", null=True)
|
|
37
|
-
imaging = models.CharField()
|
|
35
|
+
imaging = models.CharField(max_length=1024)
|
|
38
36
|
# TODO - uncomment when ServiceProvider model is complete
|
|
39
37
|
# imaging_center = models.ForeignKey('v1.ServiceProvider', on_delete=models.DO_NOTHING, related_name="imaging_orders", null=True)
|
|
40
|
-
note_to_radiologist = models.CharField()
|
|
41
|
-
internal_comment = models.CharField()
|
|
42
|
-
status = models.CharField(choices=OrderStatus)
|
|
38
|
+
note_to_radiologist = models.CharField(max_length=1024)
|
|
39
|
+
internal_comment = models.CharField(max_length=1024)
|
|
40
|
+
status = models.CharField(choices=OrderStatus.choices, max_length=30)
|
|
43
41
|
date_time_ordered = models.DateTimeField()
|
|
44
|
-
priority = models.CharField()
|
|
42
|
+
priority = models.CharField(max_length=255)
|
|
45
43
|
# TODO - uncomment when Staff model is complete
|
|
46
44
|
# ordering_provider = models.ForeignKey('v1.Staff', on_delete=models.DO_NOTHING, related_name="imaging_orders", null=True)
|
|
47
45
|
delegated = models.BooleanField(default=False)
|
|
48
46
|
|
|
49
47
|
|
|
50
|
-
class ImagingReview(
|
|
48
|
+
class ImagingReview(IdentifiableModel):
|
|
51
49
|
"""Model to read ImagingReview data."""
|
|
52
50
|
|
|
53
51
|
class Meta:
|
|
54
|
-
managed = False
|
|
55
52
|
db_table = "canvas_sdk_data_api_imagingreview_001"
|
|
56
53
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
created = models.DateTimeField()
|
|
60
|
-
modified = models.DateTimeField()
|
|
54
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
55
|
+
modified = models.DateTimeField(auto_now=True)
|
|
61
56
|
originator = models.ForeignKey(
|
|
62
57
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
63
58
|
)
|
|
@@ -68,19 +63,21 @@ class ImagingReview(models.Model):
|
|
|
68
63
|
entered_in_error = models.ForeignKey(
|
|
69
64
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
70
65
|
)
|
|
71
|
-
patient_communication_method = models.CharField(
|
|
66
|
+
patient_communication_method = models.CharField(
|
|
67
|
+
choices=ReviewPatientCommunicationMethod.choices, max_length=30
|
|
68
|
+
)
|
|
72
69
|
# TODO - uncomment when Note model is complete
|
|
73
70
|
# note = models.ForeignKey('v1.Note', on_delete=models.DO_NOTHING, related_name="imaging_reviews", null=True)
|
|
74
|
-
internal_comment = models.CharField()
|
|
75
|
-
message_to_patient = models.CharField()
|
|
71
|
+
internal_comment = models.CharField(max_length=2048)
|
|
72
|
+
message_to_patient = models.CharField(max_length=2048)
|
|
76
73
|
is_released_to_patient = models.BooleanField()
|
|
77
|
-
status = models.CharField(choices=ReviewStatus)
|
|
74
|
+
status = models.CharField(choices=ReviewStatus.choices, max_length=50)
|
|
78
75
|
patient = models.ForeignKey(
|
|
79
76
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="imaging_reviews", null=True
|
|
80
77
|
)
|
|
81
78
|
|
|
82
79
|
|
|
83
|
-
class ImagingReport(
|
|
80
|
+
class ImagingReport(IdentifiableModel):
|
|
84
81
|
"""Model to read ImagingReport data."""
|
|
85
82
|
|
|
86
83
|
class ImagingReportSource(models.TextChoices):
|
|
@@ -89,14 +86,11 @@ class ImagingReport(models.Model):
|
|
|
89
86
|
DIRECTLY_REPORT = "DIRECTLY_RADIOLOGY", "Directly Radiology Report"
|
|
90
87
|
|
|
91
88
|
class Meta:
|
|
92
|
-
managed = False
|
|
93
89
|
db_table = "canvas_sdk_data_api_imagingreport_001"
|
|
94
90
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
modified = models.DateTimeField()
|
|
99
|
-
review_mode = models.CharField(choices=DocumentReviewMode)
|
|
91
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
92
|
+
modified = models.DateTimeField(auto_now=True)
|
|
93
|
+
review_mode = models.CharField(choices=DocumentReviewMode.choices, max_length=2)
|
|
100
94
|
junked = models.BooleanField()
|
|
101
95
|
requires_signature = models.BooleanField()
|
|
102
96
|
assigned_date = models.DateTimeField()
|
|
@@ -104,8 +98,8 @@ class ImagingReport(models.Model):
|
|
|
104
98
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="imaging_results", null=True
|
|
105
99
|
)
|
|
106
100
|
order = models.ForeignKey(ImagingOrder, on_delete=models.DO_NOTHING, null=True)
|
|
107
|
-
source = models.CharField(choices=ImagingReportSource)
|
|
108
|
-
name = models.CharField()
|
|
101
|
+
source = models.CharField(choices=ImagingReportSource.choices, max_length=18)
|
|
102
|
+
name = models.CharField(max_length=255)
|
|
109
103
|
result_date = models.DateField()
|
|
110
104
|
original_date = models.DateField()
|
|
111
105
|
review = models.ForeignKey(ImagingReview, on_delete=models.DO_NOTHING, null=True)
|
canvas_sdk/v1/data/invoice.py
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
from django.db import models
|
|
2
2
|
|
|
3
|
+
from canvas_sdk.v1.data.base import Model
|
|
4
|
+
|
|
3
5
|
|
|
4
6
|
class InvoiceRecipients(models.TextChoices):
|
|
5
7
|
"""Choices for invoice recipients."""
|
|
@@ -31,14 +33,12 @@ class InvoiceSentMeans(models.TextChoices):
|
|
|
31
33
|
EMAIL = "e-mail", "E-mail"
|
|
32
34
|
|
|
33
35
|
|
|
34
|
-
class Invoice(
|
|
36
|
+
class Invoice(Model):
|
|
35
37
|
"""Represents a full invoice for a patient."""
|
|
36
38
|
|
|
37
39
|
class Meta:
|
|
38
|
-
managed = False
|
|
39
40
|
db_table = "canvas_sdk_data_quality_and_revenue_invoicefull_001"
|
|
40
41
|
|
|
41
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
42
42
|
originator = models.ForeignKey(
|
|
43
43
|
"v1.CanvasUser", on_delete=models.PROTECT, related_name="generated_invoices"
|
|
44
44
|
)
|
canvas_sdk/v1/data/lab.py
CHANGED
|
@@ -7,6 +7,8 @@ from canvas_sdk.v1.data.base import (
|
|
|
7
7
|
BaseQuerySet,
|
|
8
8
|
CommittableQuerySetMixin,
|
|
9
9
|
ForPatientQuerySetMixin,
|
|
10
|
+
IdentifiableModel,
|
|
11
|
+
Model,
|
|
10
12
|
TimeframeLookupQuerySetMixin,
|
|
11
13
|
ValueSetLookupQuerySet,
|
|
12
14
|
)
|
|
@@ -30,37 +32,34 @@ class TransmissionType(models.TextChoices):
|
|
|
30
32
|
MANUAL = "M", "manual"
|
|
31
33
|
|
|
32
34
|
|
|
33
|
-
class LabReport(
|
|
35
|
+
class LabReport(IdentifiableModel):
|
|
34
36
|
"""A class representing a lab report."""
|
|
35
37
|
|
|
36
38
|
class Meta:
|
|
37
|
-
managed = False
|
|
38
39
|
db_table = "canvas_sdk_data_api_labreport_001"
|
|
39
40
|
|
|
40
41
|
objects = cast(LabReportQuerySet, LabReportManager())
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
modified = models.DateTimeField()
|
|
46
|
-
review_mode = models.CharField()
|
|
43
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
44
|
+
modified = models.DateTimeField(auto_now=True)
|
|
45
|
+
review_mode = models.CharField(max_length=2)
|
|
47
46
|
junked = models.BooleanField()
|
|
48
47
|
requires_signature = models.BooleanField()
|
|
49
48
|
assigned_date = models.DateTimeField()
|
|
50
49
|
patient = models.ForeignKey(
|
|
51
50
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="lab_reports", null=True
|
|
52
51
|
)
|
|
53
|
-
transmission_type = models.CharField(choices=TransmissionType)
|
|
52
|
+
transmission_type = models.CharField(choices=TransmissionType.choices, max_length=10)
|
|
54
53
|
for_test_only = models.BooleanField()
|
|
55
|
-
external_id = models.CharField()
|
|
54
|
+
external_id = models.CharField(max_length=40)
|
|
56
55
|
version = models.IntegerField()
|
|
57
|
-
requisition_number = models.CharField()
|
|
56
|
+
requisition_number = models.CharField(max_length=40)
|
|
58
57
|
review = models.ForeignKey(
|
|
59
58
|
"LabReview", on_delete=models.DO_NOTHING, related_name="reports", null=True
|
|
60
59
|
)
|
|
61
60
|
original_date = models.DateTimeField()
|
|
62
61
|
date_performed = models.DateTimeField()
|
|
63
|
-
custom_document_name = models.CharField()
|
|
62
|
+
custom_document_name = models.CharField(max_length=500)
|
|
64
63
|
originator = models.ForeignKey(
|
|
65
64
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
66
65
|
)
|
|
@@ -82,19 +81,16 @@ class LabReviewQuerySet(BaseQuerySet, CommittableQuerySetMixin, ForPatientQueryS
|
|
|
82
81
|
LabReviewManager = BaseModelManager.from_queryset(LabReviewQuerySet)
|
|
83
82
|
|
|
84
83
|
|
|
85
|
-
class LabReview(
|
|
84
|
+
class LabReview(IdentifiableModel):
|
|
86
85
|
"""A class representing a lab review."""
|
|
87
86
|
|
|
88
87
|
class Meta:
|
|
89
|
-
managed = False
|
|
90
88
|
db_table = "canvas_sdk_data_api_labreview_001"
|
|
91
89
|
|
|
92
90
|
objects = cast(LabReviewQuerySet, LabReviewManager())
|
|
93
91
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
created = models.DateTimeField()
|
|
97
|
-
modified = models.DateTimeField()
|
|
92
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
93
|
+
modified = models.DateTimeField(auto_now=True)
|
|
98
94
|
originator = models.ForeignKey(
|
|
99
95
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
100
96
|
)
|
|
@@ -106,12 +102,12 @@ class LabReview(models.Model):
|
|
|
106
102
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
107
103
|
)
|
|
108
104
|
internal_comment = models.TextField()
|
|
109
|
-
message_to_patient = models.CharField()
|
|
110
|
-
status = models.CharField()
|
|
105
|
+
message_to_patient = models.CharField(max_length=2048)
|
|
106
|
+
status = models.CharField(max_length=50)
|
|
111
107
|
patient = models.ForeignKey(
|
|
112
108
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="lab_reviews", null=True
|
|
113
109
|
)
|
|
114
|
-
patient_communication_method = models.CharField()
|
|
110
|
+
patient_communication_method = models.CharField(max_length=30)
|
|
115
111
|
|
|
116
112
|
|
|
117
113
|
class LabValueTimeframeLookupQuerySetMixin(TimeframeLookupQuerySetMixin):
|
|
@@ -129,51 +125,46 @@ class LabValueQuerySet(ValueSetLookupQuerySet, LabValueTimeframeLookupQuerySetMi
|
|
|
129
125
|
pass
|
|
130
126
|
|
|
131
127
|
|
|
132
|
-
class LabValue(
|
|
128
|
+
class LabValue(IdentifiableModel):
|
|
133
129
|
"""A class representing a lab value."""
|
|
134
130
|
|
|
135
131
|
class Meta:
|
|
136
|
-
managed = False
|
|
137
132
|
db_table = "canvas_sdk_data_api_labvalue_001"
|
|
138
133
|
|
|
139
134
|
objects = LabValueQuerySet.as_manager()
|
|
140
135
|
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
created = models.DateTimeField()
|
|
144
|
-
modified = models.DateTimeField()
|
|
136
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
137
|
+
modified = models.DateTimeField(auto_now=True)
|
|
145
138
|
report = models.ForeignKey(
|
|
146
139
|
"LabReport", on_delete=models.DO_NOTHING, related_name="values", null=True
|
|
147
140
|
)
|
|
148
141
|
value = models.TextField()
|
|
149
|
-
units = models.CharField()
|
|
150
|
-
abnormal_flag = models.CharField()
|
|
151
|
-
reference_range = models.CharField()
|
|
152
|
-
low_threshold = models.CharField()
|
|
153
|
-
high_threshold = models.CharField()
|
|
142
|
+
units = models.CharField(max_length=30)
|
|
143
|
+
abnormal_flag = models.CharField(max_length=128)
|
|
144
|
+
reference_range = models.CharField(max_length=128)
|
|
145
|
+
low_threshold = models.CharField(max_length=30)
|
|
146
|
+
high_threshold = models.CharField(max_length=30)
|
|
154
147
|
comment = models.TextField()
|
|
155
|
-
observation_status = models.CharField()
|
|
148
|
+
observation_status = models.CharField(max_length=24)
|
|
156
149
|
|
|
157
150
|
|
|
158
|
-
class LabValueCoding(
|
|
151
|
+
class LabValueCoding(Model):
|
|
159
152
|
"""A class representing a lab value coding."""
|
|
160
153
|
|
|
161
154
|
class Meta:
|
|
162
|
-
managed = False
|
|
163
155
|
db_table = "canvas_sdk_data_api_labvaluecoding_001"
|
|
164
156
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
modified = models.DateTimeField()
|
|
157
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
158
|
+
modified = models.DateTimeField(auto_now=True)
|
|
168
159
|
value = models.ForeignKey(
|
|
169
160
|
LabValue, on_delete=models.DO_NOTHING, related_name="codings", null=True
|
|
170
161
|
)
|
|
171
|
-
code = models.CharField()
|
|
172
|
-
name = models.CharField()
|
|
173
|
-
system = models.CharField()
|
|
162
|
+
code = models.CharField(max_length=128)
|
|
163
|
+
name = models.CharField(max_length=256)
|
|
164
|
+
system = models.CharField(max_length=128)
|
|
174
165
|
|
|
175
166
|
|
|
176
|
-
class LabOrder(
|
|
167
|
+
class LabOrder(IdentifiableModel):
|
|
177
168
|
"""A class representing a lab order."""
|
|
178
169
|
|
|
179
170
|
class SpecimenCollectionType(models.TextChoices):
|
|
@@ -199,13 +190,10 @@ class LabOrder(models.Model):
|
|
|
199
190
|
MANUAL_PROCESSING_STATUS_FLAGGED = "FLAGGED", "Flagged"
|
|
200
191
|
|
|
201
192
|
class Meta:
|
|
202
|
-
managed = False
|
|
203
193
|
db_table = "canvas_sdk_data_api_laborder_001"
|
|
204
194
|
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
created = models.DateTimeField()
|
|
208
|
-
modified = models.DateTimeField()
|
|
195
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
196
|
+
modified = models.DateTimeField(auto_now=True)
|
|
209
197
|
originator = models.ForeignKey(
|
|
210
198
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
211
199
|
)
|
|
@@ -219,28 +207,34 @@ class LabOrder(models.Model):
|
|
|
219
207
|
patient = models.ForeignKey(
|
|
220
208
|
"v1.Patient", on_delete=models.DO_NOTHING, related_name="lab_orders", null=True
|
|
221
209
|
)
|
|
222
|
-
ontology_lab_partner = models.CharField()
|
|
210
|
+
ontology_lab_partner = models.CharField(max_length=128)
|
|
223
211
|
# TODO - uncomment when the Note model is finished
|
|
224
212
|
# note = models.ForeignKey("Note", on_delete=models.DO_NOTHING, null=True)
|
|
225
|
-
comment = models.CharField()
|
|
226
|
-
requisition_number = models.CharField()
|
|
213
|
+
comment = models.CharField(max_length=128)
|
|
214
|
+
requisition_number = models.CharField(max_length=32)
|
|
227
215
|
is_patient_bill = models.BooleanField(null=True)
|
|
228
216
|
date_ordered = models.DateTimeField()
|
|
229
217
|
fasting_status = models.BooleanField(null=True)
|
|
230
|
-
specimen_collection_type = models.CharField(
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
218
|
+
specimen_collection_type = models.CharField(
|
|
219
|
+
choices=SpecimenCollectionType.choices, null=True, max_length=10
|
|
220
|
+
)
|
|
221
|
+
transmission_type = models.CharField(choices=TransmissionType.choices, null=True, max_length=10)
|
|
222
|
+
courtesy_copy_type = models.CharField(
|
|
223
|
+
choices=CourtesyCopyType.choices, null=True, max_length=10
|
|
224
|
+
)
|
|
225
|
+
courtesy_copy_number = models.CharField(max_length=32)
|
|
226
|
+
courtesy_copy_text = models.CharField(max_length=64)
|
|
235
227
|
ordering_provider = models.ForeignKey(Staff, on_delete=models.DO_NOTHING, null=True)
|
|
236
228
|
parent_order = models.ForeignKey("LabOrder", on_delete=models.DO_NOTHING, null=True)
|
|
237
|
-
healthgorilla_id = models.CharField()
|
|
238
|
-
manual_processing_status = models.CharField(
|
|
239
|
-
|
|
229
|
+
healthgorilla_id = models.CharField(max_length=40)
|
|
230
|
+
manual_processing_status = models.CharField(
|
|
231
|
+
choices=ManualProcessingStatus.choices, null=True, max_length=16
|
|
232
|
+
)
|
|
233
|
+
manual_processing_comment = models.TextField(null=True)
|
|
240
234
|
labcorp_abn_url = models.URLField()
|
|
241
235
|
|
|
242
236
|
|
|
243
|
-
class LabOrderReason(
|
|
237
|
+
class LabOrderReason(Model):
|
|
244
238
|
"""A class representing a lab order reason."""
|
|
245
239
|
|
|
246
240
|
class LabReasonMode(models.TextChoices):
|
|
@@ -252,12 +246,10 @@ class LabOrderReason(models.Model):
|
|
|
252
246
|
UNKNOWN = "UNK", "unknown"
|
|
253
247
|
|
|
254
248
|
class Meta:
|
|
255
|
-
managed = False
|
|
256
249
|
db_table = "canvas_sdk_data_api_laborderreason_001"
|
|
257
250
|
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
modified = models.DateTimeField()
|
|
251
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
252
|
+
modified = models.DateTimeField(auto_now=True)
|
|
261
253
|
originator = models.ForeignKey(
|
|
262
254
|
"v1.CanvasUser", on_delete=models.DO_NOTHING, null=True, related_name="+"
|
|
263
255
|
)
|
|
@@ -274,16 +266,14 @@ class LabOrderReason(models.Model):
|
|
|
274
266
|
mode = models.CharField(max_length=30, choices=LabReasonMode)
|
|
275
267
|
|
|
276
268
|
|
|
277
|
-
class LabOrderReasonCondition(
|
|
269
|
+
class LabOrderReasonCondition(Model):
|
|
278
270
|
"""A class representing a lab order reason's condition."""
|
|
279
271
|
|
|
280
272
|
class Meta:
|
|
281
|
-
managed = False
|
|
282
273
|
db_table = "canvas_sdk_data_api_laborderreasoncondition_001"
|
|
283
274
|
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
modified = models.DateTimeField()
|
|
275
|
+
created = models.DateTimeField(auto_now_add=True)
|
|
276
|
+
modified = models.DateTimeField(auto_now=True)
|
|
287
277
|
reason = models.ForeignKey(
|
|
288
278
|
LabOrderReason, on_delete=models.DO_NOTHING, related_name="reason_conditions", null=True
|
|
289
279
|
)
|
|
@@ -295,7 +285,7 @@ class LabOrderReasonCondition(models.Model):
|
|
|
295
285
|
)
|
|
296
286
|
|
|
297
287
|
|
|
298
|
-
class LabTest(
|
|
288
|
+
class LabTest(IdentifiableModel):
|
|
299
289
|
"""A class representing a lab test."""
|
|
300
290
|
|
|
301
291
|
class LabTestOrderStatus(models.TextChoices):
|
|
@@ -312,23 +302,20 @@ class LabTest(models.Model):
|
|
|
312
302
|
INACTIVE = "IN", "inactive"
|
|
313
303
|
|
|
314
304
|
class Meta:
|
|
315
|
-
managed = False
|
|
316
305
|
db_table = "canvas_sdk_data_api_labtest_001"
|
|
317
306
|
|
|
318
|
-
id = models.UUIDField()
|
|
319
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
320
307
|
ontology_test_name = models.CharField(max_length=512, blank=True, default="")
|
|
321
308
|
ontology_test_code = models.CharField(max_length=512, blank=True, default="")
|
|
322
|
-
status = models.CharField(max_length=30, choices=LabTestOrderStatus)
|
|
309
|
+
status = models.CharField(max_length=30, choices=LabTestOrderStatus.choices)
|
|
323
310
|
report = models.ForeignKey(
|
|
324
311
|
LabReport, on_delete=models.DO_NOTHING, related_name="tests", null=True
|
|
325
312
|
)
|
|
326
313
|
aoe_code = models.CharField(max_length=10, default="")
|
|
327
314
|
procedure_class = models.CharField(max_length=10, default="")
|
|
328
|
-
specimen_type = models.CharField()
|
|
329
|
-
specimen_source_code = models.CharField()
|
|
330
|
-
specimen_source_description = models.CharField()
|
|
331
|
-
specimen_source_coding_system = models.CharField()
|
|
315
|
+
specimen_type = models.CharField(max_length=26)
|
|
316
|
+
specimen_source_code = models.CharField(max_length=5)
|
|
317
|
+
specimen_source_description = models.CharField(max_length=255)
|
|
318
|
+
specimen_source_coding_system = models.CharField(max_length=5)
|
|
332
319
|
order = models.ForeignKey(
|
|
333
320
|
LabOrder, on_delete=models.DO_NOTHING, related_name="tests", null=True
|
|
334
321
|
)
|
|
@@ -337,17 +324,14 @@ class LabTest(models.Model):
|
|
|
337
324
|
return f"{self.ontology_test_name}: f{self.ontology_test_code}"
|
|
338
325
|
|
|
339
326
|
|
|
340
|
-
class LabPartner(
|
|
327
|
+
class LabPartner(IdentifiableModel):
|
|
341
328
|
"""A class representing a lab partner."""
|
|
342
329
|
|
|
343
330
|
class Meta:
|
|
344
|
-
managed = False
|
|
345
331
|
db_table = "canvas_sdk_data_lab_partner_001"
|
|
346
332
|
|
|
347
333
|
objects: models.Manager["LabPartner"]
|
|
348
334
|
|
|
349
|
-
id = models.UUIDField()
|
|
350
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
351
335
|
name = models.CharField(max_length=256)
|
|
352
336
|
active = models.BooleanField()
|
|
353
337
|
electronic_ordering_enabled = models.BooleanField()
|
|
@@ -355,17 +339,14 @@ class LabPartner(models.Model):
|
|
|
355
339
|
default_lab_account_number = models.CharField(max_length=256)
|
|
356
340
|
|
|
357
341
|
|
|
358
|
-
class LabPartnerTest(
|
|
342
|
+
class LabPartnerTest(IdentifiableModel):
|
|
359
343
|
"""A class representing a lab partner's test."""
|
|
360
344
|
|
|
361
345
|
class Meta:
|
|
362
|
-
managed = False
|
|
363
346
|
db_table = "canvas_sdk_data_lab_partner_test_001"
|
|
364
347
|
|
|
365
348
|
objects: models.Manager["LabPartnerTest"]
|
|
366
349
|
|
|
367
|
-
id = models.UUIDField()
|
|
368
|
-
dbid = models.BigIntegerField(primary_key=True)
|
|
369
350
|
lab_partner = models.ForeignKey(
|
|
370
351
|
"LabPartner", on_delete=models.DO_NOTHING, related_name="available_tests"
|
|
371
352
|
)
|