Skip to content

Commit

Permalink
Added Team models to SDK data module
Browse files Browse the repository at this point in the history
  • Loading branch information
csande committed Jan 22, 2025
1 parent b5276d7 commit 43c3927
Show file tree
Hide file tree
Showing 2 changed files with 105 additions and 0 deletions.
29 changes: 29 additions & 0 deletions canvas_sdk/v1/data/common.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,3 +101,32 @@ class Origin(models.TextChoices):
FLAGGED_POSTING_REVIEW = ("FLG_PST_REV", "Flagged posting review")
BATCH_PATIENT_STATEMENTS = ("BAT_PTN_STA", "Batch patient statements")
INCOMPLETE_COVERAGE = ("INC_COV", "Incomplete Coverage")


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

PHONE = "phone", "phone"
FAX = "fax", "fax"
EMAIL = "email", "email"
PAGER = "pager", "pager"
OTHER = "other", "other"


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

HOME = "home", "Home"
WORK = "work", "Work"
TEMP = "temp", "Temp"
OLD = "old", "Old"
OTHER = "other", "Other"
MOBILE = "mobile", "Mobile"
AUTOMATION = "automation", "Automation"


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

ACTIVE = "active", "Active"
DELETED = "deleted", "Deleted"
76 changes: 76 additions & 0 deletions canvas_sdk/v1/data/team.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
from django.contrib.postgres.fields import ArrayField
from django.db import models

from canvas_sdk.v1.data.common import ContactPointState, ContactPointSystem, ContactPointUse


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

COLLECT_SPECIMENS_FROM_PATIENT = (
"COLLECT_SPECIMENS_FROM_PATIENT",
"Collect specimens from a patient",
)
COMMUNICATE_DIAGNOSTIC_RESULTS_TO_PATIENT = (
"COMMUNICATE_DIAGNOSTIC_RESULTS_TO_PATIENT",
"Communicate diagnostic results to patient",
)
COORDINATE_REFERRALS_FOR_PATIENT = (
"COORDINATE_REFERRALS_FOR_PATIENT",
"Coordinate referrals for a patient",
)
PROCESS_REFILL_REQUESTS = "PROCESS_REFILL_REQUESTS", "Process refill requests from a pharmacy"
PROCESS_CHANGE_REQUESTS = "PROCESS_CHANGE_REQUESTS", "Process change requests from a pharmacy"
SCHEDULE_LAB_VISITS_FOR_PATIENT = (
"SCHEDULE_LAB_VISITS_FOR_PATIENT",
"Schedule lab visits for a patient",
)
POPULATION_HEALTH_CAMPAIGN_OUTREACH = (
"POPULATION_HEALTH_CAMPAIGN_OUTREACH",
"Population health campaign outreach",
)
COLLECT_PATIENT_PAYMENTS = "COLLECT_PATIENT_PAYMENTS", "Collect patient payments"
COMPLETE_OPEN_LAB_ORDERS = "COMPLETE_OPEN_LAB_ORDERS", "Complete open lab orders"
REVIEW_ERA_POSTING_EXCEPTIONS = (
"REVIEW_ERA_POSTING_EXCEPTIONS",
"Review electronic remittance posting exceptions",
)
REVIEW_COVERAGES = "REVIEW_COVERAGES", "Review incomplete patient coverages"


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

class Meta:
managed = False
db_table = "canvas_sdk_data_api_team_001"

id = models.UUIDField()
dbid = models.BigIntegerField(primary_key=True)
created = models.DateTimeField()
modified = models.DateTimeField()
name = models.CharField()
responsibilities = ArrayField(models.CharField(choices=TeamResponsibility.choices))
members = models.ManyToManyField( # type: ignore[var-annotated]
"v1.Staff", # type: ignore[misc]
related_name="teams",
db_table="canvas_sdk_data_api_team_members_001",
)


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

class Meta:
managed = False
db_table = "canvas_sdk_data_api_teamcontactpoint_001"

id = models.UUIDField()
dbid = models.BigIntegerField(primary_key=True)
system = models.CharField(choices=ContactPointSystem.choices)
value = models.CharField()
use = models.CharField(choices=ContactPointUse.choices)
use_notes = models.CharField()
rank = models.IntegerField()
state = models.CharField(choices=ContactPointState.choices)
team = models.ForeignKey(Team, on_delete=models.DO_NOTHING, related_name="telecom")

0 comments on commit 43c3927

Please sign in to comment.