Skip to content

Commit

Permalink
Moves choice classes outside of models.
Browse files Browse the repository at this point in the history
  • Loading branch information
jrwils committed Nov 19, 2024
1 parent 73cdf00 commit 9483ead
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 81 deletions.
11 changes: 7 additions & 4 deletions canvas_sdk/v1/data/billing.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,16 @@ def find(self, value_set: Type["ValueSet"]) -> models.QuerySet:
return self.filter(cpt__in=values_dict.get(CodeConstants.HCPCS, []))


class BillingLineItemStatus(models.TextChoices):
"""Billing line item status."""

ACTIVE = "active", "Active"
REMOVED = "removed", "Removed"


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

class BillingLineItemStatus(models.TextChoices):
ACTIVE = "active", "Active"
REMOVED = "removed", "Removed"

class Meta:
managed = False
app_label = "canvas_sdk"
Expand Down
163 changes: 86 additions & 77 deletions canvas_sdk/v1/data/note.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,67 +7,94 @@
from canvas_sdk.v1.data.user import CanvasUser


class NoteTypeCategories(models.TextChoices):
"""Note type categories."""

MESSAGE = "message", "Message"
LETTER = "letter", "Letter"
INPATIENT = "inpatient", "Inpatient Visit Note"
REVIEW = "review", "Chart Review Note"
ENCOUNTER = "encounter", "Encounter Note"
APPOINTMENT = "appointment", "Appointment Note"
TASK = "task", "Task"
DATA = "data", "Data"
CCDA = "ccda", "C-CDA"
SCHEDULE_EVENT = "schedule_event", "Schedule Event"


class PracticeLocationPOS(models.TextChoices):
"""Practice Location POS."""

PHARMACY = "01", "Pharmacy"
TELEHEALTH = "02", "Telehealth"
SCHOOL = "03", "Education Facility"
HOMELESS_SHELTER = "04", "Homeless Shelter"
PRISON = "09", "Prison"
TELEHEALTH_IN_PATIENT_HOME = "10", "Telehealth in Patient's Home"
OFFICE = "11", "Office"
HOME = "12", "Home"
ASSISTED_LIVING = "13", "Asssisted Living Facility"
GROUP_HOME = "14", "Group Home"
MOBILE = "15", "Mobile Unit"
WALK_IN_RETAIL = "17", "Walk-In Retail Health Clinic"
OFF_CAMPUS_OUTPATIENT_HOSPITAL = "19", "Off-Campus Outpatient Hospital"
URGENT_CARE = "20", "Urgent Care Facility"
INPATIENT_HOSPITAL = "21", "Inpatient Hospital"
ON_CAMPUS_OUTPATIENT_HOSPITAL = "22", "On-Campus Outpatient Hospital"
ER_HOSPITAL = "23", "Emergency Room Hospital"
AMBULATORY_SURGERY_CENTER = "24", "Ambulatory Surgery Center"
BIRTHING_CENTER = "25", "Birthing Center"
MILITARY_FACILITY = "26", "Military Treatment Facility"
STREET = "27", "Outreach Site / Street"
SNF = "31", "Skilled Nursing Facility"
NURSING = "32", "Nursing Facility"
CUSTODIAL = "33", "Custodial Care Facility"
HOSPICE = "34", "Hospice"
AMBULANCE_LAND = "41", "Ambulance Land"
AMBULANCE_AIR_WATER = "42", "Ambulance Air or Water"
INDEPENDENT_CLINIC = "49", "Independent Clinic"
FQHC = "50", "Federally Qualified Health Center"
PSYCH = "51", "Inpatient Psychiatric Facility"
PSYCH_PARTIAL = "52", "Inpatient Psychiatric Facility - Partial Hospitalization"
MENTAL_HEALTH_CENTER = "53", "Community Mental Health Center"
INTERMEDIATE_MENTAL = "54", "Intermediate Care Facility for Mentally Retarded"
SUBSTANCE_RESIDENTIAL = "55", "Residential Substance Abuse Treatment Facility"
PSYCH_RESIDENTIAL = "56", "Psychiatric Residential Treatment Center"
SUBSTANCE_NON_RESIDENTIAL = "57", "Non-Residential Substance Abuse Treatment Facility"
MASS_IMMUNIZATION = "60", "Mass Immunization Center"
INPATIENT_REHAB = "61", "Inpatient Rehabilitation Facility"
OUTPATIENT_REHAB = "62", "Outpatient Rehabilitation Facility"
ESRD = "65", "End-Stage Renal Disease Treatment Facility"
PUBLIC_CLINIC = "71", "State or Local Public Health Clinic"
RURAL_CLINIC = "72", "Rural Health Clinic"
INDEPENDENT_LAB = "81", "Independent Laboratory"
OTHER = "99", "Other Place of Service"


class NoteTypes(models.TextChoices):
"""Note types."""

MESSAGE = "message", "Message"
LETTER = "letter", "Letter"
INPATIENT = "inpatient", "Inpatient Visit Note"
REVIEW = "review", "Chart Review Note"
VOICE = "voice", "Phone Call Note"
VIDEO = "video", "Video Call Note"
OFFICE = "office", "Office Visit Note"
LAB = "lab", "Lab Visit Note"
HOME = "home", "Home Visit Note"
GROUP = "group", "Group Visit Note"
APPOINTMENT = "appointment", "Appointment Note"
OFFSITE = "offsite", "Other Offsite Visit Note"
SEARCH = "search", "Search"
TASK = "task", "Task"
DATA = "data", "Data"
CCDA = "ccda", "C-CDA Import"


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

