Skip to content

Commit

Permalink
feat: add appointment to data module (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
nmpsilva authored Jan 28, 2025
1 parent 4d8f609 commit 90613dc
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 0 deletions.
2 changes: 2 additions & 0 deletions canvas_sdk/v1/data/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
from .allergy_intolerance import AllergyIntolerance, AllergyIntoleranceCoding
from .appointment import Appointment
from .billing import BillingLineItem
from .command import Command
from .condition import Condition, ConditionCoding
Expand Down Expand Up @@ -43,6 +44,7 @@
from .user import CanvasUser

__all__ = [
"Appointment",
"AllergyIntolerance",
"AllergyIntoleranceCoding",
"BillingLineItem",
Expand Down
56 changes: 56 additions & 0 deletions canvas_sdk/v1/data/appointment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from django.db import models


class AppointmentProgressStatus(models.TextChoices):
"""AppointmentProgressStatus."""

UNCONFIRMED = "unconfirmed", "Unconfirmed"
ATTEMPTED = "attempted", "Attempted"
CONFIRMED = "confirmed", "Confirmed"
ARRIVED = "arrived", "Arrived"
ROOMED = "roomed", "Roomed"
EXITED = "exited", "Exited"
NOSHOWED = "noshowed", "No-showed"
CANCELLED = "cancelled", "Cancelled"


class Appointment(models.Model):
"""Appointment."""

class Meta:
managed = False
db_table = "canvas_sdk_data_api_appointment_001"

id = models.UUIDField()
dbid = models.BigIntegerField(primary_key=True)
entered_in_error = models.ForeignKey("v1.CanvasUser", on_delete=models.DO_NOTHING, null=True)
patient = models.ForeignKey(
"v1.Patient",
on_delete=models.DO_NOTHING,
related_name="appointments",
null=True,
)
appointment_rescheduled_from = models.ForeignKey(
"self",
on_delete=models.DO_NOTHING,
related_name="appointment_rescheduled_to",
null=True,
)
provider = models.ForeignKey("v1.Staff", on_delete=models.DO_NOTHING, null=True)
start_time = models.DateTimeField()
duration_minutes = models.IntegerField()
comment = models.TextField(null=True)
note = models.ForeignKey("v1.Note", on_delete=models.DO_NOTHING, null=True)

note_type = models.ForeignKey(
"v1.NoteType", on_delete=models.DO_NOTHING, related_name="appointments", null=True
)

status = models.CharField(
max_length=20,
choices=AppointmentProgressStatus,
)
meeting_link = models.URLField(null=True, blank=True)
telehealth_instructions_sent = models.BooleanField()
location = models.ForeignKey("v1.PracticeLocation", on_delete=models.DO_NOTHING, null=True)
description = models.TextField(null=True, blank=True)

0 comments on commit 90613dc

Please sign in to comment.