Skip to content

Commit

Permalink
feat: added Team models to SDK data module (#349)
Browse files Browse the repository at this point in the history
  • Loading branch information
csande authored Feb 5, 2025
1 parent d804f2b commit 096ce23
Showing 1 changed file with 76 additions and 0 deletions.
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 096ce23

Please sign in to comment.