Skip to content

Commit

Permalink
add appointment to data module
Browse files Browse the repository at this point in the history
  • Loading branch information
dependabot[bot] authored and nmpsilva committed Jan 22, 2025
1 parent b5276d7 commit 35853e8
Showing 1 changed file with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions canvas_sdk/v1/data/appointment.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
from django.db import models

from canvas_sdk.v1.data import PracticeLocation
from canvas_sdk.v1.data.note import Note, NoteType
from canvas_sdk.v1.data.patient import Patient
from canvas_sdk.v1.data.staff import Staff
from canvas_sdk.v1.data.user import CanvasUser


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
app_label = "canvas_sdk"
db_table = "canvas_sdk_data_api_appointment_001"

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

note_type = models.ForeignKey(
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(PracticeLocation, on_delete=models.DO_NOTHING, null=True)
description = models.TextField(null=True, blank=True)

0 comments on commit 35853e8

Please sign in to comment.