class NoteTypeCategories(models.TextChoices):
MESSAGE = "message", "Message"
LETTER = "letter", "Letter"
INPATIENT = "inpatient", "Inpatient Visit Note"
REVIEW = "review", "Chart Review Note"
ENCOUNTER = "encounter", "Encounter Note"
APPOINTMENT = "appointment", "Appointment Note"
TASK = "task", "Task"
DATA = "data", "Data"
CCDA = "ccda", "C-CDA"
SCHEDULE_EVENT = "schedule_event", "Schedule Event"

class PracticeLocationPOS(models.TextChoices):
PHARMACY = "01", "Pharmacy"
TELEHEALTH = "02", "Telehealth"
SCHOOL = "03", "Education Facility"
HOMELESS_SHELTER = "04", "Homeless Shelter"
PRISON = "09", "Prison"
TELEHEALTH_IN_PATIENT_HOME = "10", "Telehealth in Patient's Home"
OFFICE = "11", "Office"
HOME = "12", "Home"
ASSISTED_LIVING = "13", "Asssisted Living Facility"
GROUP_HOME = "14", "Group Home"
MOBILE = "15", "Mobile Unit"
WALK_IN_RETAIL = "17", "Walk-In Retail Health Clinic"
OFF_CAMPUS_OUTPATIENT_HOSPITAL = "19", "Off-Campus Outpatient Hospital"
URGENT_CARE = "20", "Urgent Care Facility"
INPATIENT_HOSPITAL = "21", "Inpatient Hospital"
ON_CAMPUS_OUTPATIENT_HOSPITAL = "22", "On-Campus Outpatient Hospital"
ER_HOSPITAL = "23", "Emergency Room Hospital"
AMBULATORY_SURGERY_CENTER = "24", "Ambulatory Surgery Center"
BIRTHING_CENTER = "25", "Birthing Center"
MILITARY_FACILITY = "26", "Military Treatment Facility"
STREET = "27", "Outreach Site / Street"
SNF = "31", "Skilled Nursing Facility"
NURSING = "32", "Nursing Facility"
CUSTODIAL = "33", "Custodial Care Facility"
HOSPICE = "34", "Hospice"
AMBULANCE_LAND = "41", "Ambulance Land"
AMBULANCE_AIR_WATER = "42", "Ambulance Air or Water"
INDEPENDENT_CLINIC = "49", "Independent Clinic"
FQHC = "50", "Federally Qualified Health Center"
PSYCH = "51", "Inpatient Psychiatric Facility"
PSYCH_PARTIAL = "52", "Inpatient Psychiatric Facility - Partial Hospitalization"
MENTAL_HEALTH_CENTER = "53", "Community Mental Health Center"
INTERMEDIATE_MENTAL = "54", "Intermediate Care Facility for Mentally Retarded"
SUBSTANCE_RESIDENTIAL = "55", "Residential Substance Abuse Treatment Facility"
PSYCH_RESIDENTIAL = "56", "Psychiatric Residential Treatment Center"
SUBSTANCE_NON_RESIDENTIAL = "57", "Non-Residential Substance Abuse Treatment Facility"
MASS_IMMUNIZATION = "60", "Mass Immunization Center"
INPATIENT_REHAB = "61", "Inpatient Rehabilitation Facility"
OUTPATIENT_REHAB = "62", "Outpatient Rehabilitation Facility"
ESRD = "65", "End-Stage Renal Disease Treatment Facility"
PUBLIC_CLINIC = "71", "State or Local Public Health Clinic"
RURAL_CLINIC = "72", "Rural Health Clinic"
INDEPENDENT_LAB = "81", "Independent Laboratory"
OTHER = "99", "Other Place of Service"

class Meta:
managed = False
app_label = "canvas_sdk"
Expand Down Expand Up @@ -104,24 +131,6 @@ class Meta:
class Note(models.Model):
"""Note."""

class NoteType(models.TextChoices):
MESSAGE = "message", "Message"
LETTER = "letter", "Letter"
INPATIENT = "inpatient", "Inpatient Visit Note"
REVIEW = "review", "Chart Review Note"
VOICE = "voice", "Phone Call Note"
VIDEO = "video", "Video Call Note"
OFFICE = "office", "Office Visit Note"
LAB = "lab", "Lab Visit Note"
HOME = "home", "Home Visit Note"
GROUP = "group", "Group Visit Note"
APPOINTMENT = "appointment", "Appointment Note"
OFFSITE = "offsite", "Other Offsite Visit Note"
SEARCH = "search", "Search"
TASK = "task", "Task"
DATA = "data", "Data"
CCDA = "ccda", "C-CDA Import"

class Meta:
managed = False
app_label = "canvas_sdk"
Expand All @@ -133,7 +142,7 @@ class Meta:
modified = models.DateTimeField()
patient = models.ForeignKey(Patient, on_delete=models.DO_NOTHING)
# provider = models.ForeignKey(Staff, on_delete=models.DO_NOTHING, related_name="notes")
note_type = models.CharField(choices=NoteType.choices, null=True)
note_type = models.CharField(choices=NoteTypes.choices, null=True)
note_type_version = models.ForeignKey(
"NoteType", on_delete=models.DO_NOTHING, related_name="notes"
)
Expand Down

0 comments on commit 9483ead

Please sign in to comment